Skip to content

Latest commit

 

History

History
472 lines (330 loc) · 17.7 KB

File metadata and controls

472 lines (330 loc) · 17.7 KB

OpenAPI\Client\TenantsApi

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

Method HTTP request Description
createTenant() POST /v2/facts/{proj_id}/{env_id}/tenants Create Tenant
deleteTenant() DELETE /v2/facts/{proj_id}/{env_id}/tenants/{tenant_id} Delete Tenant
deleteTenantUser() DELETE /v2/facts/{proj_id}/{env_id}/tenants/{tenant_id}/users/{user_id} Delete Tenant User
getTenant() GET /v2/facts/{proj_id}/{env_id}/tenants/{tenant_id} Get Tenant
listTenantUsers() GET /v2/facts/{proj_id}/{env_id}/tenants/{tenant_id}/users List Tenant Users
listTenants() GET /v2/facts/{proj_id}/{env_id}/tenants List Tenants
updateTenant() PATCH /v2/facts/{proj_id}/{env_id}/tenants/{tenant_id} Update Tenant

createTenant()

createTenant($proj_id, $env_id, $tenant_create): \OpenAPI\Client\Model\TenantRead

Create Tenant

Creates a new tenant inside the Permit.io system. If the tenant is already created: will return 200 instead of 201, and will return the existing tenant object in the response body.

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\TenantsApi(
    // 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\").
$tenant_create = new \OpenAPI\Client\Model\TenantCreate(); // \OpenAPI\Client\Model\TenantCreate

try {
    $result = $apiInstance->createTenant($proj_id, $env_id, $tenant_create);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TenantsApi->createTenant: ', $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;).
tenant_create \OpenAPI\Client\Model\TenantCreate

Return type

\OpenAPI\Client\Model\TenantRead

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]

deleteTenant()

deleteTenant($proj_id, $env_id, $tenant_id)

Delete Tenant

Deletes the tenant 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\TenantsApi(
    // 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\").
$tenant_id = 'tenant_id_example'; // string | Either the unique id of the tenant, or the URL-friendly key of the tenant (i.e: the \"slug\").

try {
    $apiInstance->deleteTenant($proj_id, $env_id, $tenant_id);
} catch (Exception $e) {
    echo 'Exception when calling TenantsApi->deleteTenant: ', $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;).
tenant_id string Either the unique id of the tenant, or the URL-friendly key of the tenant (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]

deleteTenantUser()

deleteTenantUser($proj_id, $env_id, $tenant_id, $user_id)

Delete Tenant User

Deletes a user under a tenant.

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\TenantsApi(
    // 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\").
$tenant_id = 'tenant_id_example'; // string | Either the unique id of the tenant, or the URL-friendly key of the tenant (i.e: the \"slug\").
$user_id = 'user_id_example'; // string | Either the unique id of the user, or the URL-friendly key of the user (i.e: the \"slug\").

try {
    $apiInstance->deleteTenantUser($proj_id, $env_id, $tenant_id, $user_id);
} catch (Exception $e) {
    echo 'Exception when calling TenantsApi->deleteTenantUser: ', $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;).
tenant_id string Either the unique id of the tenant, or the URL-friendly key of the tenant (i.e: the &quot;slug&quot;).
user_id string Either the unique id of the user, or the URL-friendly key of the user (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]

getTenant()

getTenant($proj_id, $env_id, $tenant_id): \OpenAPI\Client\Model\TenantRead

Get Tenant

Gets a tenant, if such tenant exists. Otherwise returns 404.

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\TenantsApi(
    // 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\").
$tenant_id = 'tenant_id_example'; // string | Either the unique id of the tenant, or the URL-friendly key of the tenant (i.e: the \"slug\").

try {
    $result = $apiInstance->getTenant($proj_id, $env_id, $tenant_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TenantsApi->getTenant: ', $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;).
tenant_id string Either the unique id of the tenant, or the URL-friendly key of the tenant (i.e: the &quot;slug&quot;).

Return type

\OpenAPI\Client\Model\TenantRead

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]

listTenantUsers()

listTenantUsers($proj_id, $tenant_id, $env_id, $search, $page, $per_page): \OpenAPI\Client\Model\PaginatedResultUserRead

List Tenant Users

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\TenantsApi(
    // 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\").
$tenant_id = 'tenant_id_example'; // string | Either the unique id of the tenant, or the URL-friendly key of the tenant (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\").
$search = 'search_example'; // string | Text search for the email field
$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->listTenantUsers($proj_id, $tenant_id, $env_id, $search, $page, $per_page);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TenantsApi->listTenantUsers: ', $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;).
tenant_id string Either the unique id of the tenant, or the URL-friendly key of the tenant (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;).
search string Text search for the email field [optional]
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\PaginatedResultUserRead

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]

listTenants()

listTenants($proj_id, $env_id, $search, $page, $per_page): \OpenAPI\Client\Model\TenantRead[]

List Tenants

Lists all the tenants defined within an environment.

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\TenantsApi(
    // 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\").
$search = 'search_example'; // string | Text search for the tenant name or key
$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->listTenants($proj_id, $env_id, $search, $page, $per_page);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TenantsApi->listTenants: ', $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;).
search string Text search for the tenant name or key [optional]
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\TenantRead[]

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]

updateTenant()

updateTenant($proj_id, $env_id, $tenant_id, $tenant_update): \OpenAPI\Client\Model\TenantRead

Update Tenant

Partially updates the tenant 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\TenantsApi(
    // 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\").
$tenant_id = 'tenant_id_example'; // string | Either the unique id of the tenant, or the URL-friendly key of the tenant (i.e: the \"slug\").
$tenant_update = new \OpenAPI\Client\Model\TenantUpdate(); // \OpenAPI\Client\Model\TenantUpdate

try {
    $result = $apiInstance->updateTenant($proj_id, $env_id, $tenant_id, $tenant_update);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TenantsApi->updateTenant: ', $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;).
tenant_id string Either the unique id of the tenant, or the URL-friendly key of the tenant (i.e: the &quot;slug&quot;).
tenant_update \OpenAPI\Client\Model\TenantUpdate

Return type

\OpenAPI\Client\Model\TenantRead

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]