cloudflare
Version:
The official TypeScript library for the Cloudflare API
79 lines • 3.64 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflare/resource';
import * as RequestsAPI from 'cloudflare/resources/cloudforce-one/requests/requests';
import * as MessageAPI from 'cloudflare/resources/cloudforce-one/requests/message';
import * as PriorityAPI from 'cloudflare/resources/cloudforce-one/requests/priority';
import { V4PagePaginationArray } from 'cloudflare/pagination';
export class Requests extends APIResource {
constructor() {
super(...arguments);
this.message = new MessageAPI.Message(this._client);
this.priority = new PriorityAPI.Priority(this._client);
}
/**
* Creating a request adds the request into the Cloudforce One queue for analysis.
* In addition to the content, a short title, type, priority, and releasability
* should be provided. If one is not provided a default will be assigned.
*/
create(accountIdentifier, body, options) {
return this._client.post(`/accounts/${accountIdentifier}/cloudforce-one/requests/new`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Updating a request alters the request in the Cloudforce One queue. This API may
* be used to update any attributes of the request after the initial submission.
* Only fields that you choose to update need to be add to the request body
*/
update(accountIdentifier, requestIdentifier, body, options) {
return this._client.put(`/accounts/${accountIdentifier}/cloudforce-one/requests/${requestIdentifier}`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* List Requests
*/
list(accountIdentifier, body, options) {
return this._client.getAPIList(`/accounts/${accountIdentifier}/cloudforce-one/requests`, CloudforceOneRequestListItemsV4PagePaginationArray, { body, method: 'post', ...options });
}
/**
* Delete a Request
*/
delete(accountIdentifier, requestIdentifier, options) {
return this._client.delete(`/accounts/${accountIdentifier}/cloudforce-one/requests/${requestIdentifier}`, options)._thenUnwrap((obj) => obj.result);
}
/**
* Get Request Priority, Status, and TLP constants
*/
constants(accountIdentifier, options) {
return this._client.get(`/accounts/${accountIdentifier}/cloudforce-one/requests/constants`, options)._thenUnwrap((obj) => obj.result);
}
/**
* Get a Request
*/
get(accountIdentifier, requestIdentifier, options) {
return this._client.get(`/accounts/${accountIdentifier}/cloudforce-one/requests/${requestIdentifier}`, options)._thenUnwrap((obj) => obj.result);
}
/**
* Get Request Quota
*/
quota(accountIdentifier, options) {
return this._client.get(`/accounts/${accountIdentifier}/cloudforce-one/requests/quota`, options)._thenUnwrap((obj) => obj.result);
}
/**
* Get Request Types
*/
types(accountIdentifier, options) {
return this._client.get(`/accounts/${accountIdentifier}/cloudforce-one/requests/types`, options)._thenUnwrap((obj) => obj.result);
}
}
export class CloudforceOneRequestListItemsV4PagePaginationArray extends V4PagePaginationArray {
}
(function (Requests) {
Requests.CloudforceOneRequestListItemsV4PagePaginationArray = RequestsAPI.CloudforceOneRequestListItemsV4PagePaginationArray;
Requests.Message = MessageAPI.Message;
Requests.Priority = PriorityAPI.Priority;
})(Requests || (Requests = {}));
//# sourceMappingURL=requests.mjs.map