UNPKG

@datadog/datadog-api-client

Version:
252 lines (251 loc) 10.9 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 { CloneFormRequest } from "../models/CloneFormRequest"; import { CreateFormRequest } from "../models/CreateFormRequest"; import { DeleteFormResponse } from "../models/DeleteFormResponse"; import { FormPublicationResponse } from "../models/FormPublicationResponse"; import { FormResponse } from "../models/FormResponse"; import { FormsResponse } from "../models/FormsResponse"; import { FormVersionResponse } from "../models/FormVersionResponse"; import { PublishFormRequest } from "../models/PublishFormRequest"; import { UpdateFormRequest } from "../models/UpdateFormRequest"; import { UpsertAndPublishFormVersionRequest } from "../models/UpsertAndPublishFormVersionRequest"; import { UpsertFormVersionRequest } from "../models/UpsertFormVersionRequest"; export declare class FormsApiRequestFactory extends BaseAPIRequestFactory { cloneForm(formId: string, body: CloneFormRequest, _options?: Configuration): Promise<RequestContext>; createAndPublishForm(body: CreateFormRequest, _options?: Configuration): Promise<RequestContext>; createForm(body: CreateFormRequest, _options?: Configuration): Promise<RequestContext>; deleteForm(formId: string, _options?: Configuration): Promise<RequestContext>; getForm(formId: string, version?: string, _options?: Configuration): Promise<RequestContext>; listForms(_options?: Configuration): Promise<RequestContext>; publishForm(formId: string, body: PublishFormRequest, _options?: Configuration): Promise<RequestContext>; updateForm(formId: string, body: UpdateFormRequest, _options?: Configuration): Promise<RequestContext>; upsertAndPublishFormVersion(formId: string, body: UpsertAndPublishFormVersionRequest, _options?: Configuration): Promise<RequestContext>; upsertFormVersion(formId: string, body: UpsertFormVersionRequest, _options?: Configuration): Promise<RequestContext>; } export declare class FormsApiResponseProcessor { /** * 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 cloneForm * @throws ApiException if the response code was not in [200, 299] */ cloneForm(response: ResponseContext): Promise<FormResponse>; /** * 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 createAndPublishForm * @throws ApiException if the response code was not in [200, 299] */ createAndPublishForm(response: ResponseContext): Promise<FormResponse>; /** * 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 createForm * @throws ApiException if the response code was not in [200, 299] */ createForm(response: ResponseContext): Promise<FormResponse>; /** * 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 deleteForm * @throws ApiException if the response code was not in [200, 299] */ deleteForm(response: ResponseContext): Promise<DeleteFormResponse>; /** * 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 getForm * @throws ApiException if the response code was not in [200, 299] */ getForm(response: ResponseContext): Promise<FormResponse>; /** * 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 listForms * @throws ApiException if the response code was not in [200, 299] */ listForms(response: ResponseContext): Promise<FormsResponse>; /** * 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 publishForm * @throws ApiException if the response code was not in [200, 299] */ publishForm(response: ResponseContext): Promise<FormPublicationResponse>; /** * 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 updateForm * @throws ApiException if the response code was not in [200, 299] */ updateForm(response: ResponseContext): Promise<FormResponse>; /** * 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 upsertAndPublishFormVersion * @throws ApiException if the response code was not in [200, 299] */ upsertAndPublishFormVersion(response: ResponseContext): Promise<FormResponse>; /** * 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 upsertFormVersion * @throws ApiException if the response code was not in [200, 299] */ upsertFormVersion(response: ResponseContext): Promise<FormVersionResponse>; } export interface FormsApiCloneFormRequest { /** * The ID of the form to clone. * @type string */ formId: string; /** * @type CloneFormRequest */ body: CloneFormRequest; } export interface FormsApiCreateAndPublishFormRequest { /** * @type CreateFormRequest */ body: CreateFormRequest; } export interface FormsApiCreateFormRequest { /** * @type CreateFormRequest */ body: CreateFormRequest; } export interface FormsApiDeleteFormRequest { /** * The ID of the form. * @type string */ formId: string; } export interface FormsApiGetFormRequest { /** * The ID of the form. * @type string */ formId: string; /** * The version of the form to retrieve. Use 'latest' for the most recent draft, 'published' for the last published version, or a specific version number. * @type string */ version?: string; } export interface FormsApiPublishFormRequest { /** * The ID of the form. * @type string */ formId: string; /** * @type PublishFormRequest */ body: PublishFormRequest; } export interface FormsApiUpdateFormRequest { /** * The ID of the form. * @type string */ formId: string; /** * @type UpdateFormRequest */ body: UpdateFormRequest; } export interface FormsApiUpsertAndPublishFormVersionRequest { /** * The ID of the form. * @type string */ formId: string; /** * @type UpsertAndPublishFormVersionRequest */ body: UpsertAndPublishFormVersionRequest; } export interface FormsApiUpsertFormVersionRequest { /** * The ID of the form. * @type string */ formId: string; /** * @type UpsertFormVersionRequest */ body: UpsertFormVersionRequest; } export declare class FormsApi { private requestFactory; private responseProcessor; private configuration; constructor(configuration: Configuration, requestFactory?: FormsApiRequestFactory, responseProcessor?: FormsApiResponseProcessor); /** * Clone an existing form. The clone is created in draft mode using the source form's latest version. * @param param The request object */ cloneForm(param: FormsApiCloneFormRequest, options?: Configuration): Promise<FormResponse>; /** * Creates a new form and immediately publishes its initial version. This also creates a new datastore for form responses and links it to the form. * @param param The request object */ createAndPublishForm(param: FormsApiCreateAndPublishFormRequest, options?: Configuration): Promise<FormResponse>; /** * Create a new form. The form is created in draft mode and must be published before it can be used. This also creates a new datastore for form responses and links it to the form. * @param param The request object */ createForm(param: FormsApiCreateFormRequest, options?: Configuration): Promise<FormResponse>; /** * Delete a form by its ID. This will also try to delete the associated datastore. * @param param The request object */ deleteForm(param: FormsApiDeleteFormRequest, options?: Configuration): Promise<DeleteFormResponse>; /** * Get a form definition by its ID. * @param param The request object */ getForm(param: FormsApiGetFormRequest, options?: Configuration): Promise<FormResponse>; /** * Get all forms for the authenticated user's organization. * @param param The request object */ listForms(options?: Configuration): Promise<FormsResponse>; /** * Publish a specific version of a form, making it available for submissions. * @param param The request object */ publishForm(param: FormsApiPublishFormRequest, options?: Configuration): Promise<FormPublicationResponse>; /** * Update a form's properties such as its name, description, or datastore configuration. * @param param The request object */ updateForm(param: FormsApiUpdateFormRequest, options?: Configuration): Promise<FormResponse>; /** * Upsert the latest form version and publish it in a single atomic transaction. * @param param The request object */ upsertAndPublishFormVersion(param: FormsApiUpsertAndPublishFormVersionRequest, options?: Configuration): Promise<FormResponse>; /** * Create or update the latest draft version of a form. The `upsert_params` field controls * optimistic concurrency behavior. * @param param The request object */ upsertFormVersion(param: FormsApiUpsertFormVersionRequest, options?: Configuration): Promise<FormVersionResponse>; }