@datadog/datadog-api-client
Version:
OpenAPI client for Datadog APIs
358 lines (357 loc) • 16 kB
TypeScript
import { BaseAPIRequestFactory } from "../../datadog-api-client-common/baseapi";
import { Configuration } from "../../datadog-api-client-common/configuration";
import { RequestContext, ResponseContext } from "../../datadog-api-client-common/http/http";
import { ApplicationKeyCreateRequest } from "../models/ApplicationKeyCreateRequest";
import { ApplicationKeyResponse } from "../models/ApplicationKeyResponse";
import { ApplicationKeysSort } from "../models/ApplicationKeysSort";
import { ApplicationKeyUpdateRequest } from "../models/ApplicationKeyUpdateRequest";
import { ListApplicationKeysResponse } from "../models/ListApplicationKeysResponse";
import { ListServiceAccessTokensResponse } from "../models/ListServiceAccessTokensResponse";
import { PartialApplicationKeyResponse } from "../models/PartialApplicationKeyResponse";
import { PersonalAccessTokensSort } from "../models/PersonalAccessTokensSort";
import { ServiceAccessTokenCreateResponse } from "../models/ServiceAccessTokenCreateResponse";
import { ServiceAccessTokenResponse } from "../models/ServiceAccessTokenResponse";
import { ServiceAccountAccessTokenCreateRequest } from "../models/ServiceAccountAccessTokenCreateRequest";
import { ServiceAccountAccessTokenUpdateRequest } from "../models/ServiceAccountAccessTokenUpdateRequest";
import { ServiceAccountCreateRequest } from "../models/ServiceAccountCreateRequest";
import { UserResponse } from "../models/UserResponse";
export declare class ServiceAccountsApiRequestFactory extends BaseAPIRequestFactory {
createServiceAccount(body: ServiceAccountCreateRequest, _options?: Configuration): Promise<RequestContext>;
createServiceAccountAccessToken(serviceAccountId: string, body: ServiceAccountAccessTokenCreateRequest, _options?: Configuration): Promise<RequestContext>;
createServiceAccountApplicationKey(serviceAccountId: string, body: ApplicationKeyCreateRequest, _options?: Configuration): Promise<RequestContext>;
deleteServiceAccountApplicationKey(serviceAccountId: string, appKeyId: string, _options?: Configuration): Promise<RequestContext>;
getServiceAccountAccessToken(serviceAccountId: string, tokenId: string, _options?: Configuration): Promise<RequestContext>;
getServiceAccountApplicationKey(serviceAccountId: string, appKeyId: string, _options?: Configuration): Promise<RequestContext>;
listServiceAccountAccessTokens(serviceAccountId: string, pageSize?: number, pageNumber?: number, sort?: PersonalAccessTokensSort, filter?: string, _options?: Configuration): Promise<RequestContext>;
listServiceAccountApplicationKeys(serviceAccountId: string, pageSize?: number, pageNumber?: number, sort?: ApplicationKeysSort, filter?: string, filterCreatedAtStart?: string, filterCreatedAtEnd?: string, _options?: Configuration): Promise<RequestContext>;
revokeServiceAccountAccessToken(serviceAccountId: string, tokenId: string, _options?: Configuration): Promise<RequestContext>;
updateServiceAccountAccessToken(serviceAccountId: string, tokenId: string, body: ServiceAccountAccessTokenUpdateRequest, _options?: Configuration): Promise<RequestContext>;
updateServiceAccountApplicationKey(serviceAccountId: string, appKeyId: string, body: ApplicationKeyUpdateRequest, _options?: Configuration): Promise<RequestContext>;
}
export declare class ServiceAccountsApiResponseProcessor {
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to createServiceAccount
* @throws ApiException if the response code was not in [200, 299]
*/
createServiceAccount(response: ResponseContext): Promise<UserResponse>;
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to createServiceAccountAccessToken
* @throws ApiException if the response code was not in [200, 299]
*/
createServiceAccountAccessToken(response: ResponseContext): Promise<ServiceAccessTokenCreateResponse>;
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to createServiceAccountApplicationKey
* @throws ApiException if the response code was not in [200, 299]
*/
createServiceAccountApplicationKey(response: ResponseContext): Promise<ApplicationKeyResponse>;
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to deleteServiceAccountApplicationKey
* @throws ApiException if the response code was not in [200, 299]
*/
deleteServiceAccountApplicationKey(response: ResponseContext): Promise<void>;
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to getServiceAccountAccessToken
* @throws ApiException if the response code was not in [200, 299]
*/
getServiceAccountAccessToken(response: ResponseContext): Promise<ServiceAccessTokenResponse>;
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to getServiceAccountApplicationKey
* @throws ApiException if the response code was not in [200, 299]
*/
getServiceAccountApplicationKey(response: ResponseContext): Promise<PartialApplicationKeyResponse>;
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to listServiceAccountAccessTokens
* @throws ApiException if the response code was not in [200, 299]
*/
listServiceAccountAccessTokens(response: ResponseContext): Promise<ListServiceAccessTokensResponse>;
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to listServiceAccountApplicationKeys
* @throws ApiException if the response code was not in [200, 299]
*/
listServiceAccountApplicationKeys(response: ResponseContext): Promise<ListApplicationKeysResponse>;
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to revokeServiceAccountAccessToken
* @throws ApiException if the response code was not in [200, 299]
*/
revokeServiceAccountAccessToken(response: ResponseContext): Promise<void>;
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to updateServiceAccountAccessToken
* @throws ApiException if the response code was not in [200, 299]
*/
updateServiceAccountAccessToken(response: ResponseContext): Promise<ServiceAccessTokenResponse>;
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to updateServiceAccountApplicationKey
* @throws ApiException if the response code was not in [200, 299]
*/
updateServiceAccountApplicationKey(response: ResponseContext): Promise<PartialApplicationKeyResponse>;
}
export interface ServiceAccountsApiCreateServiceAccountRequest {
/**
* @type ServiceAccountCreateRequest
*/
body: ServiceAccountCreateRequest;
}
export interface ServiceAccountsApiCreateServiceAccountAccessTokenRequest {
/**
* The ID of the service account.
* @type string
*/
serviceAccountId: string;
/**
* @type ServiceAccountAccessTokenCreateRequest
*/
body: ServiceAccountAccessTokenCreateRequest;
}
export interface ServiceAccountsApiCreateServiceAccountApplicationKeyRequest {
/**
* The ID of the service account.
* @type string
*/
serviceAccountId: string;
/**
* @type ApplicationKeyCreateRequest
*/
body: ApplicationKeyCreateRequest;
}
export interface ServiceAccountsApiDeleteServiceAccountApplicationKeyRequest {
/**
* The ID of the service account.
* @type string
*/
serviceAccountId: string;
/**
* The ID of the application key.
* @type string
*/
appKeyId: string;
}
export interface ServiceAccountsApiGetServiceAccountAccessTokenRequest {
/**
* The ID of the service account.
* @type string
*/
serviceAccountId: string;
/**
* The ID of the access token.
* @type string
*/
tokenId: string;
}
export interface ServiceAccountsApiGetServiceAccountApplicationKeyRequest {
/**
* The ID of the service account.
* @type string
*/
serviceAccountId: string;
/**
* The ID of the application key.
* @type string
*/
appKeyId: string;
}
export interface ServiceAccountsApiListServiceAccountAccessTokensRequest {
/**
* The ID of the service account.
* @type string
*/
serviceAccountId: string;
/**
* Size for a given page. The maximum allowed value is 100.
* @type number
*/
pageSize?: number;
/**
* Specific page number to return.
* @type number
*/
pageNumber?: number;
/**
* Access token attribute used to sort results. Sort order is ascending
* by default. In order to specify a descending sort, prefix the
* attribute with a minus sign.
* @type PersonalAccessTokensSort
*/
sort?: PersonalAccessTokensSort;
/**
* Filter access tokens by the specified string.
* @type string
*/
filter?: string;
}
export interface ServiceAccountsApiListServiceAccountApplicationKeysRequest {
/**
* The ID of the service account.
* @type string
*/
serviceAccountId: string;
/**
* Size for a given page. The maximum allowed value is 100.
* @type number
*/
pageSize?: number;
/**
* Specific page number to return.
* @type number
*/
pageNumber?: number;
/**
* Application key attribute used to sort results. Sort order is ascending
* by default. In order to specify a descending sort, prefix the
* attribute with a minus sign.
* @type ApplicationKeysSort
*/
sort?: ApplicationKeysSort;
/**
* Filter application keys by the specified string.
* @type string
*/
filter?: string;
/**
* Only include application keys created on or after the specified date.
* @type string
*/
filterCreatedAtStart?: string;
/**
* Only include application keys created on or before the specified date.
* @type string
*/
filterCreatedAtEnd?: string;
}
export interface ServiceAccountsApiRevokeServiceAccountAccessTokenRequest {
/**
* The ID of the service account.
* @type string
*/
serviceAccountId: string;
/**
* The ID of the access token.
* @type string
*/
tokenId: string;
}
export interface ServiceAccountsApiUpdateServiceAccountAccessTokenRequest {
/**
* The ID of the service account.
* @type string
*/
serviceAccountId: string;
/**
* The ID of the access token.
* @type string
*/
tokenId: string;
/**
* @type ServiceAccountAccessTokenUpdateRequest
*/
body: ServiceAccountAccessTokenUpdateRequest;
}
export interface ServiceAccountsApiUpdateServiceAccountApplicationKeyRequest {
/**
* The ID of the service account.
* @type string
*/
serviceAccountId: string;
/**
* The ID of the application key.
* @type string
*/
appKeyId: string;
/**
* @type ApplicationKeyUpdateRequest
*/
body: ApplicationKeyUpdateRequest;
}
export declare class ServiceAccountsApi {
private requestFactory;
private responseProcessor;
private configuration;
constructor(configuration: Configuration, requestFactory?: ServiceAccountsApiRequestFactory, responseProcessor?: ServiceAccountsApiResponseProcessor);
/**
* Create a service account for your organization.
* @param param The request object
*/
createServiceAccount(param: ServiceAccountsApiCreateServiceAccountRequest, options?: Configuration): Promise<UserResponse>;
/**
* Create an access token for a service account.
* @param param The request object
*/
createServiceAccountAccessToken(param: ServiceAccountsApiCreateServiceAccountAccessTokenRequest, options?: Configuration): Promise<ServiceAccessTokenCreateResponse>;
/**
* Create an application key for this service account.
* @param param The request object
*/
createServiceAccountApplicationKey(param: ServiceAccountsApiCreateServiceAccountApplicationKeyRequest, options?: Configuration): Promise<ApplicationKeyResponse>;
/**
* Delete an application key owned by this service account.
* @param param The request object
*/
deleteServiceAccountApplicationKey(param: ServiceAccountsApiDeleteServiceAccountApplicationKeyRequest, options?: Configuration): Promise<void>;
/**
* Get a specific access token for a service account by its ID.
* @param param The request object
*/
getServiceAccountAccessToken(param: ServiceAccountsApiGetServiceAccountAccessTokenRequest, options?: Configuration): Promise<ServiceAccessTokenResponse>;
/**
* Get an application key owned by this service account.
* @param param The request object
*/
getServiceAccountApplicationKey(param: ServiceAccountsApiGetServiceAccountApplicationKeyRequest, options?: Configuration): Promise<PartialApplicationKeyResponse>;
/**
* List all access tokens for a specific service account.
* @param param The request object
*/
listServiceAccountAccessTokens(param: ServiceAccountsApiListServiceAccountAccessTokensRequest, options?: Configuration): Promise<ListServiceAccessTokensResponse>;
/**
* List all application keys available for this service account.
* @param param The request object
*/
listServiceAccountApplicationKeys(param: ServiceAccountsApiListServiceAccountApplicationKeysRequest, options?: Configuration): Promise<ListApplicationKeysResponse>;
/**
* Revoke a specific access token for a service account.
* @param param The request object
*/
revokeServiceAccountAccessToken(param: ServiceAccountsApiRevokeServiceAccountAccessTokenRequest, options?: Configuration): Promise<void>;
/**
* Update a specific access token for a service account.
* @param param The request object
*/
updateServiceAccountAccessToken(param: ServiceAccountsApiUpdateServiceAccountAccessTokenRequest, options?: Configuration): Promise<ServiceAccessTokenResponse>;
/**
* Edit an application key owned by this service account.
* @param param The request object
*/
updateServiceAccountApplicationKey(param: ServiceAccountsApiUpdateServiceAccountApplicationKeyRequest, options?: Configuration): Promise<PartialApplicationKeyResponse>;
}