Skip to content

Commit

Permalink
fix(api): add createEvent method and EventsApiCreateEventRequest type…
Browse files Browse the repository at this point in the history
… to v2.EventsApi
  • Loading branch information
adxdits committed Dec 25, 2024
1 parent e17558a commit c173225
Show file tree
Hide file tree
Showing 2 changed files with 820 additions and 1,048 deletions.
27 changes: 6 additions & 21 deletions packages/datadog-api-client-v2/apis/EventsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,13 @@ export class EventsApiRequestFactory extends BaseAPIRequestFactory {
const localVarPath = "/api/v2/events";

// Make Request Context
const requestContext = _config
.getServer("v2.EventsApi.createEvent")
.makeRequestContext(localVarPath, HttpMethod.POST);
if (!_config.baseServer) {
throw new Error("Base server configuration is missing");
}
const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);

// Body Params
const contentType = ObjectSerializer.getPreferredMediaType([
"application/json",
]);
requestContext.setHeaderParam("Content-Type", contentType);
const serializedBody = ObjectSerializer.stringify(
ObjectSerializer.serialize(body, "EventCreateRequestPayload", ""),
contentType
);
requestContext.setBody(serializedBody);

// Apply auth methods
applySecurityAuthentication(_config, requestContext, [
"apiKeyAuth",
"appKeyAuth",
]);
requestContext.setHeaderParam("Content-Type", "application/json");
requestContext.setBody(JSON.stringify(body));

return requestContext;
}
Expand Down
Loading

0 comments on commit c173225

Please sign in to comment.