Add api client for playwright e2e tests (#2901)
* chore: 🤖 add @openapitools/openapi-generator-cli * chore: 🤖 Add @nestjs/core and @openapitools/openapi-generator-cli to ignoredBuiltDependencies These packages use postinstall for a opencollective notice * chore: 🤖 add package.json scripts for open-api client gen * chore: 🤖 add openapi generated files * chore: 🤖 add boundary api client fixture * chore: 🤖 incorporate api client fixture with base fixture * chore: 🤖 migrate existing test to use boundary api fixture * refactor: 💡 remove org cleanup from test * refactor: 💡 update sorting e2e test to use api client * refactor: 💡 clean up api client resource clean up logging * docs: ✏️ update jsdoc links for domain clients * chore: 🤖 avoid adding copywright headers to generated api * Add missing copyright headers * chore: 🤖 remove fetch argument from api client class The hope was to use request.fetch but playwright's fetch is a non-standard fetch which causes the generated api client to fail when using .clone() on the response * chore: 🤖 add optional OPENAPI_SWAGGER_URL_OR_FILE for openapi-client generation The OPENAPI_SWAGGER_URL_OR_FILE env var can be used to specify the -i flag the generate:api-client script with either: * a relative path * an absolute path * a url like: https://raw.githubusercontent.com/hashicorp/boundary/refs/heads/main/internal/gen/controller.swagger.json * refactor: 💡 clean up and refactor boundary-api-client fixture * chore: 🤖 add extra doc links and delete methods * test: 💍 add test to ensure that api-client fixture works * test: 💍 update existing e2e test examples with api-client * docs: ✏️ add comment for api-client e2e test * docs: ✏️ add additional links to service docs for api clients * refactor: 💡 cleanup api-client and corresponding test * docs: ✏️ add api client fixture docs to e2e README * fix: 🐛 fix regex * remove unnecessary capture group * add "-" to regex to allow for url segments like "storage-buckets" in "/v1/storage-buckets" * docs: ✏️ comment potential edge case in e2e api client cleanup * docs: ✏️ fix comment typo Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com> * docs: ✏️ remove auth flag for generating e2e client * docs: ✏️ add mention that java is required for generate:api * chore: 🤖 implement pr feedback * chore: 🤖 Clean up api client and add more extensive test * chore: 🤖 fix casing in api-client test Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com> --------- Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com>
This commit is contained in:
1 parent
5fd9f0216a
commit
b42ecbff36
262 files changed
+31646
-192
No files matched your search
@@ -0,0 +1,377 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Boundary controller HTTP API
|
||||
* Welcome to the Boundary controller HTTP API documentation. This page provides a reference guide for using the Boundary controller API, a JSON-based HTTP API. The API implements commonly seen HTTP API patterns for status codes, paths, and errors. See the [API overview](https://developer.hashicorp.com/boundary/docs/api-clients/api) for more information. Before you read this page, it is useful to understand Boundary\'s [domain model](https://developer.hashicorp.com/boundary/docs/concepts/domain-model) and to be aware of the terminology used here. To get started, search for the service you want to interact with in the sidebar to the left. Each resource in Boundary, such as accounts and credential stores, has its own service. Each service contains all the API endpoints for the resource. ## Status codes - `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it follows well-understood semantics for those status codes. - `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which returns a `404` as discussed below. - `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource returns a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action. - `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action. - `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist returns a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it\'s tolerable as it allows for far simpler and more robust client implementation. - `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource. - `429`: Boundary returns a `429` if any of the API rate limit quotas have been exhausted for the resource and action. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. - `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error is logged to Boundary\'s server log but is not generally provided to the client. - `503`: Boundary returns a `503` if it is unable to store a quota due to the API rate limit being exceeded. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. ## List pagination Boundary uses [API pagination](https://developer.hashicorp.com/boundary/docs/api-clients/api/pagination) to support searching and filtering large lists of results efficiently.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.19.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
ControllerApiResourcesAccountsV1Account,
|
||||
ControllerApiServicesV1AccountServiceChangePasswordBody,
|
||||
ControllerApiServicesV1AccountServiceSetPasswordBody,
|
||||
ControllerApiServicesV1ListAccountsResponse,
|
||||
ControllerApiV1Error,
|
||||
} from '../models/index';
|
||||
import {
|
||||
ControllerApiResourcesAccountsV1AccountFromJSON,
|
||||
ControllerApiResourcesAccountsV1AccountToJSON,
|
||||
ControllerApiServicesV1AccountServiceChangePasswordBodyFromJSON,
|
||||
ControllerApiServicesV1AccountServiceChangePasswordBodyToJSON,
|
||||
ControllerApiServicesV1AccountServiceSetPasswordBodyFromJSON,
|
||||
ControllerApiServicesV1AccountServiceSetPasswordBodyToJSON,
|
||||
ControllerApiServicesV1ListAccountsResponseFromJSON,
|
||||
ControllerApiServicesV1ListAccountsResponseToJSON,
|
||||
ControllerApiV1ErrorFromJSON,
|
||||
ControllerApiV1ErrorToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface AccountServiceChangePasswordRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1AccountServiceChangePasswordBody;
|
||||
}
|
||||
|
||||
export interface AccountServiceCreateAccountRequest {
|
||||
item: Omit<ControllerApiResourcesAccountsV1Account, 'id'|'created_time'|'updated_time'|'managed_group_ids'|'authorized_actions'>;
|
||||
}
|
||||
|
||||
export interface AccountServiceDeleteAccountRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface AccountServiceGetAccountRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface AccountServiceListAccountsRequest {
|
||||
authMethodId?: string;
|
||||
filter?: string;
|
||||
listToken?: string;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface AccountServiceSetPasswordRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1AccountServiceSetPasswordBody;
|
||||
}
|
||||
|
||||
export interface AccountServiceUpdateAccountRequest {
|
||||
id: string;
|
||||
item: Omit<ControllerApiResourcesAccountsV1Account, 'id'|'created_time'|'updated_time'|'managed_group_ids'|'authorized_actions'>;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class AccountServiceApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Sets the password for the provided account.
|
||||
*/
|
||||
async accountServiceChangePasswordRaw(requestParameters: AccountServiceChangePasswordRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesAccountsV1Account>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling accountServiceChangePassword().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling accountServiceChangePassword().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/accounts/{id}:change-password`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1AccountServiceChangePasswordBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesAccountsV1AccountFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the password for the provided account.
|
||||
*/
|
||||
async accountServiceChangePassword(requestParameters: AccountServiceChangePasswordRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesAccountsV1Account> {
|
||||
const response = await this.accountServiceChangePasswordRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single account in the provided auth method.
|
||||
*/
|
||||
async accountServiceCreateAccountRaw(requestParameters: AccountServiceCreateAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesAccountsV1Account>> {
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling accountServiceCreateAccount().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/accounts`,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesAccountsV1AccountToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesAccountsV1AccountFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single account in the provided auth method.
|
||||
*/
|
||||
async accountServiceCreateAccount(requestParameters: AccountServiceCreateAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesAccountsV1Account> {
|
||||
const response = await this.accountServiceCreateAccountRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes an account.
|
||||
*/
|
||||
async accountServiceDeleteAccountRaw(requestParameters: AccountServiceDeleteAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling accountServiceDeleteAccount().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/accounts/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse<any>(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes an account.
|
||||
*/
|
||||
async accountServiceDeleteAccount(requestParameters: AccountServiceDeleteAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object> {
|
||||
const response = await this.accountServiceDeleteAccountRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single account based on the input ID
|
||||
*/
|
||||
async accountServiceGetAccountRaw(requestParameters: AccountServiceGetAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesAccountsV1Account>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling accountServiceGetAccount().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/accounts/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesAccountsV1AccountFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single account based on the input ID
|
||||
*/
|
||||
async accountServiceGetAccount(requestParameters: AccountServiceGetAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesAccountsV1Account> {
|
||||
const response = await this.accountServiceGetAccountRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all accounts in a specific auth method.
|
||||
*/
|
||||
async accountServiceListAccountsRaw(requestParameters: AccountServiceListAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1ListAccountsResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['authMethodId'] != null) {
|
||||
queryParameters['auth_method_id'] = requestParameters['authMethodId'];
|
||||
}
|
||||
|
||||
if (requestParameters['filter'] != null) {
|
||||
queryParameters['filter'] = requestParameters['filter'];
|
||||
}
|
||||
|
||||
if (requestParameters['listToken'] != null) {
|
||||
queryParameters['list_token'] = requestParameters['listToken'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['page_size'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/accounts`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1ListAccountsResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all accounts in a specific auth method.
|
||||
*/
|
||||
async accountServiceListAccounts(requestParameters: AccountServiceListAccountsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1ListAccountsResponse> {
|
||||
const response = await this.accountServiceListAccountsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the password for the provided account.
|
||||
*/
|
||||
async accountServiceSetPasswordRaw(requestParameters: AccountServiceSetPasswordRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesAccountsV1Account>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling accountServiceSetPassword().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling accountServiceSetPassword().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/accounts/{id}:set-password`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1AccountServiceSetPasswordBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesAccountsV1AccountFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the password for the provided account.
|
||||
*/
|
||||
async accountServiceSetPassword(requestParameters: AccountServiceSetPasswordRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesAccountsV1Account> {
|
||||
const response = await this.accountServiceSetPasswordRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an account.
|
||||
*/
|
||||
async accountServiceUpdateAccountRaw(requestParameters: AccountServiceUpdateAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesAccountsV1Account>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling accountServiceUpdateAccount().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling accountServiceUpdateAccount().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/accounts/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'PATCH',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesAccountsV1AccountToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesAccountsV1AccountFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an account.
|
||||
*/
|
||||
async accountServiceUpdateAccount(requestParameters: AccountServiceUpdateAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesAccountsV1Account> {
|
||||
const response = await this.accountServiceUpdateAccountRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,272 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Boundary controller HTTP API
|
||||
* Welcome to the Boundary controller HTTP API documentation. This page provides a reference guide for using the Boundary controller API, a JSON-based HTTP API. The API implements commonly seen HTTP API patterns for status codes, paths, and errors. See the [API overview](https://developer.hashicorp.com/boundary/docs/api-clients/api) for more information. Before you read this page, it is useful to understand Boundary\'s [domain model](https://developer.hashicorp.com/boundary/docs/concepts/domain-model) and to be aware of the terminology used here. To get started, search for the service you want to interact with in the sidebar to the left. Each resource in Boundary, such as accounts and credential stores, has its own service. Each service contains all the API endpoints for the resource. ## Status codes - `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it follows well-understood semantics for those status codes. - `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which returns a `404` as discussed below. - `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource returns a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action. - `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action. - `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist returns a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it\'s tolerable as it allows for far simpler and more robust client implementation. - `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource. - `429`: Boundary returns a `429` if any of the API rate limit quotas have been exhausted for the resource and action. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. - `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error is logged to Boundary\'s server log but is not generally provided to the client. - `503`: Boundary returns a `503` if it is unable to store a quota due to the API rate limit being exceeded. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. ## List pagination Boundary uses [API pagination](https://developer.hashicorp.com/boundary/docs/api-clients/api/pagination) to support searching and filtering large lists of results efficiently.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.19.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
ControllerApiResourcesAliasesV1Alias,
|
||||
ControllerApiServicesV1ListAliasesResponse,
|
||||
ControllerApiV1Error,
|
||||
} from '../models/index';
|
||||
import {
|
||||
ControllerApiResourcesAliasesV1AliasFromJSON,
|
||||
ControllerApiResourcesAliasesV1AliasToJSON,
|
||||
ControllerApiServicesV1ListAliasesResponseFromJSON,
|
||||
ControllerApiServicesV1ListAliasesResponseToJSON,
|
||||
ControllerApiV1ErrorFromJSON,
|
||||
ControllerApiV1ErrorToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface AliasServiceCreateAliasRequest {
|
||||
item: Omit<ControllerApiResourcesAliasesV1Alias, 'id'|'created_time'|'updated_time'|'authorized_actions'>;
|
||||
}
|
||||
|
||||
export interface AliasServiceDeleteAliasRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface AliasServiceGetAliasRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface AliasServiceListAliasesRequest {
|
||||
scopeId?: string;
|
||||
recursive?: boolean;
|
||||
filter?: string;
|
||||
listToken?: string;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface AliasServiceUpdateAliasRequest {
|
||||
id: string;
|
||||
item: Omit<ControllerApiResourcesAliasesV1Alias, 'id'|'created_time'|'updated_time'|'authorized_actions'>;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class AliasServiceApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Creates a single Alias in the provided scope.
|
||||
*/
|
||||
async aliasServiceCreateAliasRaw(requestParameters: AliasServiceCreateAliasRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesAliasesV1Alias>> {
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling aliasServiceCreateAlias().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/aliases`,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesAliasesV1AliasToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesAliasesV1AliasFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single Alias in the provided scope.
|
||||
*/
|
||||
async aliasServiceCreateAlias(requestParameters: AliasServiceCreateAliasRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesAliasesV1Alias> {
|
||||
const response = await this.aliasServiceCreateAliasRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes an Alias.
|
||||
*/
|
||||
async aliasServiceDeleteAliasRaw(requestParameters: AliasServiceDeleteAliasRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling aliasServiceDeleteAlias().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/aliases/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse<any>(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes an Alias.
|
||||
*/
|
||||
async aliasServiceDeleteAlias(requestParameters: AliasServiceDeleteAliasRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object> {
|
||||
const response = await this.aliasServiceDeleteAliasRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Alias.
|
||||
*/
|
||||
async aliasServiceGetAliasRaw(requestParameters: AliasServiceGetAliasRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesAliasesV1Alias>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling aliasServiceGetAlias().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/aliases/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesAliasesV1AliasFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Alias.
|
||||
*/
|
||||
async aliasServiceGetAlias(requestParameters: AliasServiceGetAliasRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesAliasesV1Alias> {
|
||||
const response = await this.aliasServiceGetAliasRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Aliases in a specific Scope.
|
||||
*/
|
||||
async aliasServiceListAliasesRaw(requestParameters: AliasServiceListAliasesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1ListAliasesResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['scopeId'] != null) {
|
||||
queryParameters['scope_id'] = requestParameters['scopeId'];
|
||||
}
|
||||
|
||||
if (requestParameters['recursive'] != null) {
|
||||
queryParameters['recursive'] = requestParameters['recursive'];
|
||||
}
|
||||
|
||||
if (requestParameters['filter'] != null) {
|
||||
queryParameters['filter'] = requestParameters['filter'];
|
||||
}
|
||||
|
||||
if (requestParameters['listToken'] != null) {
|
||||
queryParameters['list_token'] = requestParameters['listToken'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['page_size'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/aliases`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1ListAliasesResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Aliases in a specific Scope.
|
||||
*/
|
||||
async aliasServiceListAliases(requestParameters: AliasServiceListAliasesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1ListAliasesResponse> {
|
||||
const response = await this.aliasServiceListAliasesRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an Alias.
|
||||
*/
|
||||
async aliasServiceUpdateAliasRaw(requestParameters: AliasServiceUpdateAliasRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesAliasesV1Alias>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling aliasServiceUpdateAlias().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling aliasServiceUpdateAlias().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/aliases/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'PATCH',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesAliasesV1AliasToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesAliasesV1AliasFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an Alias.
|
||||
*/
|
||||
async aliasServiceUpdateAlias(requestParameters: AliasServiceUpdateAliasRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesAliasesV1Alias> {
|
||||
const response = await this.aliasServiceUpdateAliasRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,385 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Boundary controller HTTP API
|
||||
* Welcome to the Boundary controller HTTP API documentation. This page provides a reference guide for using the Boundary controller API, a JSON-based HTTP API. The API implements commonly seen HTTP API patterns for status codes, paths, and errors. See the [API overview](https://developer.hashicorp.com/boundary/docs/api-clients/api) for more information. Before you read this page, it is useful to understand Boundary\'s [domain model](https://developer.hashicorp.com/boundary/docs/concepts/domain-model) and to be aware of the terminology used here. To get started, search for the service you want to interact with in the sidebar to the left. Each resource in Boundary, such as accounts and credential stores, has its own service. Each service contains all the API endpoints for the resource. ## Status codes - `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it follows well-understood semantics for those status codes. - `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which returns a `404` as discussed below. - `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource returns a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action. - `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action. - `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist returns a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it\'s tolerable as it allows for far simpler and more robust client implementation. - `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource. - `429`: Boundary returns a `429` if any of the API rate limit quotas have been exhausted for the resource and action. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. - `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error is logged to Boundary\'s server log but is not generally provided to the client. - `503`: Boundary returns a `503` if it is unable to store a quota due to the API rate limit being exceeded. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. ## List pagination Boundary uses [API pagination](https://developer.hashicorp.com/boundary/docs/api-clients/api/pagination) to support searching and filtering large lists of results efficiently.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.19.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
ControllerApiResourcesAuthmethodsV1AuthMethod,
|
||||
ControllerApiServicesV1AuthMethodServiceAuthenticateBody,
|
||||
ControllerApiServicesV1AuthMethodServiceChangeStateBody,
|
||||
ControllerApiServicesV1AuthenticateResponse,
|
||||
ControllerApiServicesV1ListAuthMethodsResponse,
|
||||
ControllerApiV1Error,
|
||||
} from '../models/index';
|
||||
import {
|
||||
ControllerApiResourcesAuthmethodsV1AuthMethodFromJSON,
|
||||
ControllerApiResourcesAuthmethodsV1AuthMethodToJSON,
|
||||
ControllerApiServicesV1AuthMethodServiceAuthenticateBodyFromJSON,
|
||||
ControllerApiServicesV1AuthMethodServiceAuthenticateBodyToJSON,
|
||||
ControllerApiServicesV1AuthMethodServiceChangeStateBodyFromJSON,
|
||||
ControllerApiServicesV1AuthMethodServiceChangeStateBodyToJSON,
|
||||
ControllerApiServicesV1AuthenticateResponseFromJSON,
|
||||
ControllerApiServicesV1AuthenticateResponseToJSON,
|
||||
ControllerApiServicesV1ListAuthMethodsResponseFromJSON,
|
||||
ControllerApiServicesV1ListAuthMethodsResponseToJSON,
|
||||
ControllerApiV1ErrorFromJSON,
|
||||
ControllerApiV1ErrorToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface AuthMethodServiceAuthenticateRequest {
|
||||
authMethodId: string;
|
||||
body: ControllerApiServicesV1AuthMethodServiceAuthenticateBody;
|
||||
}
|
||||
|
||||
export interface AuthMethodServiceChangeStateRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1AuthMethodServiceChangeStateBody;
|
||||
}
|
||||
|
||||
export interface AuthMethodServiceCreateAuthMethodRequest {
|
||||
item: Omit<ControllerApiResourcesAuthmethodsV1AuthMethod, 'id'|'created_time'|'updated_time'|'is_primary'|'authorized_actions'|'authorized_collection_actions'>;
|
||||
}
|
||||
|
||||
export interface AuthMethodServiceDeleteAuthMethodRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface AuthMethodServiceGetAuthMethodRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface AuthMethodServiceListAuthMethodsRequest {
|
||||
scopeId?: string;
|
||||
recursive?: boolean;
|
||||
filter?: string;
|
||||
listToken?: string;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface AuthMethodServiceUpdateAuthMethodRequest {
|
||||
id: string;
|
||||
item: Omit<ControllerApiResourcesAuthmethodsV1AuthMethod, 'id'|'created_time'|'updated_time'|'is_primary'|'authorized_actions'|'authorized_collection_actions'>;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class AuthMethodServiceApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Authenticate a user to an scope and retrieve an authentication token.
|
||||
*/
|
||||
async authMethodServiceAuthenticateRaw(requestParameters: AuthMethodServiceAuthenticateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1AuthenticateResponse>> {
|
||||
if (requestParameters['authMethodId'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'authMethodId',
|
||||
'Required parameter "authMethodId" was null or undefined when calling authMethodServiceAuthenticate().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling authMethodServiceAuthenticate().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/auth-methods/{auth_method_id}:authenticate`.replace(`{${"auth_method_id"}}`, encodeURIComponent(String(requestParameters['authMethodId']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1AuthMethodServiceAuthenticateBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1AuthenticateResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Authenticate a user to an scope and retrieve an authentication token.
|
||||
*/
|
||||
async authMethodServiceAuthenticate(requestParameters: AuthMethodServiceAuthenticateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1AuthenticateResponse> {
|
||||
const response = await this.authMethodServiceAuthenticateRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the state of an OIDC AuthMethod
|
||||
*/
|
||||
async authMethodServiceChangeStateRaw(requestParameters: AuthMethodServiceChangeStateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesAuthmethodsV1AuthMethod>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling authMethodServiceChangeState().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling authMethodServiceChangeState().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/auth-methods/{id}:change-state`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1AuthMethodServiceChangeStateBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesAuthmethodsV1AuthMethodFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the state of an OIDC AuthMethod
|
||||
*/
|
||||
async authMethodServiceChangeState(requestParameters: AuthMethodServiceChangeStateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesAuthmethodsV1AuthMethod> {
|
||||
const response = await this.authMethodServiceChangeStateRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single auth method.
|
||||
*/
|
||||
async authMethodServiceCreateAuthMethodRaw(requestParameters: AuthMethodServiceCreateAuthMethodRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesAuthmethodsV1AuthMethod>> {
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling authMethodServiceCreateAuthMethod().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/auth-methods`,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesAuthmethodsV1AuthMethodToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesAuthmethodsV1AuthMethodFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single auth method.
|
||||
*/
|
||||
async authMethodServiceCreateAuthMethod(requestParameters: AuthMethodServiceCreateAuthMethodRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesAuthmethodsV1AuthMethod> {
|
||||
const response = await this.authMethodServiceCreateAuthMethodRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes an AuthMethod
|
||||
*/
|
||||
async authMethodServiceDeleteAuthMethodRaw(requestParameters: AuthMethodServiceDeleteAuthMethodRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling authMethodServiceDeleteAuthMethod().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/auth-methods/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse<any>(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes an AuthMethod
|
||||
*/
|
||||
async authMethodServiceDeleteAuthMethod(requestParameters: AuthMethodServiceDeleteAuthMethodRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object> {
|
||||
const response = await this.authMethodServiceDeleteAuthMethodRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single auth method.
|
||||
*/
|
||||
async authMethodServiceGetAuthMethodRaw(requestParameters: AuthMethodServiceGetAuthMethodRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesAuthmethodsV1AuthMethod>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling authMethodServiceGetAuthMethod().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/auth-methods/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesAuthmethodsV1AuthMethodFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single auth method.
|
||||
*/
|
||||
async authMethodServiceGetAuthMethod(requestParameters: AuthMethodServiceGetAuthMethodRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesAuthmethodsV1AuthMethod> {
|
||||
const response = await this.authMethodServiceGetAuthMethodRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all auth methods.
|
||||
*/
|
||||
async authMethodServiceListAuthMethodsRaw(requestParameters: AuthMethodServiceListAuthMethodsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1ListAuthMethodsResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['scopeId'] != null) {
|
||||
queryParameters['scope_id'] = requestParameters['scopeId'];
|
||||
}
|
||||
|
||||
if (requestParameters['recursive'] != null) {
|
||||
queryParameters['recursive'] = requestParameters['recursive'];
|
||||
}
|
||||
|
||||
if (requestParameters['filter'] != null) {
|
||||
queryParameters['filter'] = requestParameters['filter'];
|
||||
}
|
||||
|
||||
if (requestParameters['listToken'] != null) {
|
||||
queryParameters['list_token'] = requestParameters['listToken'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['page_size'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/auth-methods`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1ListAuthMethodsResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all auth methods.
|
||||
*/
|
||||
async authMethodServiceListAuthMethods(requestParameters: AuthMethodServiceListAuthMethodsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1ListAuthMethodsResponse> {
|
||||
const response = await this.authMethodServiceListAuthMethodsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an auth method.
|
||||
*/
|
||||
async authMethodServiceUpdateAuthMethodRaw(requestParameters: AuthMethodServiceUpdateAuthMethodRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesAuthmethodsV1AuthMethod>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling authMethodServiceUpdateAuthMethod().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling authMethodServiceUpdateAuthMethod().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/auth-methods/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'PATCH',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesAuthmethodsV1AuthMethodToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesAuthmethodsV1AuthMethodFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an auth method.
|
||||
*/
|
||||
async authMethodServiceUpdateAuthMethod(requestParameters: AuthMethodServiceUpdateAuthMethodRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesAuthmethodsV1AuthMethod> {
|
||||
const response = await this.authMethodServiceUpdateAuthMethodRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Boundary controller HTTP API
|
||||
* Welcome to the Boundary controller HTTP API documentation. This page provides a reference guide for using the Boundary controller API, a JSON-based HTTP API. The API implements commonly seen HTTP API patterns for status codes, paths, and errors. See the [API overview](https://developer.hashicorp.com/boundary/docs/api-clients/api) for more information. Before you read this page, it is useful to understand Boundary\'s [domain model](https://developer.hashicorp.com/boundary/docs/concepts/domain-model) and to be aware of the terminology used here. To get started, search for the service you want to interact with in the sidebar to the left. Each resource in Boundary, such as accounts and credential stores, has its own service. Each service contains all the API endpoints for the resource. ## Status codes - `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it follows well-understood semantics for those status codes. - `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which returns a `404` as discussed below. - `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource returns a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action. - `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action. - `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist returns a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it\'s tolerable as it allows for far simpler and more robust client implementation. - `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource. - `429`: Boundary returns a `429` if any of the API rate limit quotas have been exhausted for the resource and action. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. - `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error is logged to Boundary\'s server log but is not generally provided to the client. - `503`: Boundary returns a `503` if it is unable to store a quota due to the API rate limit being exceeded. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. ## List pagination Boundary uses [API pagination](https://developer.hashicorp.com/boundary/docs/api-clients/api/pagination) to support searching and filtering large lists of results efficiently.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.19.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
ControllerApiResourcesAuthtokensV1AuthToken,
|
||||
ControllerApiServicesV1ListAuthTokensResponse,
|
||||
ControllerApiV1Error,
|
||||
} from '../models/index';
|
||||
import {
|
||||
ControllerApiResourcesAuthtokensV1AuthTokenFromJSON,
|
||||
ControllerApiResourcesAuthtokensV1AuthTokenToJSON,
|
||||
ControllerApiServicesV1ListAuthTokensResponseFromJSON,
|
||||
ControllerApiServicesV1ListAuthTokensResponseToJSON,
|
||||
ControllerApiV1ErrorFromJSON,
|
||||
ControllerApiV1ErrorToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface AuthTokenServiceDeleteAuthTokenRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface AuthTokenServiceGetAuthTokenRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface AuthTokenServiceListAuthTokensRequest {
|
||||
scopeId?: string;
|
||||
recursive?: boolean;
|
||||
filter?: string;
|
||||
listToken?: string;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class AuthTokenServiceApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Deletes an Auth Token.
|
||||
*/
|
||||
async authTokenServiceDeleteAuthTokenRaw(requestParameters: AuthTokenServiceDeleteAuthTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling authTokenServiceDeleteAuthToken().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/auth-tokens/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse<any>(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes an Auth Token.
|
||||
*/
|
||||
async authTokenServiceDeleteAuthToken(requestParameters: AuthTokenServiceDeleteAuthTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object> {
|
||||
const response = await this.authTokenServiceDeleteAuthTokenRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Auth Token.
|
||||
*/
|
||||
async authTokenServiceGetAuthTokenRaw(requestParameters: AuthTokenServiceGetAuthTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesAuthtokensV1AuthToken>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling authTokenServiceGetAuthToken().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/auth-tokens/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesAuthtokensV1AuthTokenFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Auth Token.
|
||||
*/
|
||||
async authTokenServiceGetAuthToken(requestParameters: AuthTokenServiceGetAuthTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesAuthtokensV1AuthToken> {
|
||||
const response = await this.authTokenServiceGetAuthTokenRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Auth Tokens.
|
||||
*/
|
||||
async authTokenServiceListAuthTokensRaw(requestParameters: AuthTokenServiceListAuthTokensRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1ListAuthTokensResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['scopeId'] != null) {
|
||||
queryParameters['scope_id'] = requestParameters['scopeId'];
|
||||
}
|
||||
|
||||
if (requestParameters['recursive'] != null) {
|
||||
queryParameters['recursive'] = requestParameters['recursive'];
|
||||
}
|
||||
|
||||
if (requestParameters['filter'] != null) {
|
||||
queryParameters['filter'] = requestParameters['filter'];
|
||||
}
|
||||
|
||||
if (requestParameters['listToken'] != null) {
|
||||
queryParameters['list_token'] = requestParameters['listToken'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['page_size'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/auth-tokens`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1ListAuthTokensResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Auth Tokens.
|
||||
*/
|
||||
async authTokenServiceListAuthTokens(requestParameters: AuthTokenServiceListAuthTokensRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1ListAuthTokensResponse> {
|
||||
const response = await this.authTokenServiceListAuthTokensRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Boundary controller HTTP API
|
||||
* Welcome to the Boundary controller HTTP API documentation. This page provides a reference guide for using the Boundary controller API, a JSON-based HTTP API. The API implements commonly seen HTTP API patterns for status codes, paths, and errors. See the [API overview](https://developer.hashicorp.com/boundary/docs/api-clients/api) for more information. Before you read this page, it is useful to understand Boundary\'s [domain model](https://developer.hashicorp.com/boundary/docs/concepts/domain-model) and to be aware of the terminology used here. To get started, search for the service you want to interact with in the sidebar to the left. Each resource in Boundary, such as accounts and credential stores, has its own service. Each service contains all the API endpoints for the resource. ## Status codes - `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it follows well-understood semantics for those status codes. - `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which returns a `404` as discussed below. - `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource returns a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action. - `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action. - `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist returns a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it\'s tolerable as it allows for far simpler and more robust client implementation. - `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource. - `429`: Boundary returns a `429` if any of the API rate limit quotas have been exhausted for the resource and action. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. - `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error is logged to Boundary\'s server log but is not generally provided to the client. - `503`: Boundary returns a `503` if it is unable to store a quota due to the API rate limit being exceeded. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. ## List pagination Boundary uses [API pagination](https://developer.hashicorp.com/boundary/docs/api-clients/api/pagination) to support searching and filtering large lists of results efficiently.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.19.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
ControllerApiServicesV1MonthlyActiveUsersResponse,
|
||||
ControllerApiV1Error,
|
||||
} from '../models/index';
|
||||
import {
|
||||
ControllerApiServicesV1MonthlyActiveUsersResponseFromJSON,
|
||||
ControllerApiServicesV1MonthlyActiveUsersResponseToJSON,
|
||||
ControllerApiV1ErrorFromJSON,
|
||||
ControllerApiV1ErrorToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface BillingServiceMonthlyActiveUsersRequest {
|
||||
startTime?: string;
|
||||
endTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class BillingServiceApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Returns monthly active users.
|
||||
*/
|
||||
async billingServiceMonthlyActiveUsersRaw(requestParameters: BillingServiceMonthlyActiveUsersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1MonthlyActiveUsersResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['startTime'] != null) {
|
||||
queryParameters['start_time'] = requestParameters['startTime'];
|
||||
}
|
||||
|
||||
if (requestParameters['endTime'] != null) {
|
||||
queryParameters['end_time'] = requestParameters['endTime'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/billing:monthly-active-users`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1MonthlyActiveUsersResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns monthly active users.
|
||||
*/
|
||||
async billingServiceMonthlyActiveUsers(requestParameters: BillingServiceMonthlyActiveUsersRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1MonthlyActiveUsersResponse> {
|
||||
const response = await this.billingServiceMonthlyActiveUsersRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,267 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Boundary controller HTTP API
|
||||
* Welcome to the Boundary controller HTTP API documentation. This page provides a reference guide for using the Boundary controller API, a JSON-based HTTP API. The API implements commonly seen HTTP API patterns for status codes, paths, and errors. See the [API overview](https://developer.hashicorp.com/boundary/docs/api-clients/api) for more information. Before you read this page, it is useful to understand Boundary\'s [domain model](https://developer.hashicorp.com/boundary/docs/concepts/domain-model) and to be aware of the terminology used here. To get started, search for the service you want to interact with in the sidebar to the left. Each resource in Boundary, such as accounts and credential stores, has its own service. Each service contains all the API endpoints for the resource. ## Status codes - `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it follows well-understood semantics for those status codes. - `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which returns a `404` as discussed below. - `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource returns a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action. - `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action. - `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist returns a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it\'s tolerable as it allows for far simpler and more robust client implementation. - `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource. - `429`: Boundary returns a `429` if any of the API rate limit quotas have been exhausted for the resource and action. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. - `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error is logged to Boundary\'s server log but is not generally provided to the client. - `503`: Boundary returns a `503` if it is unable to store a quota due to the API rate limit being exceeded. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. ## List pagination Boundary uses [API pagination](https://developer.hashicorp.com/boundary/docs/api-clients/api/pagination) to support searching and filtering large lists of results efficiently.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.19.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
ControllerApiResourcesCredentiallibrariesV1CredentialLibrary,
|
||||
ControllerApiServicesV1ListCredentialLibrariesResponse,
|
||||
ControllerApiV1Error,
|
||||
} from '../models/index';
|
||||
import {
|
||||
ControllerApiResourcesCredentiallibrariesV1CredentialLibraryFromJSON,
|
||||
ControllerApiResourcesCredentiallibrariesV1CredentialLibraryToJSON,
|
||||
ControllerApiServicesV1ListCredentialLibrariesResponseFromJSON,
|
||||
ControllerApiServicesV1ListCredentialLibrariesResponseToJSON,
|
||||
ControllerApiV1ErrorFromJSON,
|
||||
ControllerApiV1ErrorToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface CredentialLibraryServiceCreateCredentialLibraryRequest {
|
||||
item: Omit<ControllerApiResourcesCredentiallibrariesV1CredentialLibrary, 'id'|'created_time'|'updated_time'|'authorized_actions'>;
|
||||
}
|
||||
|
||||
export interface CredentialLibraryServiceDeleteCredentialLibraryRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface CredentialLibraryServiceGetCredentialLibraryRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface CredentialLibraryServiceListCredentialLibrariesRequest {
|
||||
credentialStoreId?: string;
|
||||
filter?: string;
|
||||
listToken?: string;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface CredentialLibraryServiceUpdateCredentialLibraryRequest {
|
||||
id: string;
|
||||
item: Omit<ControllerApiResourcesCredentiallibrariesV1CredentialLibrary, 'id'|'created_time'|'updated_time'|'authorized_actions'>;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class CredentialLibraryServiceApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Creates a single Credential Library.
|
||||
*/
|
||||
async credentialLibraryServiceCreateCredentialLibraryRaw(requestParameters: CredentialLibraryServiceCreateCredentialLibraryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesCredentiallibrariesV1CredentialLibrary>> {
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling credentialLibraryServiceCreateCredentialLibrary().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/credential-libraries`,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesCredentiallibrariesV1CredentialLibraryToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesCredentiallibrariesV1CredentialLibraryFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single Credential Library.
|
||||
*/
|
||||
async credentialLibraryServiceCreateCredentialLibrary(requestParameters: CredentialLibraryServiceCreateCredentialLibraryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesCredentiallibrariesV1CredentialLibrary> {
|
||||
const response = await this.credentialLibraryServiceCreateCredentialLibraryRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a Credential Library
|
||||
*/
|
||||
async credentialLibraryServiceDeleteCredentialLibraryRaw(requestParameters: CredentialLibraryServiceDeleteCredentialLibraryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling credentialLibraryServiceDeleteCredentialLibrary().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/credential-libraries/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse<any>(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a Credential Library
|
||||
*/
|
||||
async credentialLibraryServiceDeleteCredentialLibrary(requestParameters: CredentialLibraryServiceDeleteCredentialLibraryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object> {
|
||||
const response = await this.credentialLibraryServiceDeleteCredentialLibraryRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Credential Library.
|
||||
*/
|
||||
async credentialLibraryServiceGetCredentialLibraryRaw(requestParameters: CredentialLibraryServiceGetCredentialLibraryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesCredentiallibrariesV1CredentialLibrary>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling credentialLibraryServiceGetCredentialLibrary().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/credential-libraries/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesCredentiallibrariesV1CredentialLibraryFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Credential Library.
|
||||
*/
|
||||
async credentialLibraryServiceGetCredentialLibrary(requestParameters: CredentialLibraryServiceGetCredentialLibraryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesCredentiallibrariesV1CredentialLibrary> {
|
||||
const response = await this.credentialLibraryServiceGetCredentialLibraryRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Credential Library.
|
||||
*/
|
||||
async credentialLibraryServiceListCredentialLibrariesRaw(requestParameters: CredentialLibraryServiceListCredentialLibrariesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1ListCredentialLibrariesResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['credentialStoreId'] != null) {
|
||||
queryParameters['credential_store_id'] = requestParameters['credentialStoreId'];
|
||||
}
|
||||
|
||||
if (requestParameters['filter'] != null) {
|
||||
queryParameters['filter'] = requestParameters['filter'];
|
||||
}
|
||||
|
||||
if (requestParameters['listToken'] != null) {
|
||||
queryParameters['list_token'] = requestParameters['listToken'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['page_size'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/credential-libraries`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1ListCredentialLibrariesResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Credential Library.
|
||||
*/
|
||||
async credentialLibraryServiceListCredentialLibraries(requestParameters: CredentialLibraryServiceListCredentialLibrariesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1ListCredentialLibrariesResponse> {
|
||||
const response = await this.credentialLibraryServiceListCredentialLibrariesRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a Credential Library.
|
||||
*/
|
||||
async credentialLibraryServiceUpdateCredentialLibraryRaw(requestParameters: CredentialLibraryServiceUpdateCredentialLibraryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesCredentiallibrariesV1CredentialLibrary>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling credentialLibraryServiceUpdateCredentialLibrary().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling credentialLibraryServiceUpdateCredentialLibrary().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/credential-libraries/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'PATCH',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesCredentiallibrariesV1CredentialLibraryToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesCredentiallibrariesV1CredentialLibraryFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a Credential Library.
|
||||
*/
|
||||
async credentialLibraryServiceUpdateCredentialLibrary(requestParameters: CredentialLibraryServiceUpdateCredentialLibraryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesCredentiallibrariesV1CredentialLibrary> {
|
||||
const response = await this.credentialLibraryServiceUpdateCredentialLibraryRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,267 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Boundary controller HTTP API
|
||||
* Welcome to the Boundary controller HTTP API documentation. This page provides a reference guide for using the Boundary controller API, a JSON-based HTTP API. The API implements commonly seen HTTP API patterns for status codes, paths, and errors. See the [API overview](https://developer.hashicorp.com/boundary/docs/api-clients/api) for more information. Before you read this page, it is useful to understand Boundary\'s [domain model](https://developer.hashicorp.com/boundary/docs/concepts/domain-model) and to be aware of the terminology used here. To get started, search for the service you want to interact with in the sidebar to the left. Each resource in Boundary, such as accounts and credential stores, has its own service. Each service contains all the API endpoints for the resource. ## Status codes - `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it follows well-understood semantics for those status codes. - `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which returns a `404` as discussed below. - `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource returns a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action. - `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action. - `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist returns a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it\'s tolerable as it allows for far simpler and more robust client implementation. - `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource. - `429`: Boundary returns a `429` if any of the API rate limit quotas have been exhausted for the resource and action. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. - `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error is logged to Boundary\'s server log but is not generally provided to the client. - `503`: Boundary returns a `503` if it is unable to store a quota due to the API rate limit being exceeded. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. ## List pagination Boundary uses [API pagination](https://developer.hashicorp.com/boundary/docs/api-clients/api/pagination) to support searching and filtering large lists of results efficiently.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.19.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
ControllerApiResourcesCredentialsV1Credential,
|
||||
ControllerApiServicesV1ListCredentialsResponse,
|
||||
ControllerApiV1Error,
|
||||
} from '../models/index';
|
||||
import {
|
||||
ControllerApiResourcesCredentialsV1CredentialFromJSON,
|
||||
ControllerApiResourcesCredentialsV1CredentialToJSON,
|
||||
ControllerApiServicesV1ListCredentialsResponseFromJSON,
|
||||
ControllerApiServicesV1ListCredentialsResponseToJSON,
|
||||
ControllerApiV1ErrorFromJSON,
|
||||
ControllerApiV1ErrorToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface CredentialServiceCreateCredentialRequest {
|
||||
item: Omit<ControllerApiResourcesCredentialsV1Credential, 'id'|'created_time'|'updated_time'|'authorized_actions'>;
|
||||
}
|
||||
|
||||
export interface CredentialServiceDeleteCredentialRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface CredentialServiceGetCredentialRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface CredentialServiceListCredentialsRequest {
|
||||
credentialStoreId?: string;
|
||||
filter?: string;
|
||||
listToken?: string;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface CredentialServiceUpdateCredentialRequest {
|
||||
id: string;
|
||||
item: Omit<ControllerApiResourcesCredentialsV1Credential, 'id'|'created_time'|'updated_time'|'authorized_actions'>;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class CredentialServiceApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Creates a single Credential.
|
||||
*/
|
||||
async credentialServiceCreateCredentialRaw(requestParameters: CredentialServiceCreateCredentialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesCredentialsV1Credential>> {
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling credentialServiceCreateCredential().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/credentials`,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesCredentialsV1CredentialToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesCredentialsV1CredentialFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single Credential.
|
||||
*/
|
||||
async credentialServiceCreateCredential(requestParameters: CredentialServiceCreateCredentialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesCredentialsV1Credential> {
|
||||
const response = await this.credentialServiceCreateCredentialRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a Credential
|
||||
*/
|
||||
async credentialServiceDeleteCredentialRaw(requestParameters: CredentialServiceDeleteCredentialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling credentialServiceDeleteCredential().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/credentials/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse<any>(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a Credential
|
||||
*/
|
||||
async credentialServiceDeleteCredential(requestParameters: CredentialServiceDeleteCredentialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object> {
|
||||
const response = await this.credentialServiceDeleteCredentialRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Credential.
|
||||
*/
|
||||
async credentialServiceGetCredentialRaw(requestParameters: CredentialServiceGetCredentialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesCredentialsV1Credential>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling credentialServiceGetCredential().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/credentials/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesCredentialsV1CredentialFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Credential.
|
||||
*/
|
||||
async credentialServiceGetCredential(requestParameters: CredentialServiceGetCredentialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesCredentialsV1Credential> {
|
||||
const response = await this.credentialServiceGetCredentialRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Credentials.
|
||||
*/
|
||||
async credentialServiceListCredentialsRaw(requestParameters: CredentialServiceListCredentialsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1ListCredentialsResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['credentialStoreId'] != null) {
|
||||
queryParameters['credential_store_id'] = requestParameters['credentialStoreId'];
|
||||
}
|
||||
|
||||
if (requestParameters['filter'] != null) {
|
||||
queryParameters['filter'] = requestParameters['filter'];
|
||||
}
|
||||
|
||||
if (requestParameters['listToken'] != null) {
|
||||
queryParameters['list_token'] = requestParameters['listToken'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['page_size'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/credentials`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1ListCredentialsResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Credentials.
|
||||
*/
|
||||
async credentialServiceListCredentials(requestParameters: CredentialServiceListCredentialsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1ListCredentialsResponse> {
|
||||
const response = await this.credentialServiceListCredentialsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a Credential.
|
||||
*/
|
||||
async credentialServiceUpdateCredentialRaw(requestParameters: CredentialServiceUpdateCredentialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesCredentialsV1Credential>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling credentialServiceUpdateCredential().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling credentialServiceUpdateCredential().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/credentials/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'PATCH',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesCredentialsV1CredentialToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesCredentialsV1CredentialFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a Credential.
|
||||
*/
|
||||
async credentialServiceUpdateCredential(requestParameters: CredentialServiceUpdateCredentialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesCredentialsV1Credential> {
|
||||
const response = await this.credentialServiceUpdateCredentialRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,272 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Boundary controller HTTP API
|
||||
* Welcome to the Boundary controller HTTP API documentation. This page provides a reference guide for using the Boundary controller API, a JSON-based HTTP API. The API implements commonly seen HTTP API patterns for status codes, paths, and errors. See the [API overview](https://developer.hashicorp.com/boundary/docs/api-clients/api) for more information. Before you read this page, it is useful to understand Boundary\'s [domain model](https://developer.hashicorp.com/boundary/docs/concepts/domain-model) and to be aware of the terminology used here. To get started, search for the service you want to interact with in the sidebar to the left. Each resource in Boundary, such as accounts and credential stores, has its own service. Each service contains all the API endpoints for the resource. ## Status codes - `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it follows well-understood semantics for those status codes. - `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which returns a `404` as discussed below. - `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource returns a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action. - `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action. - `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist returns a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it\'s tolerable as it allows for far simpler and more robust client implementation. - `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource. - `429`: Boundary returns a `429` if any of the API rate limit quotas have been exhausted for the resource and action. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. - `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error is logged to Boundary\'s server log but is not generally provided to the client. - `503`: Boundary returns a `503` if it is unable to store a quota due to the API rate limit being exceeded. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. ## List pagination Boundary uses [API pagination](https://developer.hashicorp.com/boundary/docs/api-clients/api/pagination) to support searching and filtering large lists of results efficiently.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.19.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
ControllerApiResourcesCredentialstoresV1CredentialStore,
|
||||
ControllerApiServicesV1ListCredentialStoresResponse,
|
||||
ControllerApiV1Error,
|
||||
} from '../models/index';
|
||||
import {
|
||||
ControllerApiResourcesCredentialstoresV1CredentialStoreFromJSON,
|
||||
ControllerApiResourcesCredentialstoresV1CredentialStoreToJSON,
|
||||
ControllerApiServicesV1ListCredentialStoresResponseFromJSON,
|
||||
ControllerApiServicesV1ListCredentialStoresResponseToJSON,
|
||||
ControllerApiV1ErrorFromJSON,
|
||||
ControllerApiV1ErrorToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface CredentialStoreServiceCreateCredentialStoreRequest {
|
||||
item: Omit<ControllerApiResourcesCredentialstoresV1CredentialStore, 'id'|'created_time'|'updated_time'|'authorized_actions'|'authorized_collection_actions'>;
|
||||
}
|
||||
|
||||
export interface CredentialStoreServiceDeleteCredentialStoreRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface CredentialStoreServiceGetCredentialStoreRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface CredentialStoreServiceListCredentialStoresRequest {
|
||||
scopeId?: string;
|
||||
recursive?: boolean;
|
||||
filter?: string;
|
||||
listToken?: string;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface CredentialStoreServiceUpdateCredentialStoreRequest {
|
||||
id: string;
|
||||
item: Omit<ControllerApiResourcesCredentialstoresV1CredentialStore, 'id'|'created_time'|'updated_time'|'authorized_actions'|'authorized_collection_actions'>;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class CredentialStoreServiceApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Creates a single Credential Store.
|
||||
*/
|
||||
async credentialStoreServiceCreateCredentialStoreRaw(requestParameters: CredentialStoreServiceCreateCredentialStoreRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesCredentialstoresV1CredentialStore>> {
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling credentialStoreServiceCreateCredentialStore().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/credential-stores`,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesCredentialstoresV1CredentialStoreToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesCredentialstoresV1CredentialStoreFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single Credential Store.
|
||||
*/
|
||||
async credentialStoreServiceCreateCredentialStore(requestParameters: CredentialStoreServiceCreateCredentialStoreRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesCredentialstoresV1CredentialStore> {
|
||||
const response = await this.credentialStoreServiceCreateCredentialStoreRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a CredentialStore
|
||||
*/
|
||||
async credentialStoreServiceDeleteCredentialStoreRaw(requestParameters: CredentialStoreServiceDeleteCredentialStoreRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling credentialStoreServiceDeleteCredentialStore().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/credential-stores/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse<any>(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a CredentialStore
|
||||
*/
|
||||
async credentialStoreServiceDeleteCredentialStore(requestParameters: CredentialStoreServiceDeleteCredentialStoreRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object> {
|
||||
const response = await this.credentialStoreServiceDeleteCredentialStoreRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Credential Store.
|
||||
*/
|
||||
async credentialStoreServiceGetCredentialStoreRaw(requestParameters: CredentialStoreServiceGetCredentialStoreRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesCredentialstoresV1CredentialStore>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling credentialStoreServiceGetCredentialStore().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/credential-stores/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesCredentialstoresV1CredentialStoreFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Credential Store.
|
||||
*/
|
||||
async credentialStoreServiceGetCredentialStore(requestParameters: CredentialStoreServiceGetCredentialStoreRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesCredentialstoresV1CredentialStore> {
|
||||
const response = await this.credentialStoreServiceGetCredentialStoreRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Credential Stores.
|
||||
*/
|
||||
async credentialStoreServiceListCredentialStoresRaw(requestParameters: CredentialStoreServiceListCredentialStoresRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1ListCredentialStoresResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['scopeId'] != null) {
|
||||
queryParameters['scope_id'] = requestParameters['scopeId'];
|
||||
}
|
||||
|
||||
if (requestParameters['recursive'] != null) {
|
||||
queryParameters['recursive'] = requestParameters['recursive'];
|
||||
}
|
||||
|
||||
if (requestParameters['filter'] != null) {
|
||||
queryParameters['filter'] = requestParameters['filter'];
|
||||
}
|
||||
|
||||
if (requestParameters['listToken'] != null) {
|
||||
queryParameters['list_token'] = requestParameters['listToken'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['page_size'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/credential-stores`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1ListCredentialStoresResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Credential Stores.
|
||||
*/
|
||||
async credentialStoreServiceListCredentialStores(requestParameters: CredentialStoreServiceListCredentialStoresRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1ListCredentialStoresResponse> {
|
||||
const response = await this.credentialStoreServiceListCredentialStoresRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a Credential Store.
|
||||
*/
|
||||
async credentialStoreServiceUpdateCredentialStoreRaw(requestParameters: CredentialStoreServiceUpdateCredentialStoreRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesCredentialstoresV1CredentialStore>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling credentialStoreServiceUpdateCredentialStore().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling credentialStoreServiceUpdateCredentialStore().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/credential-stores/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'PATCH',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesCredentialstoresV1CredentialStoreToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesCredentialstoresV1CredentialStoreFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a Credential Store.
|
||||
*/
|
||||
async credentialStoreServiceUpdateCredentialStore(requestParameters: CredentialStoreServiceUpdateCredentialStoreRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesCredentialstoresV1CredentialStore> {
|
||||
const response = await this.credentialStoreServiceUpdateCredentialStoreRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,437 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Boundary controller HTTP API
|
||||
* Welcome to the Boundary controller HTTP API documentation. This page provides a reference guide for using the Boundary controller API, a JSON-based HTTP API. The API implements commonly seen HTTP API patterns for status codes, paths, and errors. See the [API overview](https://developer.hashicorp.com/boundary/docs/api-clients/api) for more information. Before you read this page, it is useful to understand Boundary\'s [domain model](https://developer.hashicorp.com/boundary/docs/concepts/domain-model) and to be aware of the terminology used here. To get started, search for the service you want to interact with in the sidebar to the left. Each resource in Boundary, such as accounts and credential stores, has its own service. Each service contains all the API endpoints for the resource. ## Status codes - `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it follows well-understood semantics for those status codes. - `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which returns a `404` as discussed below. - `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource returns a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action. - `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action. - `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist returns a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it\'s tolerable as it allows for far simpler and more robust client implementation. - `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource. - `429`: Boundary returns a `429` if any of the API rate limit quotas have been exhausted for the resource and action. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. - `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error is logged to Boundary\'s server log but is not generally provided to the client. - `503`: Boundary returns a `503` if it is unable to store a quota due to the API rate limit being exceeded. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. ## List pagination Boundary uses [API pagination](https://developer.hashicorp.com/boundary/docs/api-clients/api/pagination) to support searching and filtering large lists of results efficiently.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.19.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
ControllerApiResourcesGroupsV1Group,
|
||||
ControllerApiServicesV1GroupServiceAddGroupMembersBody,
|
||||
ControllerApiServicesV1GroupServiceRemoveGroupMembersBody,
|
||||
ControllerApiServicesV1GroupServiceSetGroupMembersBody,
|
||||
ControllerApiServicesV1ListGroupsResponse,
|
||||
ControllerApiV1Error,
|
||||
} from '../models/index';
|
||||
import {
|
||||
ControllerApiResourcesGroupsV1GroupFromJSON,
|
||||
ControllerApiResourcesGroupsV1GroupToJSON,
|
||||
ControllerApiServicesV1GroupServiceAddGroupMembersBodyFromJSON,
|
||||
ControllerApiServicesV1GroupServiceAddGroupMembersBodyToJSON,
|
||||
ControllerApiServicesV1GroupServiceRemoveGroupMembersBodyFromJSON,
|
||||
ControllerApiServicesV1GroupServiceRemoveGroupMembersBodyToJSON,
|
||||
ControllerApiServicesV1GroupServiceSetGroupMembersBodyFromJSON,
|
||||
ControllerApiServicesV1GroupServiceSetGroupMembersBodyToJSON,
|
||||
ControllerApiServicesV1ListGroupsResponseFromJSON,
|
||||
ControllerApiServicesV1ListGroupsResponseToJSON,
|
||||
ControllerApiV1ErrorFromJSON,
|
||||
ControllerApiV1ErrorToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface GroupServiceAddGroupMembersRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1GroupServiceAddGroupMembersBody;
|
||||
}
|
||||
|
||||
export interface GroupServiceCreateGroupRequest {
|
||||
item: Omit<ControllerApiResourcesGroupsV1Group, 'id'|'created_time'|'updated_time'|'member_ids'|'members'|'authorized_actions'>;
|
||||
}
|
||||
|
||||
export interface GroupServiceDeleteGroupRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface GroupServiceGetGroupRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface GroupServiceListGroupsRequest {
|
||||
scopeId?: string;
|
||||
recursive?: boolean;
|
||||
filter?: string;
|
||||
listToken?: string;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface GroupServiceRemoveGroupMembersRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1GroupServiceRemoveGroupMembersBody;
|
||||
}
|
||||
|
||||
export interface GroupServiceSetGroupMembersRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1GroupServiceSetGroupMembersBody;
|
||||
}
|
||||
|
||||
export interface GroupServiceUpdateGroupRequest {
|
||||
id: string;
|
||||
item: Omit<ControllerApiResourcesGroupsV1Group, 'id'|'created_time'|'updated_time'|'member_ids'|'members'|'authorized_actions'>;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class GroupServiceApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Adds members to a Group.
|
||||
*/
|
||||
async groupServiceAddGroupMembersRaw(requestParameters: GroupServiceAddGroupMembersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesGroupsV1Group>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling groupServiceAddGroupMembers().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling groupServiceAddGroupMembers().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/groups/{id}:add-members`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1GroupServiceAddGroupMembersBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesGroupsV1GroupFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds members to a Group.
|
||||
*/
|
||||
async groupServiceAddGroupMembers(requestParameters: GroupServiceAddGroupMembersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesGroupsV1Group> {
|
||||
const response = await this.groupServiceAddGroupMembersRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single Group.
|
||||
*/
|
||||
async groupServiceCreateGroupRaw(requestParameters: GroupServiceCreateGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesGroupsV1Group>> {
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling groupServiceCreateGroup().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/groups`,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesGroupsV1GroupToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesGroupsV1GroupFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single Group.
|
||||
*/
|
||||
async groupServiceCreateGroup(requestParameters: GroupServiceCreateGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesGroupsV1Group> {
|
||||
const response = await this.groupServiceCreateGroupRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a Group.
|
||||
*/
|
||||
async groupServiceDeleteGroupRaw(requestParameters: GroupServiceDeleteGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling groupServiceDeleteGroup().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/groups/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse<any>(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a Group.
|
||||
*/
|
||||
async groupServiceDeleteGroup(requestParameters: GroupServiceDeleteGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object> {
|
||||
const response = await this.groupServiceDeleteGroupRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Group.
|
||||
*/
|
||||
async groupServiceGetGroupRaw(requestParameters: GroupServiceGetGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesGroupsV1Group>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling groupServiceGetGroup().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/groups/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesGroupsV1GroupFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Group.
|
||||
*/
|
||||
async groupServiceGetGroup(requestParameters: GroupServiceGetGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesGroupsV1Group> {
|
||||
const response = await this.groupServiceGetGroupRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Groups.
|
||||
*/
|
||||
async groupServiceListGroupsRaw(requestParameters: GroupServiceListGroupsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1ListGroupsResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['scopeId'] != null) {
|
||||
queryParameters['scope_id'] = requestParameters['scopeId'];
|
||||
}
|
||||
|
||||
if (requestParameters['recursive'] != null) {
|
||||
queryParameters['recursive'] = requestParameters['recursive'];
|
||||
}
|
||||
|
||||
if (requestParameters['filter'] != null) {
|
||||
queryParameters['filter'] = requestParameters['filter'];
|
||||
}
|
||||
|
||||
if (requestParameters['listToken'] != null) {
|
||||
queryParameters['list_token'] = requestParameters['listToken'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['page_size'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/groups`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1ListGroupsResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Groups.
|
||||
*/
|
||||
async groupServiceListGroups(requestParameters: GroupServiceListGroupsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1ListGroupsResponse> {
|
||||
const response = await this.groupServiceListGroupsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the specified members from a Group.
|
||||
*/
|
||||
async groupServiceRemoveGroupMembersRaw(requestParameters: GroupServiceRemoveGroupMembersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesGroupsV1Group>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling groupServiceRemoveGroupMembers().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling groupServiceRemoveGroupMembers().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/groups/{id}:remove-members`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1GroupServiceRemoveGroupMembersBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesGroupsV1GroupFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the specified members from a Group.
|
||||
*/
|
||||
async groupServiceRemoveGroupMembers(requestParameters: GroupServiceRemoveGroupMembersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesGroupsV1Group> {
|
||||
const response = await this.groupServiceRemoveGroupMembersRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a Group\'s members to exactly the list of provided in the request, removing any members that are not specified.
|
||||
*/
|
||||
async groupServiceSetGroupMembersRaw(requestParameters: GroupServiceSetGroupMembersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesGroupsV1Group>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling groupServiceSetGroupMembers().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling groupServiceSetGroupMembers().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/groups/{id}:set-members`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1GroupServiceSetGroupMembersBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesGroupsV1GroupFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a Group\'s members to exactly the list of provided in the request, removing any members that are not specified.
|
||||
*/
|
||||
async groupServiceSetGroupMembers(requestParameters: GroupServiceSetGroupMembersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesGroupsV1Group> {
|
||||
const response = await this.groupServiceSetGroupMembersRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a Group.
|
||||
*/
|
||||
async groupServiceUpdateGroupRaw(requestParameters: GroupServiceUpdateGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesGroupsV1Group>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling groupServiceUpdateGroup().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling groupServiceUpdateGroup().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/groups/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'PATCH',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesGroupsV1GroupToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesGroupsV1GroupFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a Group.
|
||||
*/
|
||||
async groupServiceUpdateGroup(requestParameters: GroupServiceUpdateGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesGroupsV1Group> {
|
||||
const response = await this.groupServiceUpdateGroupRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,277 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Boundary controller HTTP API
|
||||
* Welcome to the Boundary controller HTTP API documentation. This page provides a reference guide for using the Boundary controller API, a JSON-based HTTP API. The API implements commonly seen HTTP API patterns for status codes, paths, and errors. See the [API overview](https://developer.hashicorp.com/boundary/docs/api-clients/api) for more information. Before you read this page, it is useful to understand Boundary\'s [domain model](https://developer.hashicorp.com/boundary/docs/concepts/domain-model) and to be aware of the terminology used here. To get started, search for the service you want to interact with in the sidebar to the left. Each resource in Boundary, such as accounts and credential stores, has its own service. Each service contains all the API endpoints for the resource. ## Status codes - `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it follows well-understood semantics for those status codes. - `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which returns a `404` as discussed below. - `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource returns a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action. - `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action. - `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist returns a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it\'s tolerable as it allows for far simpler and more robust client implementation. - `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource. - `429`: Boundary returns a `429` if any of the API rate limit quotas have been exhausted for the resource and action. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. - `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error is logged to Boundary\'s server log but is not generally provided to the client. - `503`: Boundary returns a `503` if it is unable to store a quota due to the API rate limit being exceeded. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. ## List pagination Boundary uses [API pagination](https://developer.hashicorp.com/boundary/docs/api-clients/api/pagination) to support searching and filtering large lists of results efficiently.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.19.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
ControllerApiResourcesHostcatalogsV1HostCatalog,
|
||||
ControllerApiServicesV1ListHostCatalogsResponse,
|
||||
ControllerApiV1Error,
|
||||
} from '../models/index';
|
||||
import {
|
||||
ControllerApiResourcesHostcatalogsV1HostCatalogFromJSON,
|
||||
ControllerApiResourcesHostcatalogsV1HostCatalogToJSON,
|
||||
ControllerApiServicesV1ListHostCatalogsResponseFromJSON,
|
||||
ControllerApiServicesV1ListHostCatalogsResponseToJSON,
|
||||
ControllerApiV1ErrorFromJSON,
|
||||
ControllerApiV1ErrorToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface HostCatalogServiceCreateHostCatalogRequest {
|
||||
item: Omit<ControllerApiResourcesHostcatalogsV1HostCatalog, 'id'|'created_time'|'updated_time'|'secrets_hmac'|'authorized_actions'|'authorized_collection_actions'>;
|
||||
pluginName?: string;
|
||||
}
|
||||
|
||||
export interface HostCatalogServiceDeleteHostCatalogRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface HostCatalogServiceGetHostCatalogRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface HostCatalogServiceListHostCatalogsRequest {
|
||||
scopeId?: string;
|
||||
recursive?: boolean;
|
||||
filter?: string;
|
||||
listToken?: string;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface HostCatalogServiceUpdateHostCatalogRequest {
|
||||
id: string;
|
||||
item: Omit<ControllerApiResourcesHostcatalogsV1HostCatalog, 'id'|'created_time'|'updated_time'|'secrets_hmac'|'authorized_actions'|'authorized_collection_actions'>;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class HostCatalogServiceApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Creates a Host Catalog
|
||||
*/
|
||||
async hostCatalogServiceCreateHostCatalogRaw(requestParameters: HostCatalogServiceCreateHostCatalogRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesHostcatalogsV1HostCatalog>> {
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling hostCatalogServiceCreateHostCatalog().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['pluginName'] != null) {
|
||||
queryParameters['plugin_name'] = requestParameters['pluginName'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/host-catalogs`,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesHostcatalogsV1HostCatalogToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesHostcatalogsV1HostCatalogFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a Host Catalog
|
||||
*/
|
||||
async hostCatalogServiceCreateHostCatalog(requestParameters: HostCatalogServiceCreateHostCatalogRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesHostcatalogsV1HostCatalog> {
|
||||
const response = await this.hostCatalogServiceCreateHostCatalogRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a Host Catalog
|
||||
*/
|
||||
async hostCatalogServiceDeleteHostCatalogRaw(requestParameters: HostCatalogServiceDeleteHostCatalogRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling hostCatalogServiceDeleteHostCatalog().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/host-catalogs/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse<any>(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a Host Catalog
|
||||
*/
|
||||
async hostCatalogServiceDeleteHostCatalog(requestParameters: HostCatalogServiceDeleteHostCatalogRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object> {
|
||||
const response = await this.hostCatalogServiceDeleteHostCatalogRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Host Catalog.
|
||||
*/
|
||||
async hostCatalogServiceGetHostCatalogRaw(requestParameters: HostCatalogServiceGetHostCatalogRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesHostcatalogsV1HostCatalog>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling hostCatalogServiceGetHostCatalog().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/host-catalogs/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesHostcatalogsV1HostCatalogFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Host Catalog.
|
||||
*/
|
||||
async hostCatalogServiceGetHostCatalog(requestParameters: HostCatalogServiceGetHostCatalogRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesHostcatalogsV1HostCatalog> {
|
||||
const response = await this.hostCatalogServiceGetHostCatalogRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a list of Host Catalogs.
|
||||
*/
|
||||
async hostCatalogServiceListHostCatalogsRaw(requestParameters: HostCatalogServiceListHostCatalogsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1ListHostCatalogsResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['scopeId'] != null) {
|
||||
queryParameters['scope_id'] = requestParameters['scopeId'];
|
||||
}
|
||||
|
||||
if (requestParameters['recursive'] != null) {
|
||||
queryParameters['recursive'] = requestParameters['recursive'];
|
||||
}
|
||||
|
||||
if (requestParameters['filter'] != null) {
|
||||
queryParameters['filter'] = requestParameters['filter'];
|
||||
}
|
||||
|
||||
if (requestParameters['listToken'] != null) {
|
||||
queryParameters['list_token'] = requestParameters['listToken'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['page_size'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/host-catalogs`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1ListHostCatalogsResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a list of Host Catalogs.
|
||||
*/
|
||||
async hostCatalogServiceListHostCatalogs(requestParameters: HostCatalogServiceListHostCatalogsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1ListHostCatalogsResponse> {
|
||||
const response = await this.hostCatalogServiceListHostCatalogsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a Host Catalog
|
||||
*/
|
||||
async hostCatalogServiceUpdateHostCatalogRaw(requestParameters: HostCatalogServiceUpdateHostCatalogRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesHostcatalogsV1HostCatalog>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling hostCatalogServiceUpdateHostCatalog().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling hostCatalogServiceUpdateHostCatalog().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/host-catalogs/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'PATCH',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesHostcatalogsV1HostCatalogToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesHostcatalogsV1HostCatalogFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a Host Catalog
|
||||
*/
|
||||
async hostCatalogServiceUpdateHostCatalog(requestParameters: HostCatalogServiceUpdateHostCatalogRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesHostcatalogsV1HostCatalog> {
|
||||
const response = await this.hostCatalogServiceUpdateHostCatalogRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,267 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Boundary controller HTTP API
|
||||
* Welcome to the Boundary controller HTTP API documentation. This page provides a reference guide for using the Boundary controller API, a JSON-based HTTP API. The API implements commonly seen HTTP API patterns for status codes, paths, and errors. See the [API overview](https://developer.hashicorp.com/boundary/docs/api-clients/api) for more information. Before you read this page, it is useful to understand Boundary\'s [domain model](https://developer.hashicorp.com/boundary/docs/concepts/domain-model) and to be aware of the terminology used here. To get started, search for the service you want to interact with in the sidebar to the left. Each resource in Boundary, such as accounts and credential stores, has its own service. Each service contains all the API endpoints for the resource. ## Status codes - `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it follows well-understood semantics for those status codes. - `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which returns a `404` as discussed below. - `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource returns a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action. - `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action. - `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist returns a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it\'s tolerable as it allows for far simpler and more robust client implementation. - `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource. - `429`: Boundary returns a `429` if any of the API rate limit quotas have been exhausted for the resource and action. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. - `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error is logged to Boundary\'s server log but is not generally provided to the client. - `503`: Boundary returns a `503` if it is unable to store a quota due to the API rate limit being exceeded. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. ## List pagination Boundary uses [API pagination](https://developer.hashicorp.com/boundary/docs/api-clients/api/pagination) to support searching and filtering large lists of results efficiently.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.19.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
ControllerApiResourcesHostsV1Host,
|
||||
ControllerApiServicesV1ListHostsResponse,
|
||||
ControllerApiV1Error,
|
||||
} from '../models/index';
|
||||
import {
|
||||
ControllerApiResourcesHostsV1HostFromJSON,
|
||||
ControllerApiResourcesHostsV1HostToJSON,
|
||||
ControllerApiServicesV1ListHostsResponseFromJSON,
|
||||
ControllerApiServicesV1ListHostsResponseToJSON,
|
||||
ControllerApiV1ErrorFromJSON,
|
||||
ControllerApiV1ErrorToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface HostServiceCreateHostRequest {
|
||||
item: Omit<ControllerApiResourcesHostsV1Host, 'id'|'created_time'|'updated_time'|'host_set_ids'|'ip_addresses'|'dns_names'|'external_id'|'external_name'|'authorized_actions'>;
|
||||
}
|
||||
|
||||
export interface HostServiceDeleteHostRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface HostServiceGetHostRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface HostServiceListHostsRequest {
|
||||
hostCatalogId?: string;
|
||||
filter?: string;
|
||||
listToken?: string;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface HostServiceUpdateHostRequest {
|
||||
id: string;
|
||||
item: Omit<ControllerApiResourcesHostsV1Host, 'id'|'created_time'|'updated_time'|'host_set_ids'|'ip_addresses'|'dns_names'|'external_id'|'external_name'|'authorized_actions'>;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class HostServiceApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Create a single Host.
|
||||
*/
|
||||
async hostServiceCreateHostRaw(requestParameters: HostServiceCreateHostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesHostsV1Host>> {
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling hostServiceCreateHost().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/hosts`,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesHostsV1HostToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesHostsV1HostFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a single Host.
|
||||
*/
|
||||
async hostServiceCreateHost(requestParameters: HostServiceCreateHostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesHostsV1Host> {
|
||||
const response = await this.hostServiceCreateHostRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a Host.
|
||||
*/
|
||||
async hostServiceDeleteHostRaw(requestParameters: HostServiceDeleteHostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling hostServiceDeleteHost().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/hosts/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse<any>(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a Host.
|
||||
*/
|
||||
async hostServiceDeleteHost(requestParameters: HostServiceDeleteHostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object> {
|
||||
const response = await this.hostServiceDeleteHostRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Host.
|
||||
*/
|
||||
async hostServiceGetHostRaw(requestParameters: HostServiceGetHostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesHostsV1Host>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling hostServiceGetHost().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/hosts/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesHostsV1HostFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Host.
|
||||
*/
|
||||
async hostServiceGetHost(requestParameters: HostServiceGetHostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesHostsV1Host> {
|
||||
const response = await this.hostServiceGetHostRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* List all Hosts for the specified Catalog.
|
||||
*/
|
||||
async hostServiceListHostsRaw(requestParameters: HostServiceListHostsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1ListHostsResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['hostCatalogId'] != null) {
|
||||
queryParameters['host_catalog_id'] = requestParameters['hostCatalogId'];
|
||||
}
|
||||
|
||||
if (requestParameters['filter'] != null) {
|
||||
queryParameters['filter'] = requestParameters['filter'];
|
||||
}
|
||||
|
||||
if (requestParameters['listToken'] != null) {
|
||||
queryParameters['list_token'] = requestParameters['listToken'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['page_size'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/hosts`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1ListHostsResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* List all Hosts for the specified Catalog.
|
||||
*/
|
||||
async hostServiceListHosts(requestParameters: HostServiceListHostsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1ListHostsResponse> {
|
||||
const response = await this.hostServiceListHostsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a Host.
|
||||
*/
|
||||
async hostServiceUpdateHostRaw(requestParameters: HostServiceUpdateHostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesHostsV1Host>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling hostServiceUpdateHost().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling hostServiceUpdateHost().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/hosts/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'PATCH',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesHostsV1HostToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesHostsV1HostFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a Host.
|
||||
*/
|
||||
async hostServiceUpdateHost(requestParameters: HostServiceUpdateHostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesHostsV1Host> {
|
||||
const response = await this.hostServiceUpdateHostRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,432 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Boundary controller HTTP API
|
||||
* Welcome to the Boundary controller HTTP API documentation. This page provides a reference guide for using the Boundary controller API, a JSON-based HTTP API. The API implements commonly seen HTTP API patterns for status codes, paths, and errors. See the [API overview](https://developer.hashicorp.com/boundary/docs/api-clients/api) for more information. Before you read this page, it is useful to understand Boundary\'s [domain model](https://developer.hashicorp.com/boundary/docs/concepts/domain-model) and to be aware of the terminology used here. To get started, search for the service you want to interact with in the sidebar to the left. Each resource in Boundary, such as accounts and credential stores, has its own service. Each service contains all the API endpoints for the resource. ## Status codes - `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it follows well-understood semantics for those status codes. - `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which returns a `404` as discussed below. - `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource returns a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action. - `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action. - `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist returns a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it\'s tolerable as it allows for far simpler and more robust client implementation. - `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource. - `429`: Boundary returns a `429` if any of the API rate limit quotas have been exhausted for the resource and action. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. - `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error is logged to Boundary\'s server log but is not generally provided to the client. - `503`: Boundary returns a `503` if it is unable to store a quota due to the API rate limit being exceeded. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. ## List pagination Boundary uses [API pagination](https://developer.hashicorp.com/boundary/docs/api-clients/api/pagination) to support searching and filtering large lists of results efficiently.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.19.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
ControllerApiResourcesHostsetsV1HostSet,
|
||||
ControllerApiServicesV1HostSetServiceAddHostSetHostsBody,
|
||||
ControllerApiServicesV1HostSetServiceRemoveHostSetHostsBody,
|
||||
ControllerApiServicesV1HostSetServiceSetHostSetHostsBody,
|
||||
ControllerApiServicesV1ListHostSetsResponse,
|
||||
ControllerApiV1Error,
|
||||
} from '../models/index';
|
||||
import {
|
||||
ControllerApiResourcesHostsetsV1HostSetFromJSON,
|
||||
ControllerApiResourcesHostsetsV1HostSetToJSON,
|
||||
ControllerApiServicesV1HostSetServiceAddHostSetHostsBodyFromJSON,
|
||||
ControllerApiServicesV1HostSetServiceAddHostSetHostsBodyToJSON,
|
||||
ControllerApiServicesV1HostSetServiceRemoveHostSetHostsBodyFromJSON,
|
||||
ControllerApiServicesV1HostSetServiceRemoveHostSetHostsBodyToJSON,
|
||||
ControllerApiServicesV1HostSetServiceSetHostSetHostsBodyFromJSON,
|
||||
ControllerApiServicesV1HostSetServiceSetHostSetHostsBodyToJSON,
|
||||
ControllerApiServicesV1ListHostSetsResponseFromJSON,
|
||||
ControllerApiServicesV1ListHostSetsResponseToJSON,
|
||||
ControllerApiV1ErrorFromJSON,
|
||||
ControllerApiV1ErrorToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface HostSetServiceAddHostSetHostsRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1HostSetServiceAddHostSetHostsBody;
|
||||
}
|
||||
|
||||
export interface HostSetServiceCreateHostSetRequest {
|
||||
item: Omit<ControllerApiResourcesHostsetsV1HostSet, 'id'|'created_time'|'updated_time'|'host_ids'|'authorized_actions'>;
|
||||
}
|
||||
|
||||
export interface HostSetServiceDeleteHostSetRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface HostSetServiceGetHostSetRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface HostSetServiceListHostSetsRequest {
|
||||
hostCatalogId?: string;
|
||||
filter?: string;
|
||||
listToken?: string;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface HostSetServiceRemoveHostSetHostsRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1HostSetServiceRemoveHostSetHostsBody;
|
||||
}
|
||||
|
||||
export interface HostSetServiceSetHostSetHostsRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1HostSetServiceSetHostSetHostsBody;
|
||||
}
|
||||
|
||||
export interface HostSetServiceUpdateHostSetRequest {
|
||||
id: string;
|
||||
item: Omit<ControllerApiResourcesHostsetsV1HostSet, 'id'|'created_time'|'updated_time'|'host_ids'|'authorized_actions'>;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class HostSetServiceApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Adds existing Hosts to a Host Set.
|
||||
*/
|
||||
async hostSetServiceAddHostSetHostsRaw(requestParameters: HostSetServiceAddHostSetHostsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesHostsetsV1HostSet>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling hostSetServiceAddHostSetHosts().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling hostSetServiceAddHostSetHosts().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/host-sets/{id}:add-hosts`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1HostSetServiceAddHostSetHostsBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesHostsetsV1HostSetFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds existing Hosts to a Host Set.
|
||||
*/
|
||||
async hostSetServiceAddHostSetHosts(requestParameters: HostSetServiceAddHostSetHostsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesHostsetsV1HostSet> {
|
||||
const response = await this.hostSetServiceAddHostSetHostsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Host Set.
|
||||
*/
|
||||
async hostSetServiceCreateHostSetRaw(requestParameters: HostSetServiceCreateHostSetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesHostsetsV1HostSet>> {
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling hostSetServiceCreateHostSet().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/host-sets`,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesHostsetsV1HostSetToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesHostsetsV1HostSetFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a Host Set.
|
||||
*/
|
||||
async hostSetServiceCreateHostSet(requestParameters: HostSetServiceCreateHostSetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesHostsetsV1HostSet> {
|
||||
const response = await this.hostSetServiceCreateHostSetRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a Host Set.
|
||||
*/
|
||||
async hostSetServiceDeleteHostSetRaw(requestParameters: HostSetServiceDeleteHostSetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling hostSetServiceDeleteHostSet().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/host-sets/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse<any>(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a Host Set.
|
||||
*/
|
||||
async hostSetServiceDeleteHostSet(requestParameters: HostSetServiceDeleteHostSetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object> {
|
||||
const response = await this.hostSetServiceDeleteHostSetRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a single Host Set.
|
||||
*/
|
||||
async hostSetServiceGetHostSetRaw(requestParameters: HostSetServiceGetHostSetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesHostsetsV1HostSet>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling hostSetServiceGetHostSet().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/host-sets/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesHostsetsV1HostSetFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a single Host Set.
|
||||
*/
|
||||
async hostSetServiceGetHostSet(requestParameters: HostSetServiceGetHostSetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesHostsetsV1HostSet> {
|
||||
const response = await this.hostSetServiceGetHostSetRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* List all Host Sets under the specific Catalog.
|
||||
*/
|
||||
async hostSetServiceListHostSetsRaw(requestParameters: HostSetServiceListHostSetsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1ListHostSetsResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['hostCatalogId'] != null) {
|
||||
queryParameters['host_catalog_id'] = requestParameters['hostCatalogId'];
|
||||
}
|
||||
|
||||
if (requestParameters['filter'] != null) {
|
||||
queryParameters['filter'] = requestParameters['filter'];
|
||||
}
|
||||
|
||||
if (requestParameters['listToken'] != null) {
|
||||
queryParameters['list_token'] = requestParameters['listToken'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['page_size'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/host-sets`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1ListHostSetsResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* List all Host Sets under the specific Catalog.
|
||||
*/
|
||||
async hostSetServiceListHostSets(requestParameters: HostSetServiceListHostSetsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1ListHostSetsResponse> {
|
||||
const response = await this.hostSetServiceListHostSetsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes Hosts from the Host Set.
|
||||
*/
|
||||
async hostSetServiceRemoveHostSetHostsRaw(requestParameters: HostSetServiceRemoveHostSetHostsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesHostsetsV1HostSet>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling hostSetServiceRemoveHostSetHosts().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling hostSetServiceRemoveHostSetHosts().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/host-sets/{id}:remove-hosts`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1HostSetServiceRemoveHostSetHostsBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesHostsetsV1HostSetFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes Hosts from the Host Set.
|
||||
*/
|
||||
async hostSetServiceRemoveHostSetHosts(requestParameters: HostSetServiceRemoveHostSetHostsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesHostsetsV1HostSet> {
|
||||
const response = await this.hostSetServiceRemoveHostSetHostsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Hosts on the Host Set.
|
||||
*/
|
||||
async hostSetServiceSetHostSetHostsRaw(requestParameters: HostSetServiceSetHostSetHostsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesHostsetsV1HostSet>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling hostSetServiceSetHostSetHosts().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling hostSetServiceSetHostSetHosts().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/host-sets/{id}:set-hosts`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1HostSetServiceSetHostSetHostsBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesHostsetsV1HostSetFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Hosts on the Host Set.
|
||||
*/
|
||||
async hostSetServiceSetHostSetHosts(requestParameters: HostSetServiceSetHostSetHostsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesHostsetsV1HostSet> {
|
||||
const response = await this.hostSetServiceSetHostSetHostsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a Host Set.
|
||||
*/
|
||||
async hostSetServiceUpdateHostSetRaw(requestParameters: HostSetServiceUpdateHostSetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesHostsetsV1HostSet>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling hostSetServiceUpdateHostSet().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling hostSetServiceUpdateHostSet().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/host-sets/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'PATCH',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesHostsetsV1HostSetToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesHostsetsV1HostSetFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a Host Set.
|
||||
*/
|
||||
async hostSetServiceUpdateHostSet(requestParameters: HostSetServiceUpdateHostSetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesHostsetsV1HostSet> {
|
||||
const response = await this.hostSetServiceUpdateHostSetRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,267 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Boundary controller HTTP API
|
||||
* Welcome to the Boundary controller HTTP API documentation. This page provides a reference guide for using the Boundary controller API, a JSON-based HTTP API. The API implements commonly seen HTTP API patterns for status codes, paths, and errors. See the [API overview](https://developer.hashicorp.com/boundary/docs/api-clients/api) for more information. Before you read this page, it is useful to understand Boundary\'s [domain model](https://developer.hashicorp.com/boundary/docs/concepts/domain-model) and to be aware of the terminology used here. To get started, search for the service you want to interact with in the sidebar to the left. Each resource in Boundary, such as accounts and credential stores, has its own service. Each service contains all the API endpoints for the resource. ## Status codes - `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it follows well-understood semantics for those status codes. - `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which returns a `404` as discussed below. - `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource returns a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action. - `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action. - `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist returns a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it\'s tolerable as it allows for far simpler and more robust client implementation. - `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource. - `429`: Boundary returns a `429` if any of the API rate limit quotas have been exhausted for the resource and action. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. - `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error is logged to Boundary\'s server log but is not generally provided to the client. - `503`: Boundary returns a `503` if it is unable to store a quota due to the API rate limit being exceeded. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. ## List pagination Boundary uses [API pagination](https://developer.hashicorp.com/boundary/docs/api-clients/api/pagination) to support searching and filtering large lists of results efficiently.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.19.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
ControllerApiResourcesManagedgroupsV1ManagedGroup,
|
||||
ControllerApiServicesV1ListManagedGroupsResponse,
|
||||
ControllerApiV1Error,
|
||||
} from '../models/index';
|
||||
import {
|
||||
ControllerApiResourcesManagedgroupsV1ManagedGroupFromJSON,
|
||||
ControllerApiResourcesManagedgroupsV1ManagedGroupToJSON,
|
||||
ControllerApiServicesV1ListManagedGroupsResponseFromJSON,
|
||||
ControllerApiServicesV1ListManagedGroupsResponseToJSON,
|
||||
ControllerApiV1ErrorFromJSON,
|
||||
ControllerApiV1ErrorToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface ManagedGroupServiceCreateManagedGroupRequest {
|
||||
item: Omit<ControllerApiResourcesManagedgroupsV1ManagedGroup, 'id'|'created_time'|'updated_time'|'member_ids'|'authorized_actions'>;
|
||||
}
|
||||
|
||||
export interface ManagedGroupServiceDeleteManagedGroupRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ManagedGroupServiceGetManagedGroupRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ManagedGroupServiceListManagedGroupsRequest {
|
||||
authMethodId?: string;
|
||||
filter?: string;
|
||||
listToken?: string;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface ManagedGroupServiceUpdateManagedGroupRequest {
|
||||
id: string;
|
||||
item: Omit<ControllerApiResourcesManagedgroupsV1ManagedGroup, 'id'|'created_time'|'updated_time'|'member_ids'|'authorized_actions'>;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class ManagedGroupServiceApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Creates a single ManagedGroup in the provided Auth Method.
|
||||
*/
|
||||
async managedGroupServiceCreateManagedGroupRaw(requestParameters: ManagedGroupServiceCreateManagedGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesManagedgroupsV1ManagedGroup>> {
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling managedGroupServiceCreateManagedGroup().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/managed-groups`,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesManagedgroupsV1ManagedGroupToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesManagedgroupsV1ManagedGroupFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single ManagedGroup in the provided Auth Method.
|
||||
*/
|
||||
async managedGroupServiceCreateManagedGroup(requestParameters: ManagedGroupServiceCreateManagedGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesManagedgroupsV1ManagedGroup> {
|
||||
const response = await this.managedGroupServiceCreateManagedGroupRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a ManagedGroup.
|
||||
*/
|
||||
async managedGroupServiceDeleteManagedGroupRaw(requestParameters: ManagedGroupServiceDeleteManagedGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling managedGroupServiceDeleteManagedGroup().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/managed-groups/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse<any>(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a ManagedGroup.
|
||||
*/
|
||||
async managedGroupServiceDeleteManagedGroup(requestParameters: ManagedGroupServiceDeleteManagedGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object> {
|
||||
const response = await this.managedGroupServiceDeleteManagedGroupRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single ManagedGroup.
|
||||
*/
|
||||
async managedGroupServiceGetManagedGroupRaw(requestParameters: ManagedGroupServiceGetManagedGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesManagedgroupsV1ManagedGroup>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling managedGroupServiceGetManagedGroup().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/managed-groups/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesManagedgroupsV1ManagedGroupFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single ManagedGroup.
|
||||
*/
|
||||
async managedGroupServiceGetManagedGroup(requestParameters: ManagedGroupServiceGetManagedGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesManagedgroupsV1ManagedGroup> {
|
||||
const response = await this.managedGroupServiceGetManagedGroupRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all ManagedGroups in a specific Auth Method.
|
||||
*/
|
||||
async managedGroupServiceListManagedGroupsRaw(requestParameters: ManagedGroupServiceListManagedGroupsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1ListManagedGroupsResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['authMethodId'] != null) {
|
||||
queryParameters['auth_method_id'] = requestParameters['authMethodId'];
|
||||
}
|
||||
|
||||
if (requestParameters['filter'] != null) {
|
||||
queryParameters['filter'] = requestParameters['filter'];
|
||||
}
|
||||
|
||||
if (requestParameters['listToken'] != null) {
|
||||
queryParameters['list_token'] = requestParameters['listToken'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['page_size'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/managed-groups`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1ListManagedGroupsResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all ManagedGroups in a specific Auth Method.
|
||||
*/
|
||||
async managedGroupServiceListManagedGroups(requestParameters: ManagedGroupServiceListManagedGroupsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1ListManagedGroupsResponse> {
|
||||
const response = await this.managedGroupServiceListManagedGroupsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a ManagedGroup.
|
||||
*/
|
||||
async managedGroupServiceUpdateManagedGroupRaw(requestParameters: ManagedGroupServiceUpdateManagedGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesManagedgroupsV1ManagedGroup>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling managedGroupServiceUpdateManagedGroup().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling managedGroupServiceUpdateManagedGroup().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/managed-groups/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'PATCH',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesManagedgroupsV1ManagedGroupToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesManagedgroupsV1ManagedGroupFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a ManagedGroup.
|
||||
*/
|
||||
async managedGroupServiceUpdateManagedGroup(requestParameters: ManagedGroupServiceUpdateManagedGroupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesManagedgroupsV1ManagedGroup> {
|
||||
const response = await this.managedGroupServiceUpdateManagedGroupRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,272 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Boundary controller HTTP API
|
||||
* Welcome to the Boundary controller HTTP API documentation. This page provides a reference guide for using the Boundary controller API, a JSON-based HTTP API. The API implements commonly seen HTTP API patterns for status codes, paths, and errors. See the [API overview](https://developer.hashicorp.com/boundary/docs/api-clients/api) for more information. Before you read this page, it is useful to understand Boundary\'s [domain model](https://developer.hashicorp.com/boundary/docs/concepts/domain-model) and to be aware of the terminology used here. To get started, search for the service you want to interact with in the sidebar to the left. Each resource in Boundary, such as accounts and credential stores, has its own service. Each service contains all the API endpoints for the resource. ## Status codes - `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it follows well-understood semantics for those status codes. - `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which returns a `404` as discussed below. - `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource returns a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action. - `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action. - `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist returns a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it\'s tolerable as it allows for far simpler and more robust client implementation. - `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource. - `429`: Boundary returns a `429` if any of the API rate limit quotas have been exhausted for the resource and action. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. - `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error is logged to Boundary\'s server log but is not generally provided to the client. - `503`: Boundary returns a `503` if it is unable to store a quota due to the API rate limit being exceeded. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. ## List pagination Boundary uses [API pagination](https://developer.hashicorp.com/boundary/docs/api-clients/api/pagination) to support searching and filtering large lists of results efficiently.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.19.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
ControllerApiResourcesPoliciesV1Policy,
|
||||
ControllerApiServicesV1ListPoliciesResponse,
|
||||
ControllerApiV1Error,
|
||||
} from '../models/index';
|
||||
import {
|
||||
ControllerApiResourcesPoliciesV1PolicyFromJSON,
|
||||
ControllerApiResourcesPoliciesV1PolicyToJSON,
|
||||
ControllerApiServicesV1ListPoliciesResponseFromJSON,
|
||||
ControllerApiServicesV1ListPoliciesResponseToJSON,
|
||||
ControllerApiV1ErrorFromJSON,
|
||||
ControllerApiV1ErrorToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface PolicyServiceCreatePolicyRequest {
|
||||
item: Omit<ControllerApiResourcesPoliciesV1Policy, 'id'|'created_time'|'updated_time'|'authorized_actions'>;
|
||||
}
|
||||
|
||||
export interface PolicyServiceDeletePolicyRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface PolicyServiceGetPolicyRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface PolicyServiceListPoliciesRequest {
|
||||
scopeId?: string;
|
||||
recursive?: boolean;
|
||||
filter?: string;
|
||||
listToken?: string;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface PolicyServiceUpdatePolicyRequest {
|
||||
id: string;
|
||||
item: Omit<ControllerApiResourcesPoliciesV1Policy, 'id'|'created_time'|'updated_time'|'authorized_actions'>;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class PolicyServiceApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Creates a single policy.
|
||||
*/
|
||||
async policyServiceCreatePolicyRaw(requestParameters: PolicyServiceCreatePolicyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesPoliciesV1Policy>> {
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling policyServiceCreatePolicy().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/policies`,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesPoliciesV1PolicyToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesPoliciesV1PolicyFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single policy.
|
||||
*/
|
||||
async policyServiceCreatePolicy(requestParameters: PolicyServiceCreatePolicyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesPoliciesV1Policy> {
|
||||
const response = await this.policyServiceCreatePolicyRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes an existing policy.
|
||||
*/
|
||||
async policyServiceDeletePolicyRaw(requestParameters: PolicyServiceDeletePolicyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling policyServiceDeletePolicy().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/policies/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse<any>(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes an existing policy.
|
||||
*/
|
||||
async policyServiceDeletePolicy(requestParameters: PolicyServiceDeletePolicyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object> {
|
||||
const response = await this.policyServiceDeletePolicyRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single policy with the given id.
|
||||
*/
|
||||
async policyServiceGetPolicyRaw(requestParameters: PolicyServiceGetPolicyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesPoliciesV1Policy>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling policyServiceGetPolicy().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/policies/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesPoliciesV1PolicyFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single policy with the given id.
|
||||
*/
|
||||
async policyServiceGetPolicy(requestParameters: PolicyServiceGetPolicyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesPoliciesV1Policy> {
|
||||
const response = await this.policyServiceGetPolicyRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all policies.
|
||||
*/
|
||||
async policyServiceListPoliciesRaw(requestParameters: PolicyServiceListPoliciesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1ListPoliciesResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['scopeId'] != null) {
|
||||
queryParameters['scope_id'] = requestParameters['scopeId'];
|
||||
}
|
||||
|
||||
if (requestParameters['recursive'] != null) {
|
||||
queryParameters['recursive'] = requestParameters['recursive'];
|
||||
}
|
||||
|
||||
if (requestParameters['filter'] != null) {
|
||||
queryParameters['filter'] = requestParameters['filter'];
|
||||
}
|
||||
|
||||
if (requestParameters['listToken'] != null) {
|
||||
queryParameters['list_token'] = requestParameters['listToken'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['page_size'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/policies`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1ListPoliciesResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all policies.
|
||||
*/
|
||||
async policyServiceListPolicies(requestParameters: PolicyServiceListPoliciesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1ListPoliciesResponse> {
|
||||
const response = await this.policyServiceListPoliciesRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an existing policy.
|
||||
*/
|
||||
async policyServiceUpdatePolicyRaw(requestParameters: PolicyServiceUpdatePolicyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesPoliciesV1Policy>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling policyServiceUpdatePolicy().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling policyServiceUpdatePolicy().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/policies/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'PATCH',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesPoliciesV1PolicyToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesPoliciesV1PolicyFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an existing policy.
|
||||
*/
|
||||
async policyServiceUpdatePolicy(requestParameters: PolicyServiceUpdatePolicyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesPoliciesV1Policy> {
|
||||
const response = await this.policyServiceUpdatePolicyRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,767 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Boundary controller HTTP API
|
||||
* Welcome to the Boundary controller HTTP API documentation. This page provides a reference guide for using the Boundary controller API, a JSON-based HTTP API. The API implements commonly seen HTTP API patterns for status codes, paths, and errors. See the [API overview](https://developer.hashicorp.com/boundary/docs/api-clients/api) for more information. Before you read this page, it is useful to understand Boundary\'s [domain model](https://developer.hashicorp.com/boundary/docs/concepts/domain-model) and to be aware of the terminology used here. To get started, search for the service you want to interact with in the sidebar to the left. Each resource in Boundary, such as accounts and credential stores, has its own service. Each service contains all the API endpoints for the resource. ## Status codes - `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it follows well-understood semantics for those status codes. - `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which returns a `404` as discussed below. - `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource returns a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action. - `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action. - `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist returns a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it\'s tolerable as it allows for far simpler and more robust client implementation. - `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource. - `429`: Boundary returns a `429` if any of the API rate limit quotas have been exhausted for the resource and action. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. - `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error is logged to Boundary\'s server log but is not generally provided to the client. - `503`: Boundary returns a `503` if it is unable to store a quota due to the API rate limit being exceeded. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. ## List pagination Boundary uses [API pagination](https://developer.hashicorp.com/boundary/docs/api-clients/api/pagination) to support searching and filtering large lists of results efficiently.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.19.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
ControllerApiResourcesRolesV1Role,
|
||||
ControllerApiServicesV1ListRolesResponse,
|
||||
ControllerApiServicesV1RoleServiceAddRoleGrantScopesBody,
|
||||
ControllerApiServicesV1RoleServiceAddRoleGrantsBody,
|
||||
ControllerApiServicesV1RoleServiceAddRolePrincipalsBody,
|
||||
ControllerApiServicesV1RoleServiceRemoveRoleGrantScopesBody,
|
||||
ControllerApiServicesV1RoleServiceRemoveRoleGrantsBody,
|
||||
ControllerApiServicesV1RoleServiceRemoveRolePrincipalsBody,
|
||||
ControllerApiServicesV1RoleServiceSetRoleGrantScopesBody,
|
||||
ControllerApiServicesV1RoleServiceSetRoleGrantsBody,
|
||||
ControllerApiServicesV1RoleServiceSetRolePrincipalsBody,
|
||||
ControllerApiV1Error,
|
||||
} from '../models/index';
|
||||
import {
|
||||
ControllerApiResourcesRolesV1RoleFromJSON,
|
||||
ControllerApiResourcesRolesV1RoleToJSON,
|
||||
ControllerApiServicesV1ListRolesResponseFromJSON,
|
||||
ControllerApiServicesV1ListRolesResponseToJSON,
|
||||
ControllerApiServicesV1RoleServiceAddRoleGrantScopesBodyFromJSON,
|
||||
ControllerApiServicesV1RoleServiceAddRoleGrantScopesBodyToJSON,
|
||||
ControllerApiServicesV1RoleServiceAddRoleGrantsBodyFromJSON,
|
||||
ControllerApiServicesV1RoleServiceAddRoleGrantsBodyToJSON,
|
||||
ControllerApiServicesV1RoleServiceAddRolePrincipalsBodyFromJSON,
|
||||
ControllerApiServicesV1RoleServiceAddRolePrincipalsBodyToJSON,
|
||||
ControllerApiServicesV1RoleServiceRemoveRoleGrantScopesBodyFromJSON,
|
||||
ControllerApiServicesV1RoleServiceRemoveRoleGrantScopesBodyToJSON,
|
||||
ControllerApiServicesV1RoleServiceRemoveRoleGrantsBodyFromJSON,
|
||||
ControllerApiServicesV1RoleServiceRemoveRoleGrantsBodyToJSON,
|
||||
ControllerApiServicesV1RoleServiceRemoveRolePrincipalsBodyFromJSON,
|
||||
ControllerApiServicesV1RoleServiceRemoveRolePrincipalsBodyToJSON,
|
||||
ControllerApiServicesV1RoleServiceSetRoleGrantScopesBodyFromJSON,
|
||||
ControllerApiServicesV1RoleServiceSetRoleGrantScopesBodyToJSON,
|
||||
ControllerApiServicesV1RoleServiceSetRoleGrantsBodyFromJSON,
|
||||
ControllerApiServicesV1RoleServiceSetRoleGrantsBodyToJSON,
|
||||
ControllerApiServicesV1RoleServiceSetRolePrincipalsBodyFromJSON,
|
||||
ControllerApiServicesV1RoleServiceSetRolePrincipalsBodyToJSON,
|
||||
ControllerApiV1ErrorFromJSON,
|
||||
ControllerApiV1ErrorToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface RoleServiceAddRoleGrantScopesRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1RoleServiceAddRoleGrantScopesBody;
|
||||
}
|
||||
|
||||
export interface RoleServiceAddRoleGrantsRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1RoleServiceAddRoleGrantsBody;
|
||||
}
|
||||
|
||||
export interface RoleServiceAddRolePrincipalsRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1RoleServiceAddRolePrincipalsBody;
|
||||
}
|
||||
|
||||
export interface RoleServiceCreateRoleRequest {
|
||||
item: Omit<ControllerApiResourcesRolesV1Role, 'id'|'created_time'|'updated_time'|'grant_scope_ids'|'principal_ids'|'principals'|'grant_strings'|'grants'|'authorized_actions'>;
|
||||
}
|
||||
|
||||
export interface RoleServiceDeleteRoleRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface RoleServiceGetRoleRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface RoleServiceListRolesRequest {
|
||||
scopeId?: string;
|
||||
recursive?: boolean;
|
||||
filter?: string;
|
||||
listToken?: string;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface RoleServiceRemoveRoleGrantScopesRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1RoleServiceRemoveRoleGrantScopesBody;
|
||||
}
|
||||
|
||||
export interface RoleServiceRemoveRoleGrantsRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1RoleServiceRemoveRoleGrantsBody;
|
||||
}
|
||||
|
||||
export interface RoleServiceRemoveRolePrincipalsRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1RoleServiceRemoveRolePrincipalsBody;
|
||||
}
|
||||
|
||||
export interface RoleServiceSetRoleGrantScopesRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1RoleServiceSetRoleGrantScopesBody;
|
||||
}
|
||||
|
||||
export interface RoleServiceSetRoleGrantsRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1RoleServiceSetRoleGrantsBody;
|
||||
}
|
||||
|
||||
export interface RoleServiceSetRolePrincipalsRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1RoleServiceSetRolePrincipalsBody;
|
||||
}
|
||||
|
||||
export interface RoleServiceUpdateRoleRequest {
|
||||
id: string;
|
||||
item: Omit<ControllerApiResourcesRolesV1Role, 'id'|'created_time'|'updated_time'|'grant_scope_ids'|'principal_ids'|'principals'|'grant_strings'|'grants'|'authorized_actions'>;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class RoleServiceApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Adds grant scopes to a Role
|
||||
*/
|
||||
async roleServiceAddRoleGrantScopesRaw(requestParameters: RoleServiceAddRoleGrantScopesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesRolesV1Role>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling roleServiceAddRoleGrantScopes().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling roleServiceAddRoleGrantScopes().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/roles/{id}:add-grant-scopes`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1RoleServiceAddRoleGrantScopesBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesRolesV1RoleFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds grant scopes to a Role
|
||||
*/
|
||||
async roleServiceAddRoleGrantScopes(requestParameters: RoleServiceAddRoleGrantScopesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesRolesV1Role> {
|
||||
const response = await this.roleServiceAddRoleGrantScopesRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds grants to a Role
|
||||
*/
|
||||
async roleServiceAddRoleGrantsRaw(requestParameters: RoleServiceAddRoleGrantsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesRolesV1Role>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling roleServiceAddRoleGrants().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling roleServiceAddRoleGrants().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/roles/{id}:add-grants`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1RoleServiceAddRoleGrantsBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesRolesV1RoleFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds grants to a Role
|
||||
*/
|
||||
async roleServiceAddRoleGrants(requestParameters: RoleServiceAddRoleGrantsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesRolesV1Role> {
|
||||
const response = await this.roleServiceAddRoleGrantsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds Users and/or Groups to a Role.
|
||||
*/
|
||||
async roleServiceAddRolePrincipalsRaw(requestParameters: RoleServiceAddRolePrincipalsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesRolesV1Role>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling roleServiceAddRolePrincipals().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling roleServiceAddRolePrincipals().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/roles/{id}:add-principals`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1RoleServiceAddRolePrincipalsBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesRolesV1RoleFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds Users and/or Groups to a Role.
|
||||
*/
|
||||
async roleServiceAddRolePrincipals(requestParameters: RoleServiceAddRolePrincipalsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesRolesV1Role> {
|
||||
const response = await this.roleServiceAddRolePrincipalsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single Role.
|
||||
*/
|
||||
async roleServiceCreateRoleRaw(requestParameters: RoleServiceCreateRoleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesRolesV1Role>> {
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling roleServiceCreateRole().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/roles`,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesRolesV1RoleToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesRolesV1RoleFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single Role.
|
||||
*/
|
||||
async roleServiceCreateRole(requestParameters: RoleServiceCreateRoleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesRolesV1Role> {
|
||||
const response = await this.roleServiceCreateRoleRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a Role.
|
||||
*/
|
||||
async roleServiceDeleteRoleRaw(requestParameters: RoleServiceDeleteRoleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling roleServiceDeleteRole().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/roles/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse<any>(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a Role.
|
||||
*/
|
||||
async roleServiceDeleteRole(requestParameters: RoleServiceDeleteRoleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object> {
|
||||
const response = await this.roleServiceDeleteRoleRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Role.
|
||||
*/
|
||||
async roleServiceGetRoleRaw(requestParameters: RoleServiceGetRoleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesRolesV1Role>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling roleServiceGetRole().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/roles/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesRolesV1RoleFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Role.
|
||||
*/
|
||||
async roleServiceGetRole(requestParameters: RoleServiceGetRoleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesRolesV1Role> {
|
||||
const response = await this.roleServiceGetRoleRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Roles.
|
||||
*/
|
||||
async roleServiceListRolesRaw(requestParameters: RoleServiceListRolesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1ListRolesResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['scopeId'] != null) {
|
||||
queryParameters['scope_id'] = requestParameters['scopeId'];
|
||||
}
|
||||
|
||||
if (requestParameters['recursive'] != null) {
|
||||
queryParameters['recursive'] = requestParameters['recursive'];
|
||||
}
|
||||
|
||||
if (requestParameters['filter'] != null) {
|
||||
queryParameters['filter'] = requestParameters['filter'];
|
||||
}
|
||||
|
||||
if (requestParameters['listToken'] != null) {
|
||||
queryParameters['list_token'] = requestParameters['listToken'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['page_size'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/roles`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1ListRolesResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Roles.
|
||||
*/
|
||||
async roleServiceListRoles(requestParameters: RoleServiceListRolesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1ListRolesResponse> {
|
||||
const response = await this.roleServiceListRolesRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes grant scopes from a Role.
|
||||
*/
|
||||
async roleServiceRemoveRoleGrantScopesRaw(requestParameters: RoleServiceRemoveRoleGrantScopesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesRolesV1Role>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling roleServiceRemoveRoleGrantScopes().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling roleServiceRemoveRoleGrantScopes().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/roles/{id}:remove-grant-scopes`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1RoleServiceRemoveRoleGrantScopesBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesRolesV1RoleFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes grant scopes from a Role.
|
||||
*/
|
||||
async roleServiceRemoveRoleGrantScopes(requestParameters: RoleServiceRemoveRoleGrantScopesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesRolesV1Role> {
|
||||
const response = await this.roleServiceRemoveRoleGrantScopesRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes grants from a Role.
|
||||
*/
|
||||
async roleServiceRemoveRoleGrantsRaw(requestParameters: RoleServiceRemoveRoleGrantsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesRolesV1Role>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling roleServiceRemoveRoleGrants().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling roleServiceRemoveRoleGrants().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/roles/{id}:remove-grants`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1RoleServiceRemoveRoleGrantsBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesRolesV1RoleFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes grants from a Role.
|
||||
*/
|
||||
async roleServiceRemoveRoleGrants(requestParameters: RoleServiceRemoveRoleGrantsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesRolesV1Role> {
|
||||
const response = await this.roleServiceRemoveRoleGrantsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the specified Users and/or Groups from a Role.
|
||||
*/
|
||||
async roleServiceRemoveRolePrincipalsRaw(requestParameters: RoleServiceRemoveRolePrincipalsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesRolesV1Role>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling roleServiceRemoveRolePrincipals().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling roleServiceRemoveRolePrincipals().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/roles/{id}:remove-principals`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1RoleServiceRemoveRolePrincipalsBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesRolesV1RoleFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the specified Users and/or Groups from a Role.
|
||||
*/
|
||||
async roleServiceRemoveRolePrincipals(requestParameters: RoleServiceRemoveRolePrincipalsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesRolesV1Role> {
|
||||
const response = await this.roleServiceRemoveRolePrincipalsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set grant scopes for a Role, removing any grant scopes that are not specified in the request.
|
||||
*/
|
||||
async roleServiceSetRoleGrantScopesRaw(requestParameters: RoleServiceSetRoleGrantScopesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesRolesV1Role>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling roleServiceSetRoleGrantScopes().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling roleServiceSetRoleGrantScopes().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/roles/{id}:set-grant-scopes`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1RoleServiceSetRoleGrantScopesBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesRolesV1RoleFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set grant scopes for a Role, removing any grant scopes that are not specified in the request.
|
||||
*/
|
||||
async roleServiceSetRoleGrantScopes(requestParameters: RoleServiceSetRoleGrantScopesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesRolesV1Role> {
|
||||
const response = await this.roleServiceSetRoleGrantScopesRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set grants for a Role, removing any grants that are not specified in the request.
|
||||
*/
|
||||
async roleServiceSetRoleGrantsRaw(requestParameters: RoleServiceSetRoleGrantsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesRolesV1Role>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling roleServiceSetRoleGrants().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling roleServiceSetRoleGrants().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/roles/{id}:set-grants`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1RoleServiceSetRoleGrantsBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesRolesV1RoleFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set grants for a Role, removing any grants that are not specified in the request.
|
||||
*/
|
||||
async roleServiceSetRoleGrants(requestParameters: RoleServiceSetRoleGrantsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesRolesV1Role> {
|
||||
const response = await this.roleServiceSetRoleGrantsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Users and/or Groups to a Role, removing any principals that are not specified in the request.
|
||||
*/
|
||||
async roleServiceSetRolePrincipalsRaw(requestParameters: RoleServiceSetRolePrincipalsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesRolesV1Role>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling roleServiceSetRolePrincipals().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling roleServiceSetRolePrincipals().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/roles/{id}:set-principals`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1RoleServiceSetRolePrincipalsBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesRolesV1RoleFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Users and/or Groups to a Role, removing any principals that are not specified in the request.
|
||||
*/
|
||||
async roleServiceSetRolePrincipals(requestParameters: RoleServiceSetRolePrincipalsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesRolesV1Role> {
|
||||
const response = await this.roleServiceSetRolePrincipalsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a Role.
|
||||
*/
|
||||
async roleServiceUpdateRoleRaw(requestParameters: RoleServiceUpdateRoleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesRolesV1Role>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling roleServiceUpdateRole().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling roleServiceUpdateRole().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/roles/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'PATCH',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesRolesV1RoleToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesRolesV1RoleFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a Role.
|
||||
*/
|
||||
async roleServiceUpdateRole(requestParameters: RoleServiceUpdateRoleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesRolesV1Role> {
|
||||
const response = await this.roleServiceUpdateRoleRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,577 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Boundary controller HTTP API
|
||||
* Welcome to the Boundary controller HTTP API documentation. This page provides a reference guide for using the Boundary controller API, a JSON-based HTTP API. The API implements commonly seen HTTP API patterns for status codes, paths, and errors. See the [API overview](https://developer.hashicorp.com/boundary/docs/api-clients/api) for more information. Before you read this page, it is useful to understand Boundary\'s [domain model](https://developer.hashicorp.com/boundary/docs/concepts/domain-model) and to be aware of the terminology used here. To get started, search for the service you want to interact with in the sidebar to the left. Each resource in Boundary, such as accounts and credential stores, has its own service. Each service contains all the API endpoints for the resource. ## Status codes - `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it follows well-understood semantics for those status codes. - `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which returns a `404` as discussed below. - `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource returns a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action. - `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action. - `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist returns a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it\'s tolerable as it allows for far simpler and more robust client implementation. - `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource. - `429`: Boundary returns a `429` if any of the API rate limit quotas have been exhausted for the resource and action. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. - `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error is logged to Boundary\'s server log but is not generally provided to the client. - `503`: Boundary returns a `503` if it is unable to store a quota due to the API rate limit being exceeded. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. ## List pagination Boundary uses [API pagination](https://developer.hashicorp.com/boundary/docs/api-clients/api/pagination) to support searching and filtering large lists of results efficiently.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.19.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
ControllerApiResourcesScopesV1Scope,
|
||||
ControllerApiServicesV1DestroyKeyVersionRequest,
|
||||
ControllerApiServicesV1DestroyKeyVersionResponse,
|
||||
ControllerApiServicesV1ListKeyVersionDestructionJobsResponse,
|
||||
ControllerApiServicesV1ListKeysResponse,
|
||||
ControllerApiServicesV1ListScopesResponse,
|
||||
ControllerApiServicesV1RotateKeysRequest,
|
||||
ControllerApiServicesV1ScopeServiceAttachStoragePolicyBody,
|
||||
ControllerApiServicesV1ScopeServiceDetachStoragePolicyBody,
|
||||
ControllerApiV1Error,
|
||||
} from '../models/index';
|
||||
import {
|
||||
ControllerApiResourcesScopesV1ScopeFromJSON,
|
||||
ControllerApiResourcesScopesV1ScopeToJSON,
|
||||
ControllerApiServicesV1DestroyKeyVersionRequestFromJSON,
|
||||
ControllerApiServicesV1DestroyKeyVersionRequestToJSON,
|
||||
ControllerApiServicesV1DestroyKeyVersionResponseFromJSON,
|
||||
ControllerApiServicesV1DestroyKeyVersionResponseToJSON,
|
||||
ControllerApiServicesV1ListKeyVersionDestructionJobsResponseFromJSON,
|
||||
ControllerApiServicesV1ListKeyVersionDestructionJobsResponseToJSON,
|
||||
ControllerApiServicesV1ListKeysResponseFromJSON,
|
||||
ControllerApiServicesV1ListKeysResponseToJSON,
|
||||
ControllerApiServicesV1ListScopesResponseFromJSON,
|
||||
ControllerApiServicesV1ListScopesResponseToJSON,
|
||||
ControllerApiServicesV1RotateKeysRequestFromJSON,
|
||||
ControllerApiServicesV1RotateKeysRequestToJSON,
|
||||
ControllerApiServicesV1ScopeServiceAttachStoragePolicyBodyFromJSON,
|
||||
ControllerApiServicesV1ScopeServiceAttachStoragePolicyBodyToJSON,
|
||||
ControllerApiServicesV1ScopeServiceDetachStoragePolicyBodyFromJSON,
|
||||
ControllerApiServicesV1ScopeServiceDetachStoragePolicyBodyToJSON,
|
||||
ControllerApiV1ErrorFromJSON,
|
||||
ControllerApiV1ErrorToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface ScopeServiceAttachStoragePolicyRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1ScopeServiceAttachStoragePolicyBody;
|
||||
}
|
||||
|
||||
export interface ScopeServiceCreateScopeRequest {
|
||||
item: Omit<ControllerApiResourcesScopesV1Scope, 'id'|'created_time'|'updated_time'|'authorized_actions'|'authorized_collection_actions'|'storage_policy_id'>;
|
||||
skipAdminRoleCreation?: boolean;
|
||||
skipDefaultRoleCreation?: boolean;
|
||||
}
|
||||
|
||||
export interface ScopeServiceDeleteScopeRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ScopeServiceDestroyKeyVersionRequest {
|
||||
body: ControllerApiServicesV1DestroyKeyVersionRequest;
|
||||
}
|
||||
|
||||
export interface ScopeServiceDetachStoragePolicyRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1ScopeServiceDetachStoragePolicyBody;
|
||||
}
|
||||
|
||||
export interface ScopeServiceGetScopeRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ScopeServiceListKeyVersionDestructionJobsRequest {
|
||||
scopeId: string;
|
||||
}
|
||||
|
||||
export interface ScopeServiceListKeysRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ScopeServiceListScopesRequest {
|
||||
scopeId?: string;
|
||||
recursive?: boolean;
|
||||
filter?: string;
|
||||
listToken?: string;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface ScopeServiceRotateKeysRequest {
|
||||
body: ControllerApiServicesV1RotateKeysRequest;
|
||||
}
|
||||
|
||||
export interface ScopeServiceUpdateScopeRequest {
|
||||
id: string;
|
||||
item: Omit<ControllerApiResourcesScopesV1Scope, 'id'|'created_time'|'updated_time'|'authorized_actions'|'authorized_collection_actions'|'storage_policy_id'>;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class ScopeServiceApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Attaches the specified Storage Policy to the Scope.
|
||||
*/
|
||||
async scopeServiceAttachStoragePolicyRaw(requestParameters: ScopeServiceAttachStoragePolicyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesScopesV1Scope>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling scopeServiceAttachStoragePolicy().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling scopeServiceAttachStoragePolicy().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/scopes/{id}:attach-storage-policy`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1ScopeServiceAttachStoragePolicyBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesScopesV1ScopeFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Attaches the specified Storage Policy to the Scope.
|
||||
*/
|
||||
async scopeServiceAttachStoragePolicy(requestParameters: ScopeServiceAttachStoragePolicyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesScopesV1Scope> {
|
||||
const response = await this.scopeServiceAttachStoragePolicyRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single Scope.
|
||||
*/
|
||||
async scopeServiceCreateScopeRaw(requestParameters: ScopeServiceCreateScopeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesScopesV1Scope>> {
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling scopeServiceCreateScope().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['skipAdminRoleCreation'] != null) {
|
||||
queryParameters['skip_admin_role_creation'] = requestParameters['skipAdminRoleCreation'];
|
||||
}
|
||||
|
||||
if (requestParameters['skipDefaultRoleCreation'] != null) {
|
||||
queryParameters['skip_default_role_creation'] = requestParameters['skipDefaultRoleCreation'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/scopes`,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesScopesV1ScopeToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesScopesV1ScopeFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single Scope.
|
||||
*/
|
||||
async scopeServiceCreateScope(requestParameters: ScopeServiceCreateScopeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesScopesV1Scope> {
|
||||
const response = await this.scopeServiceCreateScopeRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a Scope.
|
||||
*/
|
||||
async scopeServiceDeleteScopeRaw(requestParameters: ScopeServiceDeleteScopeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling scopeServiceDeleteScope().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/scopes/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse<any>(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a Scope.
|
||||
*/
|
||||
async scopeServiceDeleteScope(requestParameters: ScopeServiceDeleteScopeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object> {
|
||||
const response = await this.scopeServiceDeleteScopeRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy the specified key version in a Scope. This may start an asynchronous job that re-encrypts all data encrypted by the specified key version. Use GET /v1/scopes/{scope_id}:list-key-version-destruction-jobs to monitor pending destruction jobs.
|
||||
*/
|
||||
async scopeServiceDestroyKeyVersionRaw(requestParameters: ScopeServiceDestroyKeyVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1DestroyKeyVersionResponse>> {
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling scopeServiceDestroyKeyVersion().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/scopes:destroy-key-version`,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1DestroyKeyVersionRequestToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1DestroyKeyVersionResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy the specified key version in a Scope. This may start an asynchronous job that re-encrypts all data encrypted by the specified key version. Use GET /v1/scopes/{scope_id}:list-key-version-destruction-jobs to monitor pending destruction jobs.
|
||||
*/
|
||||
async scopeServiceDestroyKeyVersion(requestParameters: ScopeServiceDestroyKeyVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1DestroyKeyVersionResponse> {
|
||||
const response = await this.scopeServiceDestroyKeyVersionRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Detaches the specified Storage Policy from the Scope.
|
||||
*/
|
||||
async scopeServiceDetachStoragePolicyRaw(requestParameters: ScopeServiceDetachStoragePolicyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesScopesV1Scope>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling scopeServiceDetachStoragePolicy().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling scopeServiceDetachStoragePolicy().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/scopes/{id}:detach-storage-policy`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1ScopeServiceDetachStoragePolicyBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesScopesV1ScopeFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Detaches the specified Storage Policy from the Scope.
|
||||
*/
|
||||
async scopeServiceDetachStoragePolicy(requestParameters: ScopeServiceDetachStoragePolicyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesScopesV1Scope> {
|
||||
const response = await this.scopeServiceDetachStoragePolicyRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Scope.
|
||||
*/
|
||||
async scopeServiceGetScopeRaw(requestParameters: ScopeServiceGetScopeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesScopesV1Scope>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling scopeServiceGetScope().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/scopes/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesScopesV1ScopeFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Scope.
|
||||
*/
|
||||
async scopeServiceGetScope(requestParameters: ScopeServiceGetScopeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesScopesV1Scope> {
|
||||
const response = await this.scopeServiceGetScopeRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all pending key version destruction jobs in a Scope.
|
||||
*/
|
||||
async scopeServiceListKeyVersionDestructionJobsRaw(requestParameters: ScopeServiceListKeyVersionDestructionJobsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1ListKeyVersionDestructionJobsResponse>> {
|
||||
if (requestParameters['scopeId'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'scopeId',
|
||||
'Required parameter "scopeId" was null or undefined when calling scopeServiceListKeyVersionDestructionJobs().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/scopes/{scope_id}:list-key-version-destruction-jobs`.replace(`{${"scope_id"}}`, encodeURIComponent(String(requestParameters['scopeId']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1ListKeyVersionDestructionJobsResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all pending key version destruction jobs in a Scope.
|
||||
*/
|
||||
async scopeServiceListKeyVersionDestructionJobs(requestParameters: ScopeServiceListKeyVersionDestructionJobsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1ListKeyVersionDestructionJobsResponse> {
|
||||
const response = await this.scopeServiceListKeyVersionDestructionJobsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* List all keys in a Scope.
|
||||
*/
|
||||
async scopeServiceListKeysRaw(requestParameters: ScopeServiceListKeysRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1ListKeysResponse>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling scopeServiceListKeys().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/scopes/{id}:list-keys`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1ListKeysResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* List all keys in a Scope.
|
||||
*/
|
||||
async scopeServiceListKeys(requestParameters: ScopeServiceListKeysRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1ListKeysResponse> {
|
||||
const response = await this.scopeServiceListKeysRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Scopes within the Scope provided in the request.
|
||||
*/
|
||||
async scopeServiceListScopesRaw(requestParameters: ScopeServiceListScopesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1ListScopesResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['scopeId'] != null) {
|
||||
queryParameters['scope_id'] = requestParameters['scopeId'];
|
||||
}
|
||||
|
||||
if (requestParameters['recursive'] != null) {
|
||||
queryParameters['recursive'] = requestParameters['recursive'];
|
||||
}
|
||||
|
||||
if (requestParameters['filter'] != null) {
|
||||
queryParameters['filter'] = requestParameters['filter'];
|
||||
}
|
||||
|
||||
if (requestParameters['listToken'] != null) {
|
||||
queryParameters['list_token'] = requestParameters['listToken'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['page_size'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/scopes`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1ListScopesResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Scopes within the Scope provided in the request.
|
||||
*/
|
||||
async scopeServiceListScopes(requestParameters: ScopeServiceListScopesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1ListScopesResponse> {
|
||||
const response = await this.scopeServiceListScopesRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Rotate all keys in a Scope.
|
||||
*/
|
||||
async scopeServiceRotateKeysRaw(requestParameters: ScopeServiceRotateKeysRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>> {
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling scopeServiceRotateKeys().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/scopes:rotate-keys`,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1RotateKeysRequestToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse<any>(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rotate all keys in a Scope.
|
||||
*/
|
||||
async scopeServiceRotateKeys(requestParameters: ScopeServiceRotateKeysRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object> {
|
||||
const response = await this.scopeServiceRotateKeysRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a Scope.
|
||||
*/
|
||||
async scopeServiceUpdateScopeRaw(requestParameters: ScopeServiceUpdateScopeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesScopesV1Scope>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling scopeServiceUpdateScope().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling scopeServiceUpdateScope().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/scopes/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'PATCH',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesScopesV1ScopeToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesScopesV1ScopeFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a Scope.
|
||||
*/
|
||||
async scopeServiceUpdateScope(requestParameters: ScopeServiceUpdateScopeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesScopesV1Scope> {
|
||||
const response = await this.scopeServiceUpdateScopeRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,258 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Boundary controller HTTP API
|
||||
* Welcome to the Boundary controller HTTP API documentation. This page provides a reference guide for using the Boundary controller API, a JSON-based HTTP API. The API implements commonly seen HTTP API patterns for status codes, paths, and errors. See the [API overview](https://developer.hashicorp.com/boundary/docs/api-clients/api) for more information. Before you read this page, it is useful to understand Boundary\'s [domain model](https://developer.hashicorp.com/boundary/docs/concepts/domain-model) and to be aware of the terminology used here. To get started, search for the service you want to interact with in the sidebar to the left. Each resource in Boundary, such as accounts and credential stores, has its own service. Each service contains all the API endpoints for the resource. ## Status codes - `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it follows well-understood semantics for those status codes. - `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which returns a `404` as discussed below. - `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource returns a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action. - `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action. - `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist returns a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it\'s tolerable as it allows for far simpler and more robust client implementation. - `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource. - `429`: Boundary returns a `429` if any of the API rate limit quotas have been exhausted for the resource and action. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. - `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error is logged to Boundary\'s server log but is not generally provided to the client. - `503`: Boundary returns a `503` if it is unable to store a quota due to the API rate limit being exceeded. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. ## List pagination Boundary uses [API pagination](https://developer.hashicorp.com/boundary/docs/api-clients/api/pagination) to support searching and filtering large lists of results efficiently.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.19.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
ControllerApiResourcesSessionrecordingsV1SessionRecording,
|
||||
ControllerApiServicesV1ListSessionRecordingsResponse,
|
||||
ControllerApiV1Error,
|
||||
} from '../models/index';
|
||||
import {
|
||||
ControllerApiResourcesSessionrecordingsV1SessionRecordingFromJSON,
|
||||
ControllerApiResourcesSessionrecordingsV1SessionRecordingToJSON,
|
||||
ControllerApiServicesV1ListSessionRecordingsResponseFromJSON,
|
||||
ControllerApiServicesV1ListSessionRecordingsResponseToJSON,
|
||||
ControllerApiV1ErrorFromJSON,
|
||||
ControllerApiV1ErrorToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface SessionRecordingServiceDeleteSessionRecordingRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface SessionRecordingServiceDownloadRequest {
|
||||
id: string;
|
||||
mimeType?: string;
|
||||
}
|
||||
|
||||
export interface SessionRecordingServiceGetSessionRecordingRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface SessionRecordingServiceListSessionRecordingsRequest {
|
||||
scopeId?: string;
|
||||
recursive?: boolean;
|
||||
listToken?: string;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface SessionRecordingServiceReApplyStoragePolicyRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class SessionRecordingServiceApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Deletes a Session Recording
|
||||
*/
|
||||
async sessionRecordingServiceDeleteSessionRecordingRaw(requestParameters: SessionRecordingServiceDeleteSessionRecordingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling sessionRecordingServiceDeleteSessionRecording().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/session-recordings/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse<any>(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a Session Recording
|
||||
*/
|
||||
async sessionRecordingServiceDeleteSessionRecording(requestParameters: SessionRecordingServiceDeleteSessionRecordingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object> {
|
||||
const response = await this.sessionRecordingServiceDeleteSessionRecordingRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Download returns the contents of the specified resource in the specified mime type. Supports both Session ID and Session recording ID for looking up a Session recording. Supports both Connection ID and Connection recording ID to look up a Connection recording. A Channel recording ID is required to look up a Channel recording. The only supported mime type is \"application/x-asciicast\".
|
||||
*/
|
||||
async sessionRecordingServiceDownloadRaw(requestParameters: SessionRecordingServiceDownloadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling sessionRecordingServiceDownload().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['mimeType'] != null) {
|
||||
queryParameters['mime_type'] = requestParameters['mimeType'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/session-recordings/{id}:download`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.BlobApiResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Download returns the contents of the specified resource in the specified mime type. Supports both Session ID and Session recording ID for looking up a Session recording. Supports both Connection ID and Connection recording ID to look up a Connection recording. A Channel recording ID is required to look up a Channel recording. The only supported mime type is \"application/x-asciicast\".
|
||||
*/
|
||||
async sessionRecordingServiceDownload(requestParameters: SessionRecordingServiceDownloadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob> {
|
||||
const response = await this.sessionRecordingServiceDownloadRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* GetSessionRecording returns a stored Session recording if present. The provided request must include the Session recording ID for the Session recording being retrieved, or the ID of the Session that was recorded. If that ID is missing, malformed or reference a non existing resource, an error is returned.
|
||||
*/
|
||||
async sessionRecordingServiceGetSessionRecordingRaw(requestParameters: SessionRecordingServiceGetSessionRecordingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesSessionrecordingsV1SessionRecording>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling sessionRecordingServiceGetSessionRecording().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/session-recordings/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesSessionrecordingsV1SessionRecordingFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* GetSessionRecording returns a stored Session recording if present. The provided request must include the Session recording ID for the Session recording being retrieved, or the ID of the Session that was recorded. If that ID is missing, malformed or reference a non existing resource, an error is returned.
|
||||
*/
|
||||
async sessionRecordingServiceGetSessionRecording(requestParameters: SessionRecordingServiceGetSessionRecordingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesSessionrecordingsV1SessionRecording> {
|
||||
const response = await this.sessionRecordingServiceGetSessionRecordingRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* ListSessionRecordings lists all Session recordings. Session recordings are ordered by start_time descending (most recently started first).
|
||||
*/
|
||||
async sessionRecordingServiceListSessionRecordingsRaw(requestParameters: SessionRecordingServiceListSessionRecordingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1ListSessionRecordingsResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['scopeId'] != null) {
|
||||
queryParameters['scope_id'] = requestParameters['scopeId'];
|
||||
}
|
||||
|
||||
if (requestParameters['recursive'] != null) {
|
||||
queryParameters['recursive'] = requestParameters['recursive'];
|
||||
}
|
||||
|
||||
if (requestParameters['listToken'] != null) {
|
||||
queryParameters['list_token'] = requestParameters['listToken'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['page_size'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/session-recordings`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1ListSessionRecordingsResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* ListSessionRecordings lists all Session recordings. Session recordings are ordered by start_time descending (most recently started first).
|
||||
*/
|
||||
async sessionRecordingServiceListSessionRecordings(requestParameters: SessionRecordingServiceListSessionRecordingsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1ListSessionRecordingsResponse> {
|
||||
const response = await this.sessionRecordingServiceListSessionRecordingsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* ReApplyStoragePolicy will recalculate the resultant set of policy and apply the result to the given session recording.
|
||||
*/
|
||||
async sessionRecordingServiceReApplyStoragePolicyRaw(requestParameters: SessionRecordingServiceReApplyStoragePolicyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesSessionrecordingsV1SessionRecording>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling sessionRecordingServiceReApplyStoragePolicy().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/session-recordings/{id}:reapply-storage-policy`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesSessionrecordingsV1SessionRecordingFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* ReApplyStoragePolicy will recalculate the resultant set of policy and apply the result to the given session recording.
|
||||
*/
|
||||
async sessionRecordingServiceReApplyStoragePolicy(requestParameters: SessionRecordingServiceReApplyStoragePolicyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesSessionrecordingsV1SessionRecording> {
|
||||
const response = await this.sessionRecordingServiceReApplyStoragePolicyRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Boundary controller HTTP API
|
||||
* Welcome to the Boundary controller HTTP API documentation. This page provides a reference guide for using the Boundary controller API, a JSON-based HTTP API. The API implements commonly seen HTTP API patterns for status codes, paths, and errors. See the [API overview](https://developer.hashicorp.com/boundary/docs/api-clients/api) for more information. Before you read this page, it is useful to understand Boundary\'s [domain model](https://developer.hashicorp.com/boundary/docs/concepts/domain-model) and to be aware of the terminology used here. To get started, search for the service you want to interact with in the sidebar to the left. Each resource in Boundary, such as accounts and credential stores, has its own service. Each service contains all the API endpoints for the resource. ## Status codes - `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it follows well-understood semantics for those status codes. - `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which returns a `404` as discussed below. - `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource returns a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action. - `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action. - `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist returns a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it\'s tolerable as it allows for far simpler and more robust client implementation. - `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource. - `429`: Boundary returns a `429` if any of the API rate limit quotas have been exhausted for the resource and action. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. - `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error is logged to Boundary\'s server log but is not generally provided to the client. - `503`: Boundary returns a `503` if it is unable to store a quota due to the API rate limit being exceeded. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. ## List pagination Boundary uses [API pagination](https://developer.hashicorp.com/boundary/docs/api-clients/api/pagination) to support searching and filtering large lists of results efficiently.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.19.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
ControllerApiResourcesSessionsV1Session,
|
||||
ControllerApiServicesV1ListSessionsResponse,
|
||||
ControllerApiServicesV1SessionServiceCancelSessionBody,
|
||||
ControllerApiV1Error,
|
||||
} from '../models/index';
|
||||
import {
|
||||
ControllerApiResourcesSessionsV1SessionFromJSON,
|
||||
ControllerApiResourcesSessionsV1SessionToJSON,
|
||||
ControllerApiServicesV1ListSessionsResponseFromJSON,
|
||||
ControllerApiServicesV1ListSessionsResponseToJSON,
|
||||
ControllerApiServicesV1SessionServiceCancelSessionBodyFromJSON,
|
||||
ControllerApiServicesV1SessionServiceCancelSessionBodyToJSON,
|
||||
ControllerApiV1ErrorFromJSON,
|
||||
ControllerApiV1ErrorToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface SessionServiceCancelSessionRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1SessionServiceCancelSessionBody;
|
||||
}
|
||||
|
||||
export interface SessionServiceGetSessionRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface SessionServiceListSessionsRequest {
|
||||
scopeId?: string;
|
||||
recursive?: boolean;
|
||||
filter?: string;
|
||||
includeTerminated?: boolean;
|
||||
listToken?: string;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class SessionServiceApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Cancels a Session.
|
||||
*/
|
||||
async sessionServiceCancelSessionRaw(requestParameters: SessionServiceCancelSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesSessionsV1Session>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling sessionServiceCancelSession().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling sessionServiceCancelSession().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/sessions/{id}:cancel`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1SessionServiceCancelSessionBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesSessionsV1SessionFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancels a Session.
|
||||
*/
|
||||
async sessionServiceCancelSession(requestParameters: SessionServiceCancelSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesSessionsV1Session> {
|
||||
const response = await this.sessionServiceCancelSessionRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Session.
|
||||
*/
|
||||
async sessionServiceGetSessionRaw(requestParameters: SessionServiceGetSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesSessionsV1Session>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling sessionServiceGetSession().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/sessions/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesSessionsV1SessionFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Session.
|
||||
*/
|
||||
async sessionServiceGetSession(requestParameters: SessionServiceGetSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesSessionsV1Session> {
|
||||
const response = await this.sessionServiceGetSessionRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Sessions.
|
||||
*/
|
||||
async sessionServiceListSessionsRaw(requestParameters: SessionServiceListSessionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1ListSessionsResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['scopeId'] != null) {
|
||||
queryParameters['scope_id'] = requestParameters['scopeId'];
|
||||
}
|
||||
|
||||
if (requestParameters['recursive'] != null) {
|
||||
queryParameters['recursive'] = requestParameters['recursive'];
|
||||
}
|
||||
|
||||
if (requestParameters['filter'] != null) {
|
||||
queryParameters['filter'] = requestParameters['filter'];
|
||||
}
|
||||
|
||||
if (requestParameters['includeTerminated'] != null) {
|
||||
queryParameters['include_terminated'] = requestParameters['includeTerminated'];
|
||||
}
|
||||
|
||||
if (requestParameters['listToken'] != null) {
|
||||
queryParameters['list_token'] = requestParameters['listToken'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['page_size'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/sessions`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1ListSessionsResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Sessions.
|
||||
*/
|
||||
async sessionServiceListSessions(requestParameters: SessionServiceListSessionsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1ListSessionsResponse> {
|
||||
const response = await this.sessionServiceListSessionsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,277 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Boundary controller HTTP API
|
||||
* Welcome to the Boundary controller HTTP API documentation. This page provides a reference guide for using the Boundary controller API, a JSON-based HTTP API. The API implements commonly seen HTTP API patterns for status codes, paths, and errors. See the [API overview](https://developer.hashicorp.com/boundary/docs/api-clients/api) for more information. Before you read this page, it is useful to understand Boundary\'s [domain model](https://developer.hashicorp.com/boundary/docs/concepts/domain-model) and to be aware of the terminology used here. To get started, search for the service you want to interact with in the sidebar to the left. Each resource in Boundary, such as accounts and credential stores, has its own service. Each service contains all the API endpoints for the resource. ## Status codes - `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it follows well-understood semantics for those status codes. - `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which returns a `404` as discussed below. - `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource returns a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action. - `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action. - `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist returns a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it\'s tolerable as it allows for far simpler and more robust client implementation. - `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource. - `429`: Boundary returns a `429` if any of the API rate limit quotas have been exhausted for the resource and action. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. - `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error is logged to Boundary\'s server log but is not generally provided to the client. - `503`: Boundary returns a `503` if it is unable to store a quota due to the API rate limit being exceeded. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. ## List pagination Boundary uses [API pagination](https://developer.hashicorp.com/boundary/docs/api-clients/api/pagination) to support searching and filtering large lists of results efficiently.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.19.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
ControllerApiResourcesStoragebucketsV1StorageBucket,
|
||||
ControllerApiServicesV1ListStorageBucketsResponse,
|
||||
ControllerApiV1Error,
|
||||
} from '../models/index';
|
||||
import {
|
||||
ControllerApiResourcesStoragebucketsV1StorageBucketFromJSON,
|
||||
ControllerApiResourcesStoragebucketsV1StorageBucketToJSON,
|
||||
ControllerApiServicesV1ListStorageBucketsResponseFromJSON,
|
||||
ControllerApiServicesV1ListStorageBucketsResponseToJSON,
|
||||
ControllerApiV1ErrorFromJSON,
|
||||
ControllerApiV1ErrorToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface StorageBucketServiceCreateStorageBucketRequest {
|
||||
item: Omit<ControllerApiResourcesStoragebucketsV1StorageBucket, 'id'|'created_time'|'updated_time'|'secrets_hmac'|'authorized_actions'>;
|
||||
pluginName?: string;
|
||||
}
|
||||
|
||||
export interface StorageBucketServiceDeleteStorageBucketRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface StorageBucketServiceGetStorageBucketRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface StorageBucketServiceListStorageBucketsRequest {
|
||||
scopeId?: string;
|
||||
recursive?: boolean;
|
||||
filter?: string;
|
||||
listToken?: string;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface StorageBucketServiceUpdateStorageBucketRequest {
|
||||
id: string;
|
||||
item: Omit<ControllerApiResourcesStoragebucketsV1StorageBucket, 'id'|'created_time'|'updated_time'|'secrets_hmac'|'authorized_actions'>;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class StorageBucketServiceApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Creates a Storage Bucket
|
||||
*/
|
||||
async storageBucketServiceCreateStorageBucketRaw(requestParameters: StorageBucketServiceCreateStorageBucketRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesStoragebucketsV1StorageBucket>> {
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling storageBucketServiceCreateStorageBucket().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['pluginName'] != null) {
|
||||
queryParameters['plugin_name'] = requestParameters['pluginName'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/storage-buckets`,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesStoragebucketsV1StorageBucketToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesStoragebucketsV1StorageBucketFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a Storage Bucket
|
||||
*/
|
||||
async storageBucketServiceCreateStorageBucket(requestParameters: StorageBucketServiceCreateStorageBucketRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesStoragebucketsV1StorageBucket> {
|
||||
const response = await this.storageBucketServiceCreateStorageBucketRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a Storage Bucket
|
||||
*/
|
||||
async storageBucketServiceDeleteStorageBucketRaw(requestParameters: StorageBucketServiceDeleteStorageBucketRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling storageBucketServiceDeleteStorageBucket().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/storage-buckets/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse<any>(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a Storage Bucket
|
||||
*/
|
||||
async storageBucketServiceDeleteStorageBucket(requestParameters: StorageBucketServiceDeleteStorageBucketRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object> {
|
||||
const response = await this.storageBucketServiceDeleteStorageBucketRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Storage Bucket.
|
||||
*/
|
||||
async storageBucketServiceGetStorageBucketRaw(requestParameters: StorageBucketServiceGetStorageBucketRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesStoragebucketsV1StorageBucket>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling storageBucketServiceGetStorageBucket().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/storage-buckets/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesStoragebucketsV1StorageBucketFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Storage Bucket.
|
||||
*/
|
||||
async storageBucketServiceGetStorageBucket(requestParameters: StorageBucketServiceGetStorageBucketRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesStoragebucketsV1StorageBucket> {
|
||||
const response = await this.storageBucketServiceGetStorageBucketRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a list of Storage Buckets.
|
||||
*/
|
||||
async storageBucketServiceListStorageBucketsRaw(requestParameters: StorageBucketServiceListStorageBucketsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1ListStorageBucketsResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['scopeId'] != null) {
|
||||
queryParameters['scope_id'] = requestParameters['scopeId'];
|
||||
}
|
||||
|
||||
if (requestParameters['recursive'] != null) {
|
||||
queryParameters['recursive'] = requestParameters['recursive'];
|
||||
}
|
||||
|
||||
if (requestParameters['filter'] != null) {
|
||||
queryParameters['filter'] = requestParameters['filter'];
|
||||
}
|
||||
|
||||
if (requestParameters['listToken'] != null) {
|
||||
queryParameters['list_token'] = requestParameters['listToken'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['page_size'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/storage-buckets`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1ListStorageBucketsResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a list of Storage Buckets.
|
||||
*/
|
||||
async storageBucketServiceListStorageBuckets(requestParameters: StorageBucketServiceListStorageBucketsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1ListStorageBucketsResponse> {
|
||||
const response = await this.storageBucketServiceListStorageBucketsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a Storage Bucket
|
||||
*/
|
||||
async storageBucketServiceUpdateStorageBucketRaw(requestParameters: StorageBucketServiceUpdateStorageBucketRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesStoragebucketsV1StorageBucket>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling storageBucketServiceUpdateStorageBucket().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling storageBucketServiceUpdateStorageBucket().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/storage-buckets/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'PATCH',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesStoragebucketsV1StorageBucketToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesStoragebucketsV1StorageBucketFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a Storage Bucket
|
||||
*/
|
||||
async storageBucketServiceUpdateStorageBucket(requestParameters: StorageBucketServiceUpdateStorageBucketRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesStoragebucketsV1StorageBucket> {
|
||||
const response = await this.storageBucketServiceUpdateStorageBucketRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,660 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Boundary controller HTTP API
|
||||
* Welcome to the Boundary controller HTTP API documentation. This page provides a reference guide for using the Boundary controller API, a JSON-based HTTP API. The API implements commonly seen HTTP API patterns for status codes, paths, and errors. See the [API overview](https://developer.hashicorp.com/boundary/docs/api-clients/api) for more information. Before you read this page, it is useful to understand Boundary\'s [domain model](https://developer.hashicorp.com/boundary/docs/concepts/domain-model) and to be aware of the terminology used here. To get started, search for the service you want to interact with in the sidebar to the left. Each resource in Boundary, such as accounts and credential stores, has its own service. Each service contains all the API endpoints for the resource. ## Status codes - `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it follows well-understood semantics for those status codes. - `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which returns a `404` as discussed below. - `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource returns a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action. - `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action. - `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist returns a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it\'s tolerable as it allows for far simpler and more robust client implementation. - `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource. - `429`: Boundary returns a `429` if any of the API rate limit quotas have been exhausted for the resource and action. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. - `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error is logged to Boundary\'s server log but is not generally provided to the client. - `503`: Boundary returns a `503` if it is unable to store a quota due to the API rate limit being exceeded. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. ## List pagination Boundary uses [API pagination](https://developer.hashicorp.com/boundary/docs/api-clients/api/pagination) to support searching and filtering large lists of results efficiently.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.19.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
ControllerApiResourcesTargetsV1SessionAuthorization,
|
||||
ControllerApiResourcesTargetsV1Target,
|
||||
ControllerApiServicesV1ListTargetsResponse,
|
||||
ControllerApiServicesV1TargetServiceAddTargetCredentialSourcesBody,
|
||||
ControllerApiServicesV1TargetServiceAddTargetHostSourcesBody,
|
||||
ControllerApiServicesV1TargetServiceAuthorizeSessionBody,
|
||||
ControllerApiServicesV1TargetServiceRemoveTargetCredentialSourcesBody,
|
||||
ControllerApiServicesV1TargetServiceRemoveTargetHostSourcesBody,
|
||||
ControllerApiServicesV1TargetServiceSetTargetCredentialSourcesBody,
|
||||
ControllerApiServicesV1TargetServiceSetTargetHostSourcesBody,
|
||||
ControllerApiV1Error,
|
||||
} from '../models/index';
|
||||
import {
|
||||
ControllerApiResourcesTargetsV1SessionAuthorizationFromJSON,
|
||||
ControllerApiResourcesTargetsV1SessionAuthorizationToJSON,
|
||||
ControllerApiResourcesTargetsV1TargetFromJSON,
|
||||
ControllerApiResourcesTargetsV1TargetToJSON,
|
||||
ControllerApiServicesV1ListTargetsResponseFromJSON,
|
||||
ControllerApiServicesV1ListTargetsResponseToJSON,
|
||||
ControllerApiServicesV1TargetServiceAddTargetCredentialSourcesBodyFromJSON,
|
||||
ControllerApiServicesV1TargetServiceAddTargetCredentialSourcesBodyToJSON,
|
||||
ControllerApiServicesV1TargetServiceAddTargetHostSourcesBodyFromJSON,
|
||||
ControllerApiServicesV1TargetServiceAddTargetHostSourcesBodyToJSON,
|
||||
ControllerApiServicesV1TargetServiceAuthorizeSessionBodyFromJSON,
|
||||
ControllerApiServicesV1TargetServiceAuthorizeSessionBodyToJSON,
|
||||
ControllerApiServicesV1TargetServiceRemoveTargetCredentialSourcesBodyFromJSON,
|
||||
ControllerApiServicesV1TargetServiceRemoveTargetCredentialSourcesBodyToJSON,
|
||||
ControllerApiServicesV1TargetServiceRemoveTargetHostSourcesBodyFromJSON,
|
||||
ControllerApiServicesV1TargetServiceRemoveTargetHostSourcesBodyToJSON,
|
||||
ControllerApiServicesV1TargetServiceSetTargetCredentialSourcesBodyFromJSON,
|
||||
ControllerApiServicesV1TargetServiceSetTargetCredentialSourcesBodyToJSON,
|
||||
ControllerApiServicesV1TargetServiceSetTargetHostSourcesBodyFromJSON,
|
||||
ControllerApiServicesV1TargetServiceSetTargetHostSourcesBodyToJSON,
|
||||
ControllerApiV1ErrorFromJSON,
|
||||
ControllerApiV1ErrorToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface TargetServiceAddTargetCredentialSourcesRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1TargetServiceAddTargetCredentialSourcesBody;
|
||||
}
|
||||
|
||||
export interface TargetServiceAddTargetHostSourcesRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1TargetServiceAddTargetHostSourcesBody;
|
||||
}
|
||||
|
||||
export interface TargetServiceAuthorizeSessionRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1TargetServiceAuthorizeSessionBody;
|
||||
}
|
||||
|
||||
export interface TargetServiceCreateTargetRequest {
|
||||
item: Omit<ControllerApiResourcesTargetsV1Target, 'id'|'created_time'|'updated_time'|'host_source_ids'|'host_sources'|'brokered_credential_source_ids'|'brokered_credential_sources'|'injected_application_credential_source_ids'|'injected_application_credential_sources'|'authorized_actions'|'aliases'>;
|
||||
}
|
||||
|
||||
export interface TargetServiceDeleteTargetRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface TargetServiceGetTargetRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface TargetServiceListTargetsRequest {
|
||||
scopeId?: string;
|
||||
recursive?: boolean;
|
||||
filter?: string;
|
||||
listToken?: string;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface TargetServiceRemoveTargetCredentialSourcesRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1TargetServiceRemoveTargetCredentialSourcesBody;
|
||||
}
|
||||
|
||||
export interface TargetServiceRemoveTargetHostSourcesRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1TargetServiceRemoveTargetHostSourcesBody;
|
||||
}
|
||||
|
||||
export interface TargetServiceSetTargetCredentialSourcesRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1TargetServiceSetTargetCredentialSourcesBody;
|
||||
}
|
||||
|
||||
export interface TargetServiceSetTargetHostSourcesRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1TargetServiceSetTargetHostSourcesBody;
|
||||
}
|
||||
|
||||
export interface TargetServiceUpdateTargetRequest {
|
||||
id: string;
|
||||
item: Omit<ControllerApiResourcesTargetsV1Target, 'id'|'created_time'|'updated_time'|'host_source_ids'|'host_sources'|'brokered_credential_source_ids'|'brokered_credential_sources'|'injected_application_credential_source_ids'|'injected_application_credential_sources'|'authorized_actions'|'aliases'>;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class TargetServiceApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Adds existing Credential Sources to a Target.
|
||||
*/
|
||||
async targetServiceAddTargetCredentialSourcesRaw(requestParameters: TargetServiceAddTargetCredentialSourcesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesTargetsV1Target>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling targetServiceAddTargetCredentialSources().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling targetServiceAddTargetCredentialSources().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/targets/{id}:add-credential-sources`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1TargetServiceAddTargetCredentialSourcesBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesTargetsV1TargetFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds existing Credential Sources to a Target.
|
||||
*/
|
||||
async targetServiceAddTargetCredentialSources(requestParameters: TargetServiceAddTargetCredentialSourcesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesTargetsV1Target> {
|
||||
const response = await this.targetServiceAddTargetCredentialSourcesRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds existing Host Sources to a Target. Cannot be used on targets that have their address field set.
|
||||
*/
|
||||
async targetServiceAddTargetHostSourcesRaw(requestParameters: TargetServiceAddTargetHostSourcesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesTargetsV1Target>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling targetServiceAddTargetHostSources().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling targetServiceAddTargetHostSources().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/targets/{id}:add-host-sources`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1TargetServiceAddTargetHostSourcesBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesTargetsV1TargetFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds existing Host Sources to a Target. Cannot be used on targets that have their address field set.
|
||||
*/
|
||||
async targetServiceAddTargetHostSources(requestParameters: TargetServiceAddTargetHostSourcesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesTargetsV1Target> {
|
||||
const response = await this.targetServiceAddTargetHostSourcesRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Authorizes a Session.
|
||||
*/
|
||||
async targetServiceAuthorizeSessionRaw(requestParameters: TargetServiceAuthorizeSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesTargetsV1SessionAuthorization>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling targetServiceAuthorizeSession().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling targetServiceAuthorizeSession().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/targets/{id}:authorize-session`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1TargetServiceAuthorizeSessionBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesTargetsV1SessionAuthorizationFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Authorizes a Session.
|
||||
*/
|
||||
async targetServiceAuthorizeSession(requestParameters: TargetServiceAuthorizeSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesTargetsV1SessionAuthorization> {
|
||||
const response = await this.targetServiceAuthorizeSessionRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single Target.
|
||||
*/
|
||||
async targetServiceCreateTargetRaw(requestParameters: TargetServiceCreateTargetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesTargetsV1Target>> {
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling targetServiceCreateTarget().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/targets`,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesTargetsV1TargetToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesTargetsV1TargetFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single Target.
|
||||
*/
|
||||
async targetServiceCreateTarget(requestParameters: TargetServiceCreateTargetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesTargetsV1Target> {
|
||||
const response = await this.targetServiceCreateTargetRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a Target.
|
||||
*/
|
||||
async targetServiceDeleteTargetRaw(requestParameters: TargetServiceDeleteTargetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling targetServiceDeleteTarget().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/targets/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse<any>(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a Target.
|
||||
*/
|
||||
async targetServiceDeleteTarget(requestParameters: TargetServiceDeleteTargetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object> {
|
||||
const response = await this.targetServiceDeleteTargetRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Target.
|
||||
*/
|
||||
async targetServiceGetTargetRaw(requestParameters: TargetServiceGetTargetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesTargetsV1Target>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling targetServiceGetTarget().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/targets/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesTargetsV1TargetFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Target.
|
||||
*/
|
||||
async targetServiceGetTarget(requestParameters: TargetServiceGetTargetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesTargetsV1Target> {
|
||||
const response = await this.targetServiceGetTargetRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Targets.
|
||||
*/
|
||||
async targetServiceListTargetsRaw(requestParameters: TargetServiceListTargetsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1ListTargetsResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['scopeId'] != null) {
|
||||
queryParameters['scope_id'] = requestParameters['scopeId'];
|
||||
}
|
||||
|
||||
if (requestParameters['recursive'] != null) {
|
||||
queryParameters['recursive'] = requestParameters['recursive'];
|
||||
}
|
||||
|
||||
if (requestParameters['filter'] != null) {
|
||||
queryParameters['filter'] = requestParameters['filter'];
|
||||
}
|
||||
|
||||
if (requestParameters['listToken'] != null) {
|
||||
queryParameters['list_token'] = requestParameters['listToken'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['page_size'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/targets`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1ListTargetsResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Targets.
|
||||
*/
|
||||
async targetServiceListTargets(requestParameters: TargetServiceListTargetsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1ListTargetsResponse> {
|
||||
const response = await this.targetServiceListTargetsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes Credential Sources from the Target.
|
||||
*/
|
||||
async targetServiceRemoveTargetCredentialSourcesRaw(requestParameters: TargetServiceRemoveTargetCredentialSourcesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesTargetsV1Target>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling targetServiceRemoveTargetCredentialSources().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling targetServiceRemoveTargetCredentialSources().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/targets/{id}:remove-credential-sources`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1TargetServiceRemoveTargetCredentialSourcesBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesTargetsV1TargetFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes Credential Sources from the Target.
|
||||
*/
|
||||
async targetServiceRemoveTargetCredentialSources(requestParameters: TargetServiceRemoveTargetCredentialSourcesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesTargetsV1Target> {
|
||||
const response = await this.targetServiceRemoveTargetCredentialSourcesRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes Host Sources from the Target.
|
||||
*/
|
||||
async targetServiceRemoveTargetHostSourcesRaw(requestParameters: TargetServiceRemoveTargetHostSourcesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesTargetsV1Target>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling targetServiceRemoveTargetHostSources().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling targetServiceRemoveTargetHostSources().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/targets/{id}:remove-host-sources`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1TargetServiceRemoveTargetHostSourcesBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesTargetsV1TargetFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes Host Sources from the Target.
|
||||
*/
|
||||
async targetServiceRemoveTargetHostSources(requestParameters: TargetServiceRemoveTargetHostSourcesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesTargetsV1Target> {
|
||||
const response = await this.targetServiceRemoveTargetHostSourcesRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Credential Sources on the Target.
|
||||
*/
|
||||
async targetServiceSetTargetCredentialSourcesRaw(requestParameters: TargetServiceSetTargetCredentialSourcesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesTargetsV1Target>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling targetServiceSetTargetCredentialSources().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling targetServiceSetTargetCredentialSources().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/targets/{id}:set-credential-sources`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1TargetServiceSetTargetCredentialSourcesBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesTargetsV1TargetFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Credential Sources on the Target.
|
||||
*/
|
||||
async targetServiceSetTargetCredentialSources(requestParameters: TargetServiceSetTargetCredentialSourcesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesTargetsV1Target> {
|
||||
const response = await this.targetServiceSetTargetCredentialSourcesRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sources the Host Sources on the Target. Cannot be used on targets that have their address field set.
|
||||
*/
|
||||
async targetServiceSetTargetHostSourcesRaw(requestParameters: TargetServiceSetTargetHostSourcesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesTargetsV1Target>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling targetServiceSetTargetHostSources().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling targetServiceSetTargetHostSources().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/targets/{id}:set-host-sources`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1TargetServiceSetTargetHostSourcesBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesTargetsV1TargetFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sources the Host Sources on the Target. Cannot be used on targets that have their address field set.
|
||||
*/
|
||||
async targetServiceSetTargetHostSources(requestParameters: TargetServiceSetTargetHostSourcesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesTargetsV1Target> {
|
||||
const response = await this.targetServiceSetTargetHostSourcesRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a Target.
|
||||
*/
|
||||
async targetServiceUpdateTargetRaw(requestParameters: TargetServiceUpdateTargetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesTargetsV1Target>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling targetServiceUpdateTarget().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling targetServiceUpdateTarget().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/targets/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'PATCH',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesTargetsV1TargetToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesTargetsV1TargetFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a Target.
|
||||
*/
|
||||
async targetServiceUpdateTarget(requestParameters: TargetServiceUpdateTargetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesTargetsV1Target> {
|
||||
const response = await this.targetServiceUpdateTargetRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,491 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Boundary controller HTTP API
|
||||
* Welcome to the Boundary controller HTTP API documentation. This page provides a reference guide for using the Boundary controller API, a JSON-based HTTP API. The API implements commonly seen HTTP API patterns for status codes, paths, and errors. See the [API overview](https://developer.hashicorp.com/boundary/docs/api-clients/api) for more information. Before you read this page, it is useful to understand Boundary\'s [domain model](https://developer.hashicorp.com/boundary/docs/concepts/domain-model) and to be aware of the terminology used here. To get started, search for the service you want to interact with in the sidebar to the left. Each resource in Boundary, such as accounts and credential stores, has its own service. Each service contains all the API endpoints for the resource. ## Status codes - `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it follows well-understood semantics for those status codes. - `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which returns a `404` as discussed below. - `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource returns a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action. - `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action. - `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist returns a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it\'s tolerable as it allows for far simpler and more robust client implementation. - `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource. - `429`: Boundary returns a `429` if any of the API rate limit quotas have been exhausted for the resource and action. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. - `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error is logged to Boundary\'s server log but is not generally provided to the client. - `503`: Boundary returns a `503` if it is unable to store a quota due to the API rate limit being exceeded. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. ## List pagination Boundary uses [API pagination](https://developer.hashicorp.com/boundary/docs/api-clients/api/pagination) to support searching and filtering large lists of results efficiently.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.19.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
ControllerApiResourcesUsersV1User,
|
||||
ControllerApiServicesV1ListResolvableAliasesResponse,
|
||||
ControllerApiServicesV1ListUsersResponse,
|
||||
ControllerApiServicesV1UserServiceAddUserAccountsBody,
|
||||
ControllerApiServicesV1UserServiceRemoveUserAccountsBody,
|
||||
ControllerApiServicesV1UserServiceSetUserAccountsBody,
|
||||
ControllerApiV1Error,
|
||||
} from '../models/index';
|
||||
import {
|
||||
ControllerApiResourcesUsersV1UserFromJSON,
|
||||
ControllerApiResourcesUsersV1UserToJSON,
|
||||
ControllerApiServicesV1ListResolvableAliasesResponseFromJSON,
|
||||
ControllerApiServicesV1ListResolvableAliasesResponseToJSON,
|
||||
ControllerApiServicesV1ListUsersResponseFromJSON,
|
||||
ControllerApiServicesV1ListUsersResponseToJSON,
|
||||
ControllerApiServicesV1UserServiceAddUserAccountsBodyFromJSON,
|
||||
ControllerApiServicesV1UserServiceAddUserAccountsBodyToJSON,
|
||||
ControllerApiServicesV1UserServiceRemoveUserAccountsBodyFromJSON,
|
||||
ControllerApiServicesV1UserServiceRemoveUserAccountsBodyToJSON,
|
||||
ControllerApiServicesV1UserServiceSetUserAccountsBodyFromJSON,
|
||||
ControllerApiServicesV1UserServiceSetUserAccountsBodyToJSON,
|
||||
ControllerApiV1ErrorFromJSON,
|
||||
ControllerApiV1ErrorToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface UserServiceAddUserAccountsRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1UserServiceAddUserAccountsBody;
|
||||
}
|
||||
|
||||
export interface UserServiceCreateUserRequest {
|
||||
item: Omit<ControllerApiResourcesUsersV1User, 'id'|'created_time'|'updated_time'|'account_ids'|'accounts'|'authorized_actions'|'login_name'|'full_name'|'email'|'primary_account_id'>;
|
||||
}
|
||||
|
||||
export interface UserServiceDeleteUserRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface UserServiceGetUserRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface UserServiceListResolvableAliasesRequest {
|
||||
id: string;
|
||||
listToken?: string;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface UserServiceListUsersRequest {
|
||||
scopeId?: string;
|
||||
recursive?: boolean;
|
||||
filter?: string;
|
||||
listToken?: string;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface UserServiceRemoveUserAccountsRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1UserServiceRemoveUserAccountsBody;
|
||||
}
|
||||
|
||||
export interface UserServiceSetUserAccountsRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1UserServiceSetUserAccountsBody;
|
||||
}
|
||||
|
||||
export interface UserServiceUpdateUserRequest {
|
||||
id: string;
|
||||
item: Omit<ControllerApiResourcesUsersV1User, 'id'|'created_time'|'updated_time'|'account_ids'|'accounts'|'authorized_actions'|'login_name'|'full_name'|'email'|'primary_account_id'>;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class UserServiceApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Associates an Account to a User.
|
||||
*/
|
||||
async userServiceAddUserAccountsRaw(requestParameters: UserServiceAddUserAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesUsersV1User>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling userServiceAddUserAccounts().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling userServiceAddUserAccounts().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/users/{id}:add-accounts`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1UserServiceAddUserAccountsBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesUsersV1UserFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Associates an Account to a User.
|
||||
*/
|
||||
async userServiceAddUserAccounts(requestParameters: UserServiceAddUserAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesUsersV1User> {
|
||||
const response = await this.userServiceAddUserAccountsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single User.
|
||||
*/
|
||||
async userServiceCreateUserRaw(requestParameters: UserServiceCreateUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesUsersV1User>> {
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling userServiceCreateUser().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/users`,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesUsersV1UserToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesUsersV1UserFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single User.
|
||||
*/
|
||||
async userServiceCreateUser(requestParameters: UserServiceCreateUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesUsersV1User> {
|
||||
const response = await this.userServiceCreateUserRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a User.
|
||||
*/
|
||||
async userServiceDeleteUserRaw(requestParameters: UserServiceDeleteUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling userServiceDeleteUser().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/users/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse<any>(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a User.
|
||||
*/
|
||||
async userServiceDeleteUser(requestParameters: UserServiceDeleteUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object> {
|
||||
const response = await this.userServiceDeleteUserRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single User.
|
||||
*/
|
||||
async userServiceGetUserRaw(requestParameters: UserServiceGetUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesUsersV1User>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling userServiceGetUser().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/users/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesUsersV1UserFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single User.
|
||||
*/
|
||||
async userServiceGetUser(requestParameters: UserServiceGetUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesUsersV1User> {
|
||||
const response = await this.userServiceGetUserRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Aliases which point to a resource for which the requester has some permission.
|
||||
*/
|
||||
async userServiceListResolvableAliasesRaw(requestParameters: UserServiceListResolvableAliasesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1ListResolvableAliasesResponse>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling userServiceListResolvableAliases().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['listToken'] != null) {
|
||||
queryParameters['list_token'] = requestParameters['listToken'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['page_size'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/users/{id}:list-resolvable-aliases`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1ListResolvableAliasesResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Aliases which point to a resource for which the requester has some permission.
|
||||
*/
|
||||
async userServiceListResolvableAliases(requestParameters: UserServiceListResolvableAliasesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1ListResolvableAliasesResponse> {
|
||||
const response = await this.userServiceListResolvableAliasesRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Users.
|
||||
*/
|
||||
async userServiceListUsersRaw(requestParameters: UserServiceListUsersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1ListUsersResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['scopeId'] != null) {
|
||||
queryParameters['scope_id'] = requestParameters['scopeId'];
|
||||
}
|
||||
|
||||
if (requestParameters['recursive'] != null) {
|
||||
queryParameters['recursive'] = requestParameters['recursive'];
|
||||
}
|
||||
|
||||
if (requestParameters['filter'] != null) {
|
||||
queryParameters['filter'] = requestParameters['filter'];
|
||||
}
|
||||
|
||||
if (requestParameters['listToken'] != null) {
|
||||
queryParameters['list_token'] = requestParameters['listToken'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['page_size'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/users`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1ListUsersResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Users.
|
||||
*/
|
||||
async userServiceListUsers(requestParameters: UserServiceListUsersRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1ListUsersResponse> {
|
||||
const response = await this.userServiceListUsersRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the specified Accounts from being associated with the provided User.
|
||||
*/
|
||||
async userServiceRemoveUserAccountsRaw(requestParameters: UserServiceRemoveUserAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesUsersV1User>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling userServiceRemoveUserAccounts().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling userServiceRemoveUserAccounts().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/users/{id}:remove-accounts`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1UserServiceRemoveUserAccountsBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesUsersV1UserFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the specified Accounts from being associated with the provided User.
|
||||
*/
|
||||
async userServiceRemoveUserAccounts(requestParameters: UserServiceRemoveUserAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesUsersV1User> {
|
||||
const response = await this.userServiceRemoveUserAccountsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Accounts associated to the User to exactly the list of provided in the request, removing any Accounts that are not specified.
|
||||
*/
|
||||
async userServiceSetUserAccountsRaw(requestParameters: UserServiceSetUserAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesUsersV1User>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling userServiceSetUserAccounts().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling userServiceSetUserAccounts().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/users/{id}:set-accounts`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1UserServiceSetUserAccountsBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesUsersV1UserFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the Accounts associated to the User to exactly the list of provided in the request, removing any Accounts that are not specified.
|
||||
*/
|
||||
async userServiceSetUserAccounts(requestParameters: UserServiceSetUserAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesUsersV1User> {
|
||||
const response = await this.userServiceSetUserAccountsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a User.
|
||||
*/
|
||||
async userServiceUpdateUserRaw(requestParameters: UserServiceUpdateUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesUsersV1User>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling userServiceUpdateUser().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling userServiceUpdateUser().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/users/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'PATCH',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesUsersV1UserToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesUsersV1UserFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a User.
|
||||
*/
|
||||
async userServiceUpdateUser(requestParameters: UserServiceUpdateUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesUsersV1User> {
|
||||
const response = await this.userServiceUpdateUserRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,550 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Boundary controller HTTP API
|
||||
* Welcome to the Boundary controller HTTP API documentation. This page provides a reference guide for using the Boundary controller API, a JSON-based HTTP API. The API implements commonly seen HTTP API patterns for status codes, paths, and errors. See the [API overview](https://developer.hashicorp.com/boundary/docs/api-clients/api) for more information. Before you read this page, it is useful to understand Boundary\'s [domain model](https://developer.hashicorp.com/boundary/docs/concepts/domain-model) and to be aware of the terminology used here. To get started, search for the service you want to interact with in the sidebar to the left. Each resource in Boundary, such as accounts and credential stores, has its own service. Each service contains all the API endpoints for the resource. ## Status codes - `2XX`: Boundary returns a code between `200` and `299` on success. Generally this is `200`, but implementations should be prepared to accept any `2XX` status code as indicating success. If a call returns a `2XX` code that is not `200`, it follows well-understood semantics for those status codes. - `400`: Boundary returns `400` when a command cannot be completed due to invalid user input, except for a properly-formatted identifier that does not map to an existing resource, which returns a `404` as discussed below. - `401`: Boundary returns `401` if no authentication token is provided or if the provided token is invalid. A valid token that simply does not have permission for a resource returns a `403` instead. A token that is invalid or missing, but where the anonymous user (`u_anon`) is able to successfully perform the action, will not return a `401` but instead will return the result of the action. - `403`: Boundary returns `403` if a provided token was valid but does not have the grants required to perform the requested action. - `404`: Boundary returns `404` if a resource cannot be found. Note that this happens _prior_ to authentication/authorization checking in nearly all cases as the resource information (such as its scope, available actions, etc.) is a required part of that check. As a result, an action against a resource that does not exist returns a `404` instead of a `401` or `403`. While this could be considered an information leak, since IDs are randomly generated and this only discloses whether an ID is valid, it\'s tolerable as it allows for far simpler and more robust client implementation. - `405`: Boundary returns a `405` to indicate that the method (HTTP verb or custom action) is not implemented for the given resource. - `429`: Boundary returns a `429` if any of the API rate limit quotas have been exhausted for the resource and action. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. - `500`: Boundary returns `500` if an error occurred that is not (directly) tied to invalid user input. If a `500` is generated, information about the error is logged to Boundary\'s server log but is not generally provided to the client. - `503`: Boundary returns a `503` if it is unable to store a quota due to the API rate limit being exceeded. It includes the `Retry-After` header so that the client knows how long to wait before making a new request. ## List pagination Boundary uses [API pagination](https://developer.hashicorp.com/boundary/docs/api-clients/api/pagination) to support searching and filtering large lists of results efficiently.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.19.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
ControllerApiResourcesWorkersV1CertificateAuthority,
|
||||
ControllerApiResourcesWorkersV1Worker,
|
||||
ControllerApiServicesV1ListWorkersResponse,
|
||||
ControllerApiServicesV1WorkerServiceAddWorkerTagsBody,
|
||||
ControllerApiServicesV1WorkerServiceRemoveWorkerTagsBody,
|
||||
ControllerApiServicesV1WorkerServiceSetWorkerTagsBody,
|
||||
ControllerApiV1Error,
|
||||
} from '../models/index';
|
||||
import {
|
||||
ControllerApiResourcesWorkersV1CertificateAuthorityFromJSON,
|
||||
ControllerApiResourcesWorkersV1CertificateAuthorityToJSON,
|
||||
ControllerApiResourcesWorkersV1WorkerFromJSON,
|
||||
ControllerApiResourcesWorkersV1WorkerToJSON,
|
||||
ControllerApiServicesV1ListWorkersResponseFromJSON,
|
||||
ControllerApiServicesV1ListWorkersResponseToJSON,
|
||||
ControllerApiServicesV1WorkerServiceAddWorkerTagsBodyFromJSON,
|
||||
ControllerApiServicesV1WorkerServiceAddWorkerTagsBodyToJSON,
|
||||
ControllerApiServicesV1WorkerServiceRemoveWorkerTagsBodyFromJSON,
|
||||
ControllerApiServicesV1WorkerServiceRemoveWorkerTagsBodyToJSON,
|
||||
ControllerApiServicesV1WorkerServiceSetWorkerTagsBodyFromJSON,
|
||||
ControllerApiServicesV1WorkerServiceSetWorkerTagsBodyToJSON,
|
||||
ControllerApiV1ErrorFromJSON,
|
||||
ControllerApiV1ErrorToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface WorkerServiceAddWorkerTagsRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1WorkerServiceAddWorkerTagsBody;
|
||||
}
|
||||
|
||||
export interface WorkerServiceCreateControllerLedRequest {
|
||||
item: Omit<ControllerApiResourcesWorkersV1Worker, 'id'|'created_time'|'updated_time'|'address'|'canonical_tags'|'config_tags'|'last_status_time'|'controller_generated_activation_token'|'active_connection_count'|'type'|'api_tags'|'release_version'|'directly_connected_downstream_workers'|'authorized_actions'|'local_storage_state'|'remote_storage_state'>;
|
||||
}
|
||||
|
||||
export interface WorkerServiceCreateWorkerLedRequest {
|
||||
item: Omit<ControllerApiResourcesWorkersV1Worker, 'id'|'created_time'|'updated_time'|'address'|'canonical_tags'|'config_tags'|'last_status_time'|'controller_generated_activation_token'|'active_connection_count'|'type'|'api_tags'|'release_version'|'directly_connected_downstream_workers'|'authorized_actions'|'local_storage_state'|'remote_storage_state'>;
|
||||
}
|
||||
|
||||
export interface WorkerServiceDeleteWorkerRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface WorkerServiceGetWorkerRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface WorkerServiceListWorkersRequest {
|
||||
scopeId?: string;
|
||||
recursive?: boolean;
|
||||
filter?: string;
|
||||
}
|
||||
|
||||
export interface WorkerServiceReadCertificateAuthorityRequest {
|
||||
scopeId?: string;
|
||||
}
|
||||
|
||||
export interface WorkerServiceReinitializeCertificateAuthorityRequest {
|
||||
scopeId?: string;
|
||||
}
|
||||
|
||||
export interface WorkerServiceRemoveWorkerTagsRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1WorkerServiceRemoveWorkerTagsBody;
|
||||
}
|
||||
|
||||
export interface WorkerServiceSetWorkerTagsRequest {
|
||||
id: string;
|
||||
body: ControllerApiServicesV1WorkerServiceSetWorkerTagsBody;
|
||||
}
|
||||
|
||||
export interface WorkerServiceUpdateWorkerRequest {
|
||||
id: string;
|
||||
item: Omit<ControllerApiResourcesWorkersV1Worker, 'id'|'created_time'|'updated_time'|'address'|'canonical_tags'|'config_tags'|'last_status_time'|'controller_generated_activation_token'|'active_connection_count'|'type'|'api_tags'|'release_version'|'directly_connected_downstream_workers'|'authorized_actions'|'local_storage_state'|'remote_storage_state'>;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class WorkerServiceApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Adds api tags to an existing Worker.
|
||||
*/
|
||||
async workerServiceAddWorkerTagsRaw(requestParameters: WorkerServiceAddWorkerTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesWorkersV1Worker>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling workerServiceAddWorkerTags().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling workerServiceAddWorkerTags().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/workers/{id}:add-worker-tags`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1WorkerServiceAddWorkerTagsBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesWorkersV1WorkerFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds api tags to an existing Worker.
|
||||
*/
|
||||
async workerServiceAddWorkerTags(requestParameters: WorkerServiceAddWorkerTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesWorkersV1Worker> {
|
||||
const response = await this.workerServiceAddWorkerTagsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single Worker.
|
||||
*/
|
||||
async workerServiceCreateControllerLedRaw(requestParameters: WorkerServiceCreateControllerLedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesWorkersV1Worker>> {
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling workerServiceCreateControllerLed().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/workers:create:controller-led`,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesWorkersV1WorkerToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesWorkersV1WorkerFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single Worker.
|
||||
*/
|
||||
async workerServiceCreateControllerLed(requestParameters: WorkerServiceCreateControllerLedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesWorkersV1Worker> {
|
||||
const response = await this.workerServiceCreateControllerLedRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single Worker.
|
||||
*/
|
||||
async workerServiceCreateWorkerLedRaw(requestParameters: WorkerServiceCreateWorkerLedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesWorkersV1Worker>> {
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling workerServiceCreateWorkerLed().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/workers:create:worker-led`,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesWorkersV1WorkerToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesWorkersV1WorkerFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a single Worker.
|
||||
*/
|
||||
async workerServiceCreateWorkerLed(requestParameters: WorkerServiceCreateWorkerLedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesWorkersV1Worker> {
|
||||
const response = await this.workerServiceCreateWorkerLedRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a Worker.
|
||||
*/
|
||||
async workerServiceDeleteWorkerRaw(requestParameters: WorkerServiceDeleteWorkerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling workerServiceDeleteWorker().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/workers/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse<any>(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a Worker.
|
||||
*/
|
||||
async workerServiceDeleteWorker(requestParameters: WorkerServiceDeleteWorkerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object> {
|
||||
const response = await this.workerServiceDeleteWorkerRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Worker.
|
||||
*/
|
||||
async workerServiceGetWorkerRaw(requestParameters: WorkerServiceGetWorkerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesWorkersV1Worker>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling workerServiceGetWorker().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/workers/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesWorkersV1WorkerFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a single Worker.
|
||||
*/
|
||||
async workerServiceGetWorker(requestParameters: WorkerServiceGetWorkerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesWorkersV1Worker> {
|
||||
const response = await this.workerServiceGetWorkerRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Workers.
|
||||
*/
|
||||
async workerServiceListWorkersRaw(requestParameters: WorkerServiceListWorkersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiServicesV1ListWorkersResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['scopeId'] != null) {
|
||||
queryParameters['scope_id'] = requestParameters['scopeId'];
|
||||
}
|
||||
|
||||
if (requestParameters['recursive'] != null) {
|
||||
queryParameters['recursive'] = requestParameters['recursive'];
|
||||
}
|
||||
|
||||
if (requestParameters['filter'] != null) {
|
||||
queryParameters['filter'] = requestParameters['filter'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/workers`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiServicesV1ListWorkersResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all Workers.
|
||||
*/
|
||||
async workerServiceListWorkers(requestParameters: WorkerServiceListWorkersRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiServicesV1ListWorkersResponse> {
|
||||
const response = await this.workerServiceListWorkersRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves root certificates used for worker authentication.
|
||||
*/
|
||||
async workerServiceReadCertificateAuthorityRaw(requestParameters: WorkerServiceReadCertificateAuthorityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesWorkersV1CertificateAuthority>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['scopeId'] != null) {
|
||||
queryParameters['scope_id'] = requestParameters['scopeId'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/workers:read-certificate-authority`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesWorkersV1CertificateAuthorityFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves root certificates used for worker authentication.
|
||||
*/
|
||||
async workerServiceReadCertificateAuthority(requestParameters: WorkerServiceReadCertificateAuthorityRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesWorkersV1CertificateAuthority> {
|
||||
const response = await this.workerServiceReadCertificateAuthorityRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reinitializes root certificates used for worker authentication.
|
||||
*/
|
||||
async workerServiceReinitializeCertificateAuthorityRaw(requestParameters: WorkerServiceReinitializeCertificateAuthorityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesWorkersV1CertificateAuthority>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['scopeId'] != null) {
|
||||
queryParameters['scope_id'] = requestParameters['scopeId'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/workers:reinitialize-certificate-authority`,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesWorkersV1CertificateAuthorityFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Reinitializes root certificates used for worker authentication.
|
||||
*/
|
||||
async workerServiceReinitializeCertificateAuthority(requestParameters: WorkerServiceReinitializeCertificateAuthorityRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesWorkersV1CertificateAuthority> {
|
||||
const response = await this.workerServiceReinitializeCertificateAuthorityRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes api tags from an existing Worker.
|
||||
*/
|
||||
async workerServiceRemoveWorkerTagsRaw(requestParameters: WorkerServiceRemoveWorkerTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesWorkersV1Worker>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling workerServiceRemoveWorkerTags().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling workerServiceRemoveWorkerTags().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/workers/{id}:remove-worker-tags`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1WorkerServiceRemoveWorkerTagsBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesWorkersV1WorkerFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes api tags from an existing Worker.
|
||||
*/
|
||||
async workerServiceRemoveWorkerTags(requestParameters: WorkerServiceRemoveWorkerTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesWorkersV1Worker> {
|
||||
const response = await this.workerServiceRemoveWorkerTagsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets api tags for an existing Worker.
|
||||
*/
|
||||
async workerServiceSetWorkerTagsRaw(requestParameters: WorkerServiceSetWorkerTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesWorkersV1Worker>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling workerServiceSetWorkerTags().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['body'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'body',
|
||||
'Required parameter "body" was null or undefined when calling workerServiceSetWorkerTags().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/workers/{id}:set-worker-tags`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiServicesV1WorkerServiceSetWorkerTagsBodyToJSON(requestParameters['body']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesWorkersV1WorkerFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets api tags for an existing Worker.
|
||||
*/
|
||||
async workerServiceSetWorkerTags(requestParameters: WorkerServiceSetWorkerTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesWorkersV1Worker> {
|
||||
const response = await this.workerServiceSetWorkerTagsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a Worker.
|
||||
*/
|
||||
async workerServiceUpdateWorkerRaw(requestParameters: WorkerServiceUpdateWorkerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ControllerApiResourcesWorkersV1Worker>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling workerServiceUpdateWorker().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['item'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'item',
|
||||
'Required parameter "item" was null or undefined when calling workerServiceUpdateWorker().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/v1/workers/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'PATCH',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ControllerApiResourcesWorkersV1WorkerToJSON(requestParameters['item']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ControllerApiResourcesWorkersV1WorkerFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a Worker.
|
||||
*/
|
||||
async workerServiceUpdateWorker(requestParameters: WorkerServiceUpdateWorkerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ControllerApiResourcesWorkersV1Worker> {
|
||||
const response = await this.workerServiceUpdateWorkerRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export * from './AccountServiceApi';
|
||||
export * from './AliasServiceApi';
|
||||
export * from './AuthMethodServiceApi';
|
||||
export * from './AuthTokenServiceApi';
|
||||
export * from './BillingServiceApi';
|
||||
export * from './CredentialLibraryServiceApi';
|
||||
export * from './CredentialServiceApi';
|
||||
export * from './CredentialStoreServiceApi';
|
||||
export * from './GroupServiceApi';
|
||||
export * from './HostCatalogServiceApi';
|
||||
export * from './HostServiceApi';
|
||||
export * from './HostSetServiceApi';
|
||||
export * from './ManagedGroupServiceApi';
|
||||
export * from './PolicyServiceApi';
|
||||
export * from './RoleServiceApi';
|
||||
export * from './ScopeServiceApi';
|
||||
export * from './SessionRecordingServiceApi';
|
||||
export * from './SessionServiceApi';
|
||||
export * from './StorageBucketServiceApi';
|
||||
export * from './TargetServiceApi';
|
||||
export * from './UserServiceApi';
|
||||
export * from './WorkerServiceApi';
|
||||
Reference in new issue
Block a user