// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflaredev/resource';
import * as RequestsAPI from 'cloudflaredev/resources/cloudforce-one/requests/requests';
import * as MessageAPI from 'cloudflaredev/resources/cloudforce-one/requests/message';
import * as PriorityAPI from 'cloudflaredev/resources/cloudforce-one/requests/priority';
import { V4PagePaginationArray } from 'cloudflaredev/pagination';
export class Requests extends APIResource {
    constructor() {
        super(...arguments);
        this.message = new MessageAPI.MessageResource(this._client);
        this.priority = new PriorityAPI.PriorityResource(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`, ListItemsV4PagePaginationArray, { body, method: 'post', ...options });
    }
    /**
     * Delete a Request
     */
    delete(accountIdentifier, requestIdentifier, options) {
        return this._client.delete(`/accounts/${accountIdentifier}/cloudforce-one/requests/${requestIdentifier}`, options);
    }
    /**
     * 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 ListItemsV4PagePaginationArray extends V4PagePaginationArray {
}
(function (Requests) {
    Requests.ListItemsV4PagePaginationArray = RequestsAPI.ListItemsV4PagePaginationArray;
    Requests.MessageResource = MessageAPI.MessageResource;
    Requests.PriorityResource = PriorityAPI.PriorityResource;
})(Requests || (Requests = {}));
//# sourceMappingURL=requests.mjs.map