Skip to content

Latest commit

 

History

History
404 lines (281 loc) · 15.6 KB

File metadata and controls

404 lines (281 loc) · 15.6 KB

OpenAPI\Client\ResourcesApi

All URIs are relative to http://localhost, except if the operation defines another base path.

Method HTTP request Description
createResource() POST /v2/schema/{proj_id}/{env_id}/resources Create Resource
deleteResource() DELETE /v2/schema/{proj_id}/{env_id}/resources/{resource_id} Delete Resource
getResource() GET /v2/schema/{proj_id}/{env_id}/resources/{resource_id} Get Resource
listResources() GET /v2/schema/{proj_id}/{env_id}/resources List Resources
replaceResource() PUT /v2/schema/{proj_id}/{env_id}/resources/{resource_id} Replace Resource
updateResource() PATCH /v2/schema/{proj_id}/{env_id}/resources/{resource_id} Update Resource

createResource()

createResource($proj_id, $env_id, $resource_create): \OpenAPI\Client\Model\ResourceRead

Create Resource

Creates a new resource (a type of object you may protect with permissions).

Example

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


// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\ResourcesApi(
    // 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(),
    $config
);
$proj_id = 'proj_id_example'; // string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
$env_id = 'env_id_example'; // string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
$resource_create = new \OpenAPI\Client\Model\ResourceCreate(); // \OpenAPI\Client\Model\ResourceCreate

try {
    $result = $apiInstance->createResource($proj_id, $env_id, $resource_create);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResourcesApi->createResource: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
proj_id string Either the unique id of the project, or the URL-friendly key of the project (i.e: the &quot;slug&quot;).
env_id string Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the &quot;slug&quot;).
resource_create \OpenAPI\Client\Model\ResourceCreate

Return type

\OpenAPI\Client\Model\ResourceRead

Authorization

HTTPBearer

HTTP request headers

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

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

deleteResource()

deleteResource($proj_id, $env_id, $resource_id)

Delete Resource

Deletes the resource and all its related data.

Example

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


// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\ResourcesApi(
    // 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(),
    $config
);
$proj_id = 'proj_id_example'; // string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
$env_id = 'env_id_example'; // string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
$resource_id = 'resource_id_example'; // string | Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\").

try {
    $apiInstance->deleteResource($proj_id, $env_id, $resource_id);
} catch (Exception $e) {
    echo 'Exception when calling ResourcesApi->deleteResource: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
proj_id string Either the unique id of the project, or the URL-friendly key of the project (i.e: the &quot;slug&quot;).
env_id string Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the &quot;slug&quot;).
resource_id string Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the &quot;slug&quot;).

Return type

void (empty response body)

Authorization

HTTPBearer

HTTP request headers

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

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

getResource()

getResource($proj_id, $env_id, $resource_id): \OpenAPI\Client\Model\ResourceRead

Get Resource

Gets a single resource, if such resource exists.

Example

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


// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\ResourcesApi(
    // 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(),
    $config
);
$proj_id = 'proj_id_example'; // string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
$env_id = 'env_id_example'; // string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
$resource_id = 'resource_id_example'; // string | Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\").

try {
    $result = $apiInstance->getResource($proj_id, $env_id, $resource_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResourcesApi->getResource: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
proj_id string Either the unique id of the project, or the URL-friendly key of the project (i.e: the &quot;slug&quot;).
env_id string Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the &quot;slug&quot;).
resource_id string Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the &quot;slug&quot;).

Return type

\OpenAPI\Client\Model\ResourceRead

Authorization

HTTPBearer

HTTP request headers

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

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

listResources()

listResources($proj_id, $env_id, $include_built_in, $page, $per_page): \OpenAPI\Client\Model\ResourceRead[]

List Resources

Lists all the resources defined in your schema.

Example

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


// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\ResourcesApi(
    // 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(),
    $config
);
$proj_id = 'proj_id_example'; // string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
$env_id = 'env_id_example'; // string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
$include_built_in = false; // bool | Whether to include or exclude built-in resources, default is False
$page = 1; // int | Page number of the results to fetch, starting at 1.
$per_page = 30; // int | The number of results per page (max 100).

try {
    $result = $apiInstance->listResources($proj_id, $env_id, $include_built_in, $page, $per_page);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResourcesApi->listResources: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
proj_id string Either the unique id of the project, or the URL-friendly key of the project (i.e: the &quot;slug&quot;).
env_id string Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the &quot;slug&quot;).
include_built_in bool Whether to include or exclude built-in resources, default is False [optional] [default to false]
page int Page number of the results to fetch, starting at 1. [optional] [default to 1]
per_page int The number of results per page (max 100). [optional] [default to 30]

Return type

\OpenAPI\Client\Model\ResourceRead[]

Authorization

HTTPBearer

HTTP request headers

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

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

replaceResource()

replaceResource($proj_id, $env_id, $resource_id, $resource_replace): \OpenAPI\Client\Model\ResourceRead

Replace Resource

Completely replaces the resource definition. - If the resource key is changed, all role and permissions assignments for the the resource will be revoked. - If the resource key is unchanged, but some actions are removed or renamed from the resource definition, role and permissions assignments for these actions will be revoked. TODO: we need to decide if we are auto-revoking, or if we are rejecting the PUT completely while there are permissions that can be affected.

Example

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


// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\ResourcesApi(
    // 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(),
    $config
);
$proj_id = 'proj_id_example'; // string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
$env_id = 'env_id_example'; // string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
$resource_id = 'resource_id_example'; // string | Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\").
$resource_replace = new \OpenAPI\Client\Model\ResourceReplace(); // \OpenAPI\Client\Model\ResourceReplace

try {
    $result = $apiInstance->replaceResource($proj_id, $env_id, $resource_id, $resource_replace);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResourcesApi->replaceResource: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
proj_id string Either the unique id of the project, or the URL-friendly key of the project (i.e: the &quot;slug&quot;).
env_id string Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the &quot;slug&quot;).
resource_id string Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the &quot;slug&quot;).
resource_replace \OpenAPI\Client\Model\ResourceReplace

Return type

\OpenAPI\Client\Model\ResourceRead

Authorization

HTTPBearer

HTTP request headers

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

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

updateResource()

updateResource($proj_id, $env_id, $resource_id, $resource_update): \OpenAPI\Client\Model\ResourceRead

Update Resource

Partially updates the resource definition. Fields that will be provided will be completely overwritten.

Example

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


// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\ResourcesApi(
    // 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(),
    $config
);
$proj_id = 'proj_id_example'; // string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
$env_id = 'env_id_example'; // string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
$resource_id = 'resource_id_example'; // string | Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the \"slug\").
$resource_update = new \OpenAPI\Client\Model\ResourceUpdate(); // \OpenAPI\Client\Model\ResourceUpdate

try {
    $result = $apiInstance->updateResource($proj_id, $env_id, $resource_id, $resource_update);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ResourcesApi->updateResource: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
proj_id string Either the unique id of the project, or the URL-friendly key of the project (i.e: the &quot;slug&quot;).
env_id string Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the &quot;slug&quot;).
resource_id string Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the &quot;slug&quot;).
resource_update \OpenAPI\Client\Model\ResourceUpdate

Return type

\OpenAPI\Client\Model\ResourceRead

Authorization

HTTPBearer

HTTP request headers

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

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