cloudflare
Version:
The official TypeScript library for the Cloudflare API
41 lines • 1.79 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../resource.mjs";
import { V4PagePaginationArray } from "../../pagination.mjs";
export class Recipients extends APIResource {
/**
* Create a new share recipient
*/
create(shareId, params, options) {
const { path_account_id, ...body } = params;
return this._client.post(`/accounts/${path_account_id}/shares/${shareId}/recipients`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* List share recipients by share ID.
*/
list(shareId, params, options) {
const { account_id, ...query } = params;
return this._client.getAPIList(`/accounts/${account_id}/shares/${shareId}/recipients`, RecipientListResponsesV4PagePaginationArray, { query, ...options });
}
/**
* Deletion is not immediate, an updated share recipient object with a new status
* will be returned.
*/
delete(shareId, recipientId, params, options) {
const { account_id } = params;
return this._client.delete(`/accounts/${account_id}/shares/${shareId}/recipients/${recipientId}`, options)._thenUnwrap((obj) => obj.result);
}
/**
* Get share recipient by ID.
*/
get(shareId, recipientId, params, options) {
const { account_id } = params;
return this._client.get(`/accounts/${account_id}/shares/${shareId}/recipients/${recipientId}`, options)._thenUnwrap((obj) => obj.result);
}
}
export class RecipientListResponsesV4PagePaginationArray extends V4PagePaginationArray {
}
Recipients.RecipientListResponsesV4PagePaginationArray = RecipientListResponsesV4PagePaginationArray;
//# sourceMappingURL=recipients.mjs.map