cloudflare
Version:
The official TypeScript library for the Cloudflare API
452 lines • 13.2 kB
TypeScript
import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as SubscriptionsAPI from 'cloudflare/resources/user/subscriptions';
export declare class Subscriptions extends APIResource {
/**
* Updates a user's subscriptions.
*/
update(identifier: string, body: SubscriptionUpdateParams, options?: Core.RequestOptions): Core.APIPromise<SubscriptionUpdateResponse>;
/**
* Deletes a user's subscription.
*/
delete(identifier: string, options?: Core.RequestOptions): Core.APIPromise<SubscriptionDeleteResponse>;
/**
* Updates zone subscriptions, either plan or add-ons.
*/
edit(identifier: string, body: SubscriptionEditParams, options?: Core.RequestOptions): Core.APIPromise<SubscriptionEditResponse>;
/**
* Lists all of a user's subscriptions.
*/
get(options?: Core.RequestOptions): Core.APIPromise<SubscriptionGetResponse | null>;
}
export interface Subscription {
/**
* Subscription identifier tag.
*/
id?: string;
app?: Subscription.App;
/**
* The list of add-ons subscribed to.
*/
component_values?: Array<Subscription.ComponentValue>;
/**
* The monetary unit in which pricing information is displayed.
*/
currency?: string;
/**
* The end of the current period and also when the next billing is due.
*/
current_period_end?: string;
/**
* When the current billing period started. May match initial_period_start if this
* is the first period.
*/
current_period_start?: string;
/**
* How often the subscription is renewed automatically.
*/
frequency?: 'weekly' | 'monthly' | 'quarterly' | 'yearly';
/**
* The price of the subscription that will be billed, in US dollars.
*/
price?: number;
/**
* The rate plan applied to the subscription.
*/
rate_plan?: Subscription.RatePlan;
/**
* The state that the subscription is in.
*/
state?: 'Trial' | 'Provisioned' | 'Paid' | 'AwaitingPayment' | 'Cancelled' | 'Failed' | 'Expired';
/**
* A simple zone object. May have null properties if not a zone subscription.
*/
zone?: Subscription.Zone;
}
export declare namespace Subscription {
interface App {
/**
* app install id.
*/
install_id?: string;
}
/**
* A component value for a subscription.
*/
interface ComponentValue {
/**
* The default amount assigned.
*/
default?: number;
/**
* The name of the component value.
*/
name?: string;
/**
* The unit price for the component value.
*/
price?: number;
/**
* The amount of the component value assigned.
*/
value?: number;
}
/**
* The rate plan applied to the subscription.
*/
interface RatePlan {
/**
* The ID of the rate plan.
*/
id?: string;
/**
* The currency applied to the rate plan subscription.
*/
currency?: string;
/**
* Whether this rate plan is managed externally from Cloudflare.
*/
externally_managed?: boolean;
/**
* Whether a rate plan is enterprise-based (or newly adopted term contract).
*/
is_contract?: boolean;
/**
* The full name of the rate plan.
*/
public_name?: string;
/**
* The scope that this rate plan applies to.
*/
scope?: string;
/**
* The list of sets this rate plan applies to.
*/
sets?: Array<string>;
}
/**
* A simple zone object. May have null properties if not a zone subscription.
*/
interface Zone {
/**
* Identifier
*/
id?: string;
/**
* The domain name
*/
name?: string;
}
}
export type SubscriptionUpdateResponse = unknown | string | null;
export interface SubscriptionDeleteResponse {
/**
* Subscription identifier tag.
*/
subscription_id?: string;
}
export type SubscriptionEditResponse = unknown | string | null;
export type SubscriptionGetResponse = Array<SubscriptionGetResponse.SubscriptionGetResponseItem>;
export declare namespace SubscriptionGetResponse {
interface SubscriptionGetResponseItem {
/**
* Subscription identifier tag.
*/
id?: string;
app?: SubscriptionGetResponseItem.App;
/**
* The list of add-ons subscribed to.
*/
component_values?: Array<SubscriptionGetResponseItem.ComponentValue>;
/**
* The monetary unit in which pricing information is displayed.
*/
currency?: string;
/**
* The end of the current period and also when the next billing is due.
*/
current_period_end?: string;
/**
* When the current billing period started. May match initial_period_start if this
* is the first period.
*/
current_period_start?: string;
/**
* How often the subscription is renewed automatically.
*/
frequency?: 'weekly' | 'monthly' | 'quarterly' | 'yearly';
/**
* The price of the subscription that will be billed, in US dollars.
*/
price?: number;
/**
* The rate plan applied to the subscription.
*/
rate_plan?: SubscriptionGetResponseItem.RatePlan;
/**
* The state that the subscription is in.
*/
state?: 'Trial' | 'Provisioned' | 'Paid' | 'AwaitingPayment' | 'Cancelled' | 'Failed' | 'Expired';
/**
* A simple zone object. May have null properties if not a zone subscription.
*/
zone?: SubscriptionGetResponseItem.Zone;
}
namespace SubscriptionGetResponseItem {
interface App {
/**
* app install id.
*/
install_id?: string;
}
/**
* A component value for a subscription.
*/
interface ComponentValue {
/**
* The default amount assigned.
*/
default?: number;
/**
* The name of the component value.
*/
name?: string;
/**
* The unit price for the component value.
*/
price?: number;
/**
* The amount of the component value assigned.
*/
value?: number;
}
/**
* The rate plan applied to the subscription.
*/
interface RatePlan {
/**
* The ID of the rate plan.
*/
id?: string;
/**
* The currency applied to the rate plan subscription.
*/
currency?: string;
/**
* Whether this rate plan is managed externally from Cloudflare.
*/
externally_managed?: boolean;
/**
* Whether a rate plan is enterprise-based (or newly adopted term contract).
*/
is_contract?: boolean;
/**
* The full name of the rate plan.
*/
public_name?: string;
/**
* The scope that this rate plan applies to.
*/
scope?: string;
/**
* The list of sets this rate plan applies to.
*/
sets?: Array<string>;
}
/**
* A simple zone object. May have null properties if not a zone subscription.
*/
interface Zone {
/**
* Identifier
*/
id?: string;
/**
* The domain name
*/
name?: string;
}
}
}
export interface SubscriptionUpdateParams {
app?: SubscriptionUpdateParams.App;
/**
* The list of add-ons subscribed to.
*/
component_values?: Array<SubscriptionUpdateParams.ComponentValue>;
/**
* How often the subscription is renewed automatically.
*/
frequency?: 'weekly' | 'monthly' | 'quarterly' | 'yearly';
/**
* The rate plan applied to the subscription.
*/
rate_plan?: SubscriptionUpdateParams.RatePlan;
/**
* A simple zone object. May have null properties if not a zone subscription.
*/
zone?: SubscriptionUpdateParams.Zone;
}
export declare namespace SubscriptionUpdateParams {
interface App {
/**
* app install id.
*/
install_id?: string;
}
/**
* A component value for a subscription.
*/
interface ComponentValue {
/**
* The default amount assigned.
*/
default?: number;
/**
* The name of the component value.
*/
name?: string;
/**
* The unit price for the component value.
*/
price?: number;
/**
* The amount of the component value assigned.
*/
value?: number;
}
/**
* The rate plan applied to the subscription.
*/
interface RatePlan {
/**
* The ID of the rate plan.
*/
id?: string;
/**
* The currency applied to the rate plan subscription.
*/
currency?: string;
/**
* Whether this rate plan is managed externally from Cloudflare.
*/
externally_managed?: boolean;
/**
* Whether a rate plan is enterprise-based (or newly adopted term contract).
*/
is_contract?: boolean;
/**
* The full name of the rate plan.
*/
public_name?: string;
/**
* The scope that this rate plan applies to.
*/
scope?: string;
/**
* The list of sets this rate plan applies to.
*/
sets?: Array<string>;
}
/**
* A simple zone object. May have null properties if not a zone subscription.
*/
interface Zone {
}
}
export interface SubscriptionEditParams {
app?: SubscriptionEditParams.App;
/**
* The list of add-ons subscribed to.
*/
component_values?: Array<SubscriptionEditParams.ComponentValue>;
/**
* How often the subscription is renewed automatically.
*/
frequency?: 'weekly' | 'monthly' | 'quarterly' | 'yearly';
/**
* The rate plan applied to the subscription.
*/
rate_plan?: SubscriptionEditParams.RatePlan;
/**
* A simple zone object. May have null properties if not a zone subscription.
*/
zone?: SubscriptionEditParams.Zone;
}
export declare namespace SubscriptionEditParams {
interface App {
/**
* app install id.
*/
install_id?: string;
}
/**
* A component value for a subscription.
*/
interface ComponentValue {
/**
* The default amount assigned.
*/
default?: number;
/**
* The name of the component value.
*/
name?: string;
/**
* The unit price for the component value.
*/
price?: number;
/**
* The amount of the component value assigned.
*/
value?: number;
}
/**
* The rate plan applied to the subscription.
*/
interface RatePlan {
/**
* The ID of the rate plan.
*/
id?: string;
/**
* The currency applied to the rate plan subscription.
*/
currency?: string;
/**
* Whether this rate plan is managed externally from Cloudflare.
*/
externally_managed?: boolean;
/**
* Whether a rate plan is enterprise-based (or newly adopted term contract).
*/
is_contract?: boolean;
/**
* The full name of the rate plan.
*/
public_name?: string;
/**
* The scope that this rate plan applies to.
*/
scope?: string;
/**
* The list of sets this rate plan applies to.
*/
sets?: Array<string>;
}
/**
* A simple zone object. May have null properties if not a zone subscription.
*/
interface Zone {
}
}
export declare namespace Subscriptions {
export import Subscription = SubscriptionsAPI.Subscription;
export import SubscriptionUpdateResponse = SubscriptionsAPI.SubscriptionUpdateResponse;
export import SubscriptionDeleteResponse = SubscriptionsAPI.SubscriptionDeleteResponse;
export import SubscriptionEditResponse = SubscriptionsAPI.SubscriptionEditResponse;
export import SubscriptionGetResponse = SubscriptionsAPI.SubscriptionGetResponse;
export import SubscriptionUpdateParams = SubscriptionsAPI.SubscriptionUpdateParams;
export import SubscriptionEditParams = SubscriptionsAPI.SubscriptionEditParams;
}
//# sourceMappingURL=subscriptions.d.ts.map