UNPKG

@datadog/datadog-api-client

Version:

OpenAPI client for Datadog APIs

131 lines (130 loc) 6.08 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 { EventCreateRequestPayload } from "../models/EventCreateRequestPayload"; import { EventCreateResponsePayload } from "../models/EventCreateResponsePayload"; import { EventResponse } from "../models/EventResponse"; import { EventsListRequest } from "../models/EventsListRequest"; import { EventsListResponse } from "../models/EventsListResponse"; import { EventsSort } from "../models/EventsSort"; export declare class EventsApiRequestFactory extends BaseAPIRequestFactory { createEvent(body: EventCreateRequestPayload, _options?: Configuration): Promise<RequestContext>; listEvents(filterQuery?: string, filterFrom?: string, filterTo?: string, sort?: EventsSort, pageCursor?: string, pageLimit?: number, _options?: Configuration): Promise<RequestContext>; searchEvents(body?: EventsListRequest, _options?: Configuration): Promise<RequestContext>; } export declare class EventsApiResponseProcessor { /** * 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 createEvent * @throws ApiException if the response code was not in [200, 299] */ createEvent(response: ResponseContext): Promise<EventCreateResponsePayload>; /** * 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 listEvents * @throws ApiException if the response code was not in [200, 299] */ listEvents(response: ResponseContext): Promise<EventsListResponse>; /** * 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 searchEvents * @throws ApiException if the response code was not in [200, 299] */ searchEvents(response: ResponseContext): Promise<EventsListResponse>; } export interface EventsApiCreateEventRequest { /** * Event creation request payload. * @type EventCreateRequestPayload */ body: EventCreateRequestPayload; } export interface EventsApiListEventsRequest { /** * Search query following events syntax. * @type string */ filterQuery?: string; /** * Minimum timestamp for requested events, in milliseconds. * @type string */ filterFrom?: string; /** * Maximum timestamp for requested events, in milliseconds. * @type string */ filterTo?: string; /** * Order of events in results. * @type EventsSort */ sort?: EventsSort; /** * List following results with a cursor provided in the previous query. * @type string */ pageCursor?: string; /** * Maximum number of events in the response. * @type number */ pageLimit?: number; } export interface EventsApiSearchEventsRequest { /** * @type EventsListRequest */ body?: EventsListRequest; } export declare class EventsApi { private requestFactory; private responseProcessor; private configuration; constructor(configuration: Configuration, requestFactory?: EventsApiRequestFactory, responseProcessor?: EventsApiResponseProcessor); /** * This endpoint allows you to publish events. * * **Note:** To utilize this endpoint with our client libraries, please ensure you are using the latest version released on or after July 1, 2025. Earlier versions do not support this functionality. * * ✅ **Only events with the `change` or `alert` category** are in General Availability. For change events, see [Change Tracking](https://docs.datadoghq.com/change_tracking) for more details. * * ❌ For use cases involving other event categories, use the V1 endpoint or reach out to [support](https://www.datadoghq.com/support/). * * ❌ Notifications are not yet supported for events sent to this endpoint. Use the V1 endpoint for notification functionality. * * ❌ This endpoint is not available for the Government (US1-FED) site. Contact your account representative for more information. * @param param The request object */ createEvent(param: EventsApiCreateEventRequest, options?: Configuration): Promise<EventCreateResponsePayload>; /** * List endpoint returns events that match an events search query. * [Results are paginated similarly to logs](https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination). * * Use this endpoint to see your latest events. * @param param The request object */ listEvents(param?: EventsApiListEventsRequest, options?: Configuration): Promise<EventsListResponse>; /** * Provide a paginated version of listEvents returning a generator with all the items. */ listEventsWithPagination(param?: EventsApiListEventsRequest, options?: Configuration): AsyncGenerator<EventResponse>; /** * List endpoint returns events that match an events search query. * [Results are paginated similarly to logs](https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination). * * Use this endpoint to build complex events filtering and search. * @param param The request object */ searchEvents(param?: EventsApiSearchEventsRequest, options?: Configuration): Promise<EventsListResponse>; /** * Provide a paginated version of searchEvents returning a generator with all the items. */ searchEventsWithPagination(param?: EventsApiSearchEventsRequest, options?: Configuration): AsyncGenerator<EventResponse>; }