"use strict";
// File generated from our OpenAPI spec by Stainless.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CloudforceOneRequestListItemsV4PagePaginationArray = exports.Requests = void 0;
const resource_1 = require("cloudflare/resource");
const RequestsAPI = __importStar(require("cloudflare/resources/cloudforce-one/requests/requests"));
const MessageAPI = __importStar(require("cloudflare/resources/cloudforce-one/requests/message"));
const PriorityAPI = __importStar(require("cloudflare/resources/cloudforce-one/requests/priority"));
const pagination_1 = require("cloudflare/pagination");
class Requests extends resource_1.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);
    }
}
exports.Requests = Requests;
class CloudforceOneRequestListItemsV4PagePaginationArray extends pagination_1.V4PagePaginationArray {
}
exports.CloudforceOneRequestListItemsV4PagePaginationArray = CloudforceOneRequestListItemsV4PagePaginationArray;
(function (Requests) {
    Requests.CloudforceOneRequestListItemsV4PagePaginationArray = RequestsAPI.CloudforceOneRequestListItemsV4PagePaginationArray;
    Requests.Message = MessageAPI.Message;
    Requests.Priority = PriorityAPI.Priority;
})(Requests = exports.Requests || (exports.Requests = {}));
//# sourceMappingURL=requests.js.map