Skip to content

Latest commit

 

History

History
454 lines (317 loc) · 13.3 KB

FlagApi.md

File metadata and controls

454 lines (317 loc) · 13.3 KB

Flagr\Client\FlagApi

All URIs are relative to /api/v1

Method HTTP request Description
createFlag POST /flags
deleteFlag DELETE /flags/{flagID}
findFlags GET /flags
getFlag GET /flags/{flagID}
getFlagEntityTypes GET /flags/entity_types
getFlagSnapshots GET /flags/{flagID}/snapshots
putFlag PUT /flags/{flagID}
restoreFlag PUT /flags/{flagID}/restore
setFlagEnabled PUT /flags/{flagID}/enabled

createFlag

\Flagr\Client\Model\Flag createFlag($body)

Example

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

$apiInstance = new Flagr\Client\Api\FlagApi(
    // 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\CreateFlagRequest(); // \Flagr\Client\Model\CreateFlagRequest | create a flag

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

Parameters

Name Type Description Notes
body \Flagr\Client\Model\CreateFlagRequest create a flag

Return type

\Flagr\Client\Model\Flag

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]

deleteFlag

deleteFlag($flag_id)

Example

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

$apiInstance = new Flagr\Client\Api\FlagApi(
    // 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

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

Parameters

Name Type Description Notes
flag_id int numeric ID of the flag

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]

findFlags

\Flagr\Client\Model\Flag[] findFlags($limit, $enabled, $description, $tags, $description_like, $key, $offset, $preload, $deleted)

Example

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

$apiInstance = new Flagr\Client\Api\FlagApi(
    // 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()
);
$limit = 789; // int | the numbers of flags to return
$enabled = true; // bool | return flags having given enabled status
$description = "description_example"; // string | return flags exactly matching given description
$tags = "tags_example"; // string | return flags with the given tags (comma separated)
$description_like = "description_like_example"; // string | return flags partially matching given description
$key = "key_example"; // string | return flags matching given key
$offset = 789; // int | return flags given the offset, it should usually set together with limit
$preload = true; // bool | return flags with preloaded segments and variants
$deleted = true; // bool | return all deleted flags

try {
    $result = $apiInstance->findFlags($limit, $enabled, $description, $tags, $description_like, $key, $offset, $preload, $deleted);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FlagApi->findFlags: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
limit int the numbers of flags to return [optional]
enabled bool return flags having given enabled status [optional]
description string return flags exactly matching given description [optional]
tags string return flags with the given tags (comma separated) [optional]
description_like string return flags partially matching given description [optional]
key string return flags matching given key [optional]
offset int return flags given the offset, it should usually set together with limit [optional]
preload bool return flags with preloaded segments and variants [optional]
deleted bool return all deleted flags [optional]

Return type

\Flagr\Client\Model\Flag[]

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]

getFlag

\Flagr\Client\Model\Flag getFlag($flag_id)

Example

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

$apiInstance = new Flagr\Client\Api\FlagApi(
    // 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->getFlag($flag_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FlagApi->getFlag: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

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

Return type

\Flagr\Client\Model\Flag

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]

getFlagEntityTypes

string[] getFlagEntityTypes()

Example

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

$apiInstance = new Flagr\Client\Api\FlagApi(
    // 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()
);

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

Parameters

This endpoint does not need any parameter.

Return type

string[]

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]

getFlagSnapshots

\Flagr\Client\Model\FlagSnapshot[] getFlagSnapshots($flag_id)

Example

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

$apiInstance = new Flagr\Client\Api\FlagApi(
    // 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->getFlagSnapshots($flag_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FlagApi->getFlagSnapshots: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

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

Return type

\Flagr\Client\Model\FlagSnapshot[]

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]

putFlag

\Flagr\Client\Model\Flag putFlag($body, $flag_id)

Example

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

$apiInstance = new Flagr\Client\Api\FlagApi(
    // 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\PutFlagRequest(); // \Flagr\Client\Model\PutFlagRequest | update a flag
$flag_id = 789; // int | numeric ID of the flag to get

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

Parameters

Name Type Description Notes
body \Flagr\Client\Model\PutFlagRequest update a flag
flag_id int numeric ID of the flag to get

Return type

\Flagr\Client\Model\Flag

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]

restoreFlag

\Flagr\Client\Model\Flag restoreFlag($flag_id)

Example

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

$apiInstance = new Flagr\Client\Api\FlagApi(
    // 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->restoreFlag($flag_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FlagApi->restoreFlag: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

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

Return type

\Flagr\Client\Model\Flag

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]

setFlagEnabled

\Flagr\Client\Model\Flag setFlagEnabled($body, $flag_id)

Example

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

$apiInstance = new Flagr\Client\Api\FlagApi(
    // 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\SetFlagEnabledRequest(); // \Flagr\Client\Model\SetFlagEnabledRequest | set flag enabled state
$flag_id = 789; // int | numeric ID of the flag to get

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

Parameters

Name Type Description Notes
body \Flagr\Client\Model\SetFlagEnabledRequest set flag enabled state
flag_id int numeric ID of the flag to get

Return type

\Flagr\Client\Model\Flag

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]