UNPKG

@datadog/datadog-api-client

Version:

OpenAPI client for Datadog APIs

341 lines (340 loc) 14.6 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 { EscalationPolicy } from "../models/EscalationPolicy"; import { EscalationPolicyCreateRequest } from "../models/EscalationPolicyCreateRequest"; import { EscalationPolicyUpdateRequest } from "../models/EscalationPolicyUpdateRequest"; import { Schedule } from "../models/Schedule"; import { ScheduleCreateRequest } from "../models/ScheduleCreateRequest"; import { ScheduleUpdateRequest } from "../models/ScheduleUpdateRequest"; import { Shift } from "../models/Shift"; import { TeamOnCallResponders } from "../models/TeamOnCallResponders"; import { TeamRoutingRules } from "../models/TeamRoutingRules"; import { TeamRoutingRulesRequest } from "../models/TeamRoutingRulesRequest"; export declare class OnCallApiRequestFactory extends BaseAPIRequestFactory { createOnCallEscalationPolicy(body: EscalationPolicyCreateRequest, include?: string, _options?: Configuration): Promise<RequestContext>; createOnCallSchedule(body: ScheduleCreateRequest, include?: string, _options?: Configuration): Promise<RequestContext>; deleteOnCallEscalationPolicy(policyId: string, _options?: Configuration): Promise<RequestContext>; deleteOnCallSchedule(scheduleId: string, _options?: Configuration): Promise<RequestContext>; getOnCallEscalationPolicy(policyId: string, include?: string, _options?: Configuration): Promise<RequestContext>; getOnCallSchedule(scheduleId: string, include?: string, _options?: Configuration): Promise<RequestContext>; getOnCallTeamRoutingRules(teamId: string, include?: string, _options?: Configuration): Promise<RequestContext>; getScheduleOnCallUser(scheduleId: string, include?: string, filterAtTs?: string, _options?: Configuration): Promise<RequestContext>; getTeamOnCallUsers(teamId: string, include?: string, _options?: Configuration): Promise<RequestContext>; setOnCallTeamRoutingRules(teamId: string, body: TeamRoutingRulesRequest, include?: string, _options?: Configuration): Promise<RequestContext>; updateOnCallEscalationPolicy(policyId: string, body: EscalationPolicyUpdateRequest, include?: string, _options?: Configuration): Promise<RequestContext>; updateOnCallSchedule(scheduleId: string, body: ScheduleUpdateRequest, include?: string, _options?: Configuration): Promise<RequestContext>; } export declare class OnCallApiResponseProcessor { /** * 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 createOnCallEscalationPolicy * @throws ApiException if the response code was not in [200, 299] */ createOnCallEscalationPolicy(response: ResponseContext): Promise<EscalationPolicy>; /** * 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 createOnCallSchedule * @throws ApiException if the response code was not in [200, 299] */ createOnCallSchedule(response: ResponseContext): Promise<Schedule>; /** * 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 deleteOnCallEscalationPolicy * @throws ApiException if the response code was not in [200, 299] */ deleteOnCallEscalationPolicy(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 deleteOnCallSchedule * @throws ApiException if the response code was not in [200, 299] */ deleteOnCallSchedule(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 getOnCallEscalationPolicy * @throws ApiException if the response code was not in [200, 299] */ getOnCallEscalationPolicy(response: ResponseContext): Promise<EscalationPolicy>; /** * 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 getOnCallSchedule * @throws ApiException if the response code was not in [200, 299] */ getOnCallSchedule(response: ResponseContext): Promise<Schedule>; /** * 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 getOnCallTeamRoutingRules * @throws ApiException if the response code was not in [200, 299] */ getOnCallTeamRoutingRules(response: ResponseContext): Promise<TeamRoutingRules>; /** * 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 getScheduleOnCallUser * @throws ApiException if the response code was not in [200, 299] */ getScheduleOnCallUser(response: ResponseContext): Promise<Shift>; /** * 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 getTeamOnCallUsers * @throws ApiException if the response code was not in [200, 299] */ getTeamOnCallUsers(response: ResponseContext): Promise<TeamOnCallResponders>; /** * 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 setOnCallTeamRoutingRules * @throws ApiException if the response code was not in [200, 299] */ setOnCallTeamRoutingRules(response: ResponseContext): Promise<TeamRoutingRules>; /** * 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 updateOnCallEscalationPolicy * @throws ApiException if the response code was not in [200, 299] */ updateOnCallEscalationPolicy(response: ResponseContext): Promise<EscalationPolicy>; /** * 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 updateOnCallSchedule * @throws ApiException if the response code was not in [200, 299] */ updateOnCallSchedule(response: ResponseContext): Promise<Schedule>; } export interface OnCallApiCreateOnCallEscalationPolicyRequest { /** * @type EscalationPolicyCreateRequest */ body: EscalationPolicyCreateRequest; /** * Comma-separated list of included relationships to be returned. Allowed values: `teams`, `steps`, `steps.targets`. * @type string */ include?: string; } export interface OnCallApiCreateOnCallScheduleRequest { /** * @type ScheduleCreateRequest */ body: ScheduleCreateRequest; /** * Comma-separated list of included relationships to be returned. Allowed values: `teams`, `layers`, `layers.members`, `layers.members.user`. * @type string */ include?: string; } export interface OnCallApiDeleteOnCallEscalationPolicyRequest { /** * The ID of the escalation policy * @type string */ policyId: string; } export interface OnCallApiDeleteOnCallScheduleRequest { /** * The ID of the schedule * @type string */ scheduleId: string; } export interface OnCallApiGetOnCallEscalationPolicyRequest { /** * The ID of the escalation policy * @type string */ policyId: string; /** * Comma-separated list of included relationships to be returned. Allowed values: `teams`, `steps`, `steps.targets`. * @type string */ include?: string; } export interface OnCallApiGetOnCallScheduleRequest { /** * The ID of the schedule * @type string */ scheduleId: string; /** * Comma-separated list of included relationships to be returned. Allowed values: `teams`, `layers`, `layers.members`, `layers.members.user`. * @type string */ include?: string; } export interface OnCallApiGetOnCallTeamRoutingRulesRequest { /** * The team ID * @type string */ teamId: string; /** * Comma-separated list of included relationships to be returned. Allowed values: `rules`, `rules.policy`. * @type string */ include?: string; } export interface OnCallApiGetScheduleOnCallUserRequest { /** * The ID of the schedule. * @type string */ scheduleId: string; /** * Specifies related resources to include in the response as a comma-separated list. Allowed value: `user`. * @type string */ include?: string; /** * Retrieves the on-call user at the given timestamp (ISO-8601). Defaults to the current time if omitted." * @type string */ filterAtTs?: string; } export interface OnCallApiGetTeamOnCallUsersRequest { /** * The team ID * @type string */ teamId: string; /** * Comma-separated list of included relationships to be returned. Allowed values: `responders`, `escalations`, `escalations.responders`. * @type string */ include?: string; } export interface OnCallApiSetOnCallTeamRoutingRulesRequest { /** * The team ID * @type string */ teamId: string; /** * @type TeamRoutingRulesRequest */ body: TeamRoutingRulesRequest; /** * Comma-separated list of included relationships to be returned. Allowed values: `rules`, `rules.policy`. * @type string */ include?: string; } export interface OnCallApiUpdateOnCallEscalationPolicyRequest { /** * The ID of the escalation policy * @type string */ policyId: string; /** * @type EscalationPolicyUpdateRequest */ body: EscalationPolicyUpdateRequest; /** * Comma-separated list of included relationships to be returned. Allowed values: `teams`, `steps`, `steps.targets`. * @type string */ include?: string; } export interface OnCallApiUpdateOnCallScheduleRequest { /** * The ID of the schedule * @type string */ scheduleId: string; /** * @type ScheduleUpdateRequest */ body: ScheduleUpdateRequest; /** * Comma-separated list of included relationships to be returned. Allowed values: `teams`, `layers`, `layers.members`, `layers.members.user`. * @type string */ include?: string; } export declare class OnCallApi { private requestFactory; private responseProcessor; private configuration; constructor(configuration: Configuration, requestFactory?: OnCallApiRequestFactory, responseProcessor?: OnCallApiResponseProcessor); /** * Create a new On-Call escalation policy * @param param The request object */ createOnCallEscalationPolicy(param: OnCallApiCreateOnCallEscalationPolicyRequest, options?: Configuration): Promise<EscalationPolicy>; /** * Create a new On-Call schedule * @param param The request object */ createOnCallSchedule(param: OnCallApiCreateOnCallScheduleRequest, options?: Configuration): Promise<Schedule>; /** * Delete an On-Call escalation policy * @param param The request object */ deleteOnCallEscalationPolicy(param: OnCallApiDeleteOnCallEscalationPolicyRequest, options?: Configuration): Promise<void>; /** * Delete an On-Call schedule * @param param The request object */ deleteOnCallSchedule(param: OnCallApiDeleteOnCallScheduleRequest, options?: Configuration): Promise<void>; /** * Get an On-Call escalation policy * @param param The request object */ getOnCallEscalationPolicy(param: OnCallApiGetOnCallEscalationPolicyRequest, options?: Configuration): Promise<EscalationPolicy>; /** * Get an On-Call schedule * @param param The request object */ getOnCallSchedule(param: OnCallApiGetOnCallScheduleRequest, options?: Configuration): Promise<Schedule>; /** * Get a team's On-Call routing rules * @param param The request object */ getOnCallTeamRoutingRules(param: OnCallApiGetOnCallTeamRoutingRulesRequest, options?: Configuration): Promise<TeamRoutingRules>; /** * Retrieves the user who is on-call for the specified schedule at a given time. * @param param The request object */ getScheduleOnCallUser(param: OnCallApiGetScheduleOnCallUserRequest, options?: Configuration): Promise<Shift>; /** * Get a team's on-call users at a given time * @param param The request object */ getTeamOnCallUsers(param: OnCallApiGetTeamOnCallUsersRequest, options?: Configuration): Promise<TeamOnCallResponders>; /** * Set a team's On-Call routing rules * @param param The request object */ setOnCallTeamRoutingRules(param: OnCallApiSetOnCallTeamRoutingRulesRequest, options?: Configuration): Promise<TeamRoutingRules>; /** * Update an On-Call escalation policy * @param param The request object */ updateOnCallEscalationPolicy(param: OnCallApiUpdateOnCallEscalationPolicyRequest, options?: Configuration): Promise<EscalationPolicy>; /** * Update a new On-Call schedule * @param param The request object */ updateOnCallSchedule(param: OnCallApiUpdateOnCallScheduleRequest, options?: Configuration): Promise<Schedule>; }