UNPKG

@datadog/datadog-api-client

Version:
131 lines (130 loc) 6.79 kB
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 { WebhooksAuthMethodProtocol } from "../models/WebhooksAuthMethodProtocol"; import { WebhooksAuthMethodsResponse } from "../models/WebhooksAuthMethodsResponse"; import { WebhooksOAuth2ClientCredentialsCreateRequest } from "../models/WebhooksOAuth2ClientCredentialsCreateRequest"; import { WebhooksOAuth2ClientCredentialsResponse } from "../models/WebhooksOAuth2ClientCredentialsResponse"; import { WebhooksOAuth2ClientCredentialsUpdateRequest } from "../models/WebhooksOAuth2ClientCredentialsUpdateRequest"; export declare class WebhooksIntegrationApiRequestFactory extends BaseAPIRequestFactory { createOAuth2ClientCredentials(body: WebhooksOAuth2ClientCredentialsCreateRequest, _options?: Configuration): Promise<RequestContext>; deleteOAuth2ClientCredentials(authMethodId: string, _options?: Configuration): Promise<RequestContext>; getAllAuthMethods(include?: WebhooksAuthMethodProtocol, _options?: Configuration): Promise<RequestContext>; getOAuth2ClientCredentials(authMethodId: string, _options?: Configuration): Promise<RequestContext>; updateOAuth2ClientCredentials(authMethodId: string, body: WebhooksOAuth2ClientCredentialsUpdateRequest, _options?: Configuration): Promise<RequestContext>; } export declare class WebhooksIntegrationApiResponseProcessor { /** * 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 createOAuth2ClientCredentials * @throws ApiException if the response code was not in [200, 299] */ createOAuth2ClientCredentials(response: ResponseContext): Promise<WebhooksOAuth2ClientCredentialsResponse>; /** * 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 deleteOAuth2ClientCredentials * @throws ApiException if the response code was not in [200, 299] */ deleteOAuth2ClientCredentials(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 getAllAuthMethods * @throws ApiException if the response code was not in [200, 299] */ getAllAuthMethods(response: ResponseContext): Promise<WebhooksAuthMethodsResponse>; /** * 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 getOAuth2ClientCredentials * @throws ApiException if the response code was not in [200, 299] */ getOAuth2ClientCredentials(response: ResponseContext): Promise<WebhooksOAuth2ClientCredentialsResponse>; /** * 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 updateOAuth2ClientCredentials * @throws ApiException if the response code was not in [200, 299] */ updateOAuth2ClientCredentials(response: ResponseContext): Promise<WebhooksOAuth2ClientCredentialsResponse>; } export interface WebhooksIntegrationApiCreateOAuth2ClientCredentialsRequest { /** * OAuth2 client credentials payload. * @type WebhooksOAuth2ClientCredentialsCreateRequest */ body: WebhooksOAuth2ClientCredentialsCreateRequest; } export interface WebhooksIntegrationApiDeleteOAuth2ClientCredentialsRequest { /** * The UUID of the auth method. * @type string */ authMethodId: string; } export interface WebhooksIntegrationApiGetAllAuthMethodsRequest { /** * Comma-separated list of relationships to include in the response. * @type WebhooksAuthMethodProtocol */ include?: WebhooksAuthMethodProtocol; } export interface WebhooksIntegrationApiGetOAuth2ClientCredentialsRequest { /** * The UUID of the auth method. * @type string */ authMethodId: string; } export interface WebhooksIntegrationApiUpdateOAuth2ClientCredentialsRequest { /** * The UUID of the auth method. * @type string */ authMethodId: string; /** * OAuth2 client credentials payload. * @type WebhooksOAuth2ClientCredentialsUpdateRequest */ body: WebhooksOAuth2ClientCredentialsUpdateRequest; } export declare class WebhooksIntegrationApi { private requestFactory; private responseProcessor; private configuration; constructor(configuration: Configuration, requestFactory?: WebhooksIntegrationApiRequestFactory, responseProcessor?: WebhooksIntegrationApiResponseProcessor); /** * Create a new OAuth2 client credentials auth method for the Webhooks * integration. The `client_secret` is stored securely and never returned. * @param param The request object */ createOAuth2ClientCredentials(param: WebhooksIntegrationApiCreateOAuth2ClientCredentialsRequest, options?: Configuration): Promise<WebhooksOAuth2ClientCredentialsResponse>; /** * Delete an OAuth2 client credentials auth method by ID. * @param param The request object */ deleteOAuth2ClientCredentials(param: WebhooksIntegrationApiDeleteOAuth2ClientCredentialsRequest, options?: Configuration): Promise<void>; /** * Get a list of all auth methods configured for the Webhooks integration in * your organization. * @param param The request object */ getAllAuthMethods(param?: WebhooksIntegrationApiGetAllAuthMethodsRequest, options?: Configuration): Promise<WebhooksAuthMethodsResponse>; /** * Get a single OAuth2 client credentials auth method by ID. * @param param The request object */ getOAuth2ClientCredentials(param: WebhooksIntegrationApiGetOAuth2ClientCredentialsRequest, options?: Configuration): Promise<WebhooksOAuth2ClientCredentialsResponse>; /** * Update an existing OAuth2 client credentials auth method. * @param param The request object */ updateOAuth2ClientCredentials(param: WebhooksIntegrationApiUpdateOAuth2ClientCredentialsRequest, options?: Configuration): Promise<WebhooksOAuth2ClientCredentialsResponse>; }