@datadog/datadog-api-client
Version:
OpenAPI client for Datadog APIs
209 lines (208 loc) • 10.2 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 { OwnershipEvidenceResponse } from "../models/OwnershipEvidenceResponse";
import { OwnershipFeedbackRequest } from "../models/OwnershipFeedbackRequest";
import { OwnershipFeedbackResponse } from "../models/OwnershipFeedbackResponse";
import { OwnershipHistoryResponse } from "../models/OwnershipHistoryResponse";
import { OwnershipInferenceListResponse } from "../models/OwnershipInferenceListResponse";
import { OwnershipInferenceResponse } from "../models/OwnershipInferenceResponse";
import { OwnershipOwnerType } from "../models/OwnershipOwnerType";
export declare class CSMOwnershipApiRequestFactory extends BaseAPIRequestFactory {
createOwnershipFeedback(resourceId: string, ownerType: OwnershipOwnerType, body: OwnershipFeedbackRequest, _options?: Configuration): Promise<RequestContext>;
getOwnershipEvidence(resourceId: string, ownerType: OwnershipOwnerType, ifNoneMatch?: string, _options?: Configuration): Promise<RequestContext>;
getOwnershipInference(resourceId: string, ownerType: OwnershipOwnerType, ifNoneMatch?: string, _options?: Configuration): Promise<RequestContext>;
listOwnershipHistory(resourceId: string, cursor?: string, limit?: number, _options?: Configuration): Promise<RequestContext>;
listOwnershipHistoryByOwnerType(resourceId: string, ownerType: OwnershipOwnerType, cursor?: string, limit?: number, _options?: Configuration): Promise<RequestContext>;
listOwnershipInferences(resourceId: string, _options?: Configuration): Promise<RequestContext>;
}
export declare class CSMOwnershipApiResponseProcessor {
/**
* 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 createOwnershipFeedback
* @throws ApiException if the response code was not in [200, 299]
*/
createOwnershipFeedback(response: ResponseContext): Promise<OwnershipFeedbackResponse>;
/**
* 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 getOwnershipEvidence
* @throws ApiException if the response code was not in [200, 299]
*/
getOwnershipEvidence(response: ResponseContext): Promise<OwnershipEvidenceResponse>;
/**
* 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 getOwnershipInference
* @throws ApiException if the response code was not in [200, 299]
*/
getOwnershipInference(response: ResponseContext): Promise<OwnershipInferenceResponse>;
/**
* 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 listOwnershipHistory
* @throws ApiException if the response code was not in [200, 299]
*/
listOwnershipHistory(response: ResponseContext): Promise<OwnershipHistoryResponse>;
/**
* 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 listOwnershipHistoryByOwnerType
* @throws ApiException if the response code was not in [200, 299]
*/
listOwnershipHistoryByOwnerType(response: ResponseContext): Promise<OwnershipHistoryResponse>;
/**
* 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 listOwnershipInferences
* @throws ApiException if the response code was not in [200, 299]
*/
listOwnershipInferences(response: ResponseContext): Promise<OwnershipInferenceListResponse>;
}
export interface CSMOwnershipApiCreateOwnershipFeedbackRequest {
/**
* The identifier of the resource that the feedback applies to.
* @type string
*/
resourceId: string;
/**
* The type of owner that the feedback applies to.
* @type OwnershipOwnerType
*/
ownerType: OwnershipOwnerType;
/**
* @type OwnershipFeedbackRequest
*/
body: OwnershipFeedbackRequest;
}
export interface CSMOwnershipApiGetOwnershipEvidenceRequest {
/**
* The identifier of the resource to retrieve evidence for.
* @type string
*/
resourceId: string;
/**
* The owner type of the inference to retrieve evidence for.
* @type OwnershipOwnerType
*/
ownerType: OwnershipOwnerType;
/**
* A previously returned weak `ETag` value. When supplied and the evidence has not changed, the endpoint returns `304 Not Modified`.
* @type string
*/
ifNoneMatch?: string;
}
export interface CSMOwnershipApiGetOwnershipInferenceRequest {
/**
* The identifier of the resource to retrieve the ownership inference for.
* @type string
*/
resourceId: string;
/**
* The owner type of the inference to retrieve.
* @type OwnershipOwnerType
*/
ownerType: OwnershipOwnerType;
/**
* A previously returned `ETag` value. When supplied and the resource has not changed, the endpoint returns `304 Not Modified`.
* @type string
*/
ifNoneMatch?: string;
}
export interface CSMOwnershipApiListOwnershipHistoryRequest {
/**
* The identifier of the resource to retrieve inference history for.
* @type string
*/
resourceId: string;
/**
* An opaque, base64-encoded cursor token returned by a previous call in `pagination.next_cursor`. Omit to fetch the first page.
* @type string
*/
cursor?: string;
/**
* The maximum number of history entries to return per page.
* @type number
*/
limit?: number;
}
export interface CSMOwnershipApiListOwnershipHistoryByOwnerTypeRequest {
/**
* The identifier of the resource to retrieve inference history for.
* @type string
*/
resourceId: string;
/**
* The owner type to filter history by.
* @type OwnershipOwnerType
*/
ownerType: OwnershipOwnerType;
/**
* An opaque, base64-encoded cursor token returned by a previous call in `pagination.next_cursor`. Omit to fetch the first page.
* @type string
*/
cursor?: string;
/**
* The maximum number of history entries to return per page.
* @type number
*/
limit?: number;
}
export interface CSMOwnershipApiListOwnershipInferencesRequest {
/**
* The identifier of the resource to retrieve ownership inferences for.
* @type string
*/
resourceId: string;
}
export declare class CSMOwnershipApi {
private requestFactory;
private responseProcessor;
private configuration;
constructor(configuration: Configuration, requestFactory?: CSMOwnershipApiRequestFactory, responseProcessor?: CSMOwnershipApiResponseProcessor);
/**
* Submit feedback on the current ownership inference for a resource and owner type. Valid actions are `confirm`, `reject`, `correct`, and `persist`.
*
* The request must include the current inference `checksum` in `inference_checksum`. If the checksum does not match the current inference state, the endpoint returns `409 Conflict`.
*
* When `action` is `correct`, `corrected_owner_handle` and `corrected_owner_type` are required.
* @param param The request object
*/
createOwnershipFeedback(param: CSMOwnershipApiCreateOwnershipFeedbackRequest, options?: Configuration): Promise<OwnershipFeedbackResponse>;
/**
* Get the evidence versions backing the current ownership inference for a resource and owner type.
*
* This endpoint supports weak ETag caching. Pass the previously returned `ETag` value in the `If-None-Match` request header to receive a `304 Not Modified` response when the evidence has not changed.
* @param param The request object
*/
getOwnershipEvidence(param: CSMOwnershipApiGetOwnershipEvidenceRequest, options?: Configuration): Promise<OwnershipEvidenceResponse>;
/**
* Get the current ownership inference for a resource for a specific owner type.
*
* This endpoint supports ETag-based caching. Pass the previously returned `ETag` value in the `If-None-Match` request header to receive a `304 Not Modified` response when the inference has not changed.
* @param param The request object
*/
getOwnershipInference(param: CSMOwnershipApiGetOwnershipInferenceRequest, options?: Configuration): Promise<OwnershipInferenceResponse>;
/**
* List inference history entries for a resource across all owner types, ordered from most recent to oldest. Uses cursor-based pagination.
* @param param The request object
*/
listOwnershipHistory(param: CSMOwnershipApiListOwnershipHistoryRequest, options?: Configuration): Promise<OwnershipHistoryResponse>;
/**
* List inference history entries for a resource filtered by owner type, ordered from most recent to oldest. Uses cursor-based pagination.
* @param param The request object
*/
listOwnershipHistoryByOwnerType(param: CSMOwnershipApiListOwnershipHistoryByOwnerTypeRequest, options?: Configuration): Promise<OwnershipHistoryResponse>;
/**
* Get all current ownership inferences for a resource, one per owner type (`user`, `team`, `service`, `unknown`).
* @param param The request object
*/
listOwnershipInferences(param: CSMOwnershipApiListOwnershipInferencesRequest, options?: Configuration): Promise<OwnershipInferenceListResponse>;
}