cloudflare
Version:
The official TypeScript library for the Cloudflare API
102 lines • 2.99 kB
TypeScript
import { APIResource } from "../../../core/resource.js";
import { APIPromise } from "../../../core/api-promise.js";
import { RequestOptions } from "../../../internal/request-options.js";
export declare class BaseCancelReason extends APIResource {
static readonly _key: readonly ['accounts', 'subscriptions', 'cancelReason'];
/**
* Records a cancellation reason for an account subscription.
*
* @example
* ```ts
* const cancelReason =
* await client.accounts.subscriptions.cancelReason.create(
* '506e3185e9c882d175a2d0cb0093d9f2',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
create(subscriptionIdentifier: string, params: CancelReasonCreateParams, options?: RequestOptions): APIPromise<CancelReasonCreateResponse>;
/**
* Gets the cancellation reason for an account subscription.
*
* @example
* ```ts
* const cancelReason =
* await client.accounts.subscriptions.cancelReason.get(
* '506e3185e9c882d175a2d0cb0093d9f2',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
get(subscriptionIdentifier: string, params: CancelReasonGetParams, options?: RequestOptions): APIPromise<CancelReasonGetResponse>;
}
export declare class CancelReason extends BaseCancelReason {
}
export interface CancelReasonCreateResponse {
/**
* The cancel reason identifier.
*/
id?: string;
/**
* Additional cancellation details.
*/
other?: string;
/**
* The cancellation reason codes.
*/
reason_code?: Array<string>;
/**
* When the cancel reason was submitted.
*/
submitted?: string;
/**
* The subscription identifier.
*/
subscription_id?: string;
}
export interface CancelReasonGetResponse {
/**
* The cancel reason identifier.
*/
id?: string;
/**
* Additional cancellation details.
*/
other?: string;
/**
* The cancellation reason codes.
*/
reason_code?: Array<string>;
/**
* When the cancel reason was submitted.
*/
submitted?: string;
/**
* The subscription identifier.
*/
subscription_id?: string;
}
export interface CancelReasonCreateParams {
/**
* Path param: Identifier
*/
account_id: string;
/**
* Body param: Additional cancellation details.
*/
other?: string;
/**
* Body param: The cancellation reason codes.
*/
reason_code?: Array<string>;
}
export interface CancelReasonGetParams {
/**
* Identifier
*/
account_id: string;
}
export declare namespace CancelReason {
export { type CancelReasonCreateResponse as CancelReasonCreateResponse, type CancelReasonGetResponse as CancelReasonGetResponse, type CancelReasonCreateParams as CancelReasonCreateParams, type CancelReasonGetParams as CancelReasonGetParams, };
}
//# sourceMappingURL=cancel-reason.d.ts.map