Skip to content

Latest commit

 

History

History
255 lines (177 loc) · 7.49 KB

SegmentApi.md

File metadata and controls

255 lines (177 loc) · 7.49 KB

Flagr\Client\SegmentApi

All URIs are relative to /api/v1

Method HTTP request Description
createSegment POST /flags/{flagID}/segments
deleteSegment DELETE /flags/{flagID}/segments/{segmentID}
findSegments GET /flags/{flagID}/segments
putSegment PUT /flags/{flagID}/segments/{segmentID}
putSegmentsReorder PUT /flags/{flagID}/segments/reorder

createSegment

\Flagr\Client\Model\Segment createSegment($body, $flag_id)

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Flagr\Client\Api\SegmentApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$body = new \Flagr\Client\Model\CreateSegmentRequest(); // \Flagr\Client\Model\CreateSegmentRequest | create a segment under a flag
$flag_id = 789; // int | numeric ID of the flag to get

try {
    $result = $apiInstance->createSegment($body, $flag_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SegmentApi->createSegment: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
body \Flagr\Client\Model\CreateSegmentRequest create a segment under a flag
flag_id int numeric ID of the flag to get

Return type

\Flagr\Client\Model\Segment

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteSegment

deleteSegment($flag_id, $segment_id)

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Flagr\Client\Api\SegmentApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$flag_id = 789; // int | numeric ID of the flag
$segment_id = 789; // int | numeric ID of the segment

try {
    $apiInstance->deleteSegment($flag_id, $segment_id);
} catch (Exception $e) {
    echo 'Exception when calling SegmentApi->deleteSegment: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
flag_id int numeric ID of the flag
segment_id int numeric ID of the segment

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

findSegments

\Flagr\Client\Model\Segment[] findSegments($flag_id)

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Flagr\Client\Api\SegmentApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$flag_id = 789; // int | numeric ID of the flag to get

try {
    $result = $apiInstance->findSegments($flag_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SegmentApi->findSegments: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
flag_id int numeric ID of the flag to get

Return type

\Flagr\Client\Model\Segment[]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

putSegment

\Flagr\Client\Model\Segment putSegment($body, $flag_id, $segment_id)

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Flagr\Client\Api\SegmentApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$body = new \Flagr\Client\Model\PutSegmentRequest(); // \Flagr\Client\Model\PutSegmentRequest | update a segment
$flag_id = 789; // int | numeric ID of the flag
$segment_id = 789; // int | numeric ID of the segment

try {
    $result = $apiInstance->putSegment($body, $flag_id, $segment_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling SegmentApi->putSegment: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
body \Flagr\Client\Model\PutSegmentRequest update a segment
flag_id int numeric ID of the flag
segment_id int numeric ID of the segment

Return type

\Flagr\Client\Model\Segment

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

putSegmentsReorder

putSegmentsReorder($body, $flag_id)

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Flagr\Client\Api\SegmentApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$body = new \Flagr\Client\Model\PutSegmentReorderRequest(); // \Flagr\Client\Model\PutSegmentReorderRequest | reorder segments
$flag_id = 789; // int | numeric ID of the flag

try {
    $apiInstance->putSegmentsReorder($body, $flag_id);
} catch (Exception $e) {
    echo 'Exception when calling SegmentApi->putSegmentsReorder: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
body \Flagr\Client\Model\PutSegmentReorderRequest reorder segments
flag_id int numeric ID of the flag

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]