cloudflare
Version:
The official TypeScript library for the Cloudflare API
199 lines • 8.3 kB
text/typescript
import { APIResource } from "../../core/resource.mjs";
import * as OrganizationProfileAPI from "./organization-profile.mjs";
import { BaseOrganizationProfileResource, OrganizationProfile, OrganizationProfileResource, OrganizationProfileUpdateParams } from "./organization-profile.mjs";
import * as BillingAPI from "./billing/billing.mjs";
import { BaseBilling, Billing } from "./billing/billing.mjs";
import * as LogsAPI from "./logs/logs.mjs";
import { BaseLogs, Logs } from "./logs/logs.mjs";
import { APIPromise } from "../../core/api-promise.mjs";
import { PagePromise, SinglePage } from "../../core/pagination.mjs";
import { RequestOptions } from "../../internal/request-options.mjs";
export declare class BaseOrganizations extends APIResource {
static readonly _key: readonly ['organizations'];
/**
* Create a new organization for a user. Sub-organization creation availability
* depends on the organization's capabilities. (Currently in Public Beta - see
* https://developers.cloudflare.com/fundamentals/organizations/)
*/
create(body: OrganizationCreateParams, options?: RequestOptions): APIPromise<Organization>;
/**
* Update an organization's name. (Currently in Public Beta - see
* https://developers.cloudflare.com/fundamentals/organizations/)
*/
update(organizationID: string, body: OrganizationUpdateParams, options?: RequestOptions): APIPromise<Organization>;
/**
* Retrieve a list of organizations a particular user has access to. (Currently in
* Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)
*/
list(query?: OrganizationListParams | null | undefined, options?: RequestOptions): PagePromise<OrganizationsSinglePage, Organization>;
/**
* Delete an organization. The organization MUST be empty before deleting. It must
* not contain any sub-organizations, accounts, members or users. Sub-organization
* deletion availability depends on the organization's capabilities. (Currently in
* Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)
*
* **Access Control:** Restricted to enterprise organizations.
*/
delete(organizationID: string, options?: RequestOptions): APIPromise<OrganizationDeleteResponse>;
/**
* Retrieve the details of a certain organization. (Currently in Public Beta - see
* https://developers.cloudflare.com/fundamentals/organizations/)
*/
get(organizationID: string, options?: RequestOptions): APIPromise<Organization>;
}
export declare class Organizations extends BaseOrganizations {
organizationProfile: OrganizationProfileAPI.OrganizationProfileResource;
logs: LogsAPI.Logs;
billing: BillingAPI.Billing;
}
export type OrganizationsSinglePage = SinglePage<Organization>;
/**
* References an Organization in the Cloudflare data model.
*/
export interface Organization {
id: string;
create_time: string;
meta: Organization.Meta;
name: string;
parent?: Organization.Parent;
profile?: OrganizationProfileAPI.OrganizationProfile;
}
export declare namespace Organization {
interface Meta {
/**
* Ordered chain of organization tags from the root organization down to (and
* including) this organization itself. Root organizations return a single-element
* array containing their own tag; sub-organizations return
* `[rootTag, ...intermediateTags, parentTag, selfTag]`. Useful for constructing
* authorization scopes that need to cover every ancestor in the hierarchy.
*/
hierarchy_tags?: Array<string>;
managed_by?: string;
/**
* Enable features for Organizations.
*/
tenant_flags?: Meta.TenantFlags;
[k: string]: unknown;
}
namespace Meta {
/**
* Enable features for Organizations.
*/
interface TenantFlags {
account_creation: string;
account_creation_applies_tenant_defaults: string;
account_deletion: string;
account_migration: string;
account_mobility: string;
enterprise_capability: string;
member_management: string;
sub_org_creation: string;
}
}
interface Parent {
id: string;
name: string;
}
}
export interface OrganizationDeleteResponse {
id: string;
}
export interface OrganizationCreateParams {
name: string;
parent?: OrganizationCreateParams.Parent;
profile?: OrganizationProfileAPI.OrganizationProfileParam;
}
export declare namespace OrganizationCreateParams {
interface Parent {
id: string;
}
}
export interface OrganizationUpdateParams {
name: string;
parent?: OrganizationUpdateParams.Parent;
profile?: OrganizationProfileAPI.OrganizationProfileParam;
}
export declare namespace OrganizationUpdateParams {
interface Parent {
id: string;
}
}
export interface OrganizationListParams {
/**
* Only return organizations with the specified IDs (ex. id=foo&id=bar). Send
* multiple elements by repeating the query value.
*/
id?: Array<string>;
containing?: OrganizationListParams.Containing;
name?: OrganizationListParams.Name;
/**
* The amount of items to return. Defaults to 10.
*/
page_size?: number;
/**
* An opaque token returned from the last list response that when provided will
* retrieve the next page.
*
* Parameters used to filter the retrieved list must remain in subsequent requests
* with a page token.
*/
page_token?: string;
parent?: OrganizationListParams.Parent;
}
export declare namespace OrganizationListParams {
interface Containing {
/**
* Filter the list of organizations to the ones that contain this particular
* account.
*/
account?: string;
/**
* Filter the list of organizations to the ones that contain this particular
* organization.
*/
organization?: string;
/**
* Filter the list of organizations to the ones that contain this particular user.
*
* IMPORTANT: Just because an organization "contains" a user is not a
* representation of any authorization or privilege to manage any resources
* therein. An organization "containing" a user simply means the user is managed by
* that organization.
*/
user?: string;
}
interface Name {
/**
* (case-insensitive) Filter the list of organizations to where the name contains a
* particular string.
*/
contains?: string;
/**
* (case-insensitive) Filter the list of organizations to where the name ends with
* a particular string.
*/
endsWith?: string;
/**
* (case-insensitive) Filter the list of organizations to where the name starts
* with a particular string.
*/
startsWith?: string;
}
interface Parent {
/**
* Filter the list of organizations to the ones that are a sub-organization of the
* specified organization.
*
* "null" is a valid value to provide for this parameter. It means "where an
* organization has no parent (i.e. it is a 'root' organization)."
*/
id?: (string & {}) | 'null';
}
}
export declare namespace Organizations {
export { type Organization as Organization, type OrganizationDeleteResponse as OrganizationDeleteResponse, type OrganizationsSinglePage as OrganizationsSinglePage, type OrganizationCreateParams as OrganizationCreateParams, type OrganizationUpdateParams as OrganizationUpdateParams, type OrganizationListParams as OrganizationListParams, };
export { OrganizationProfileResource as OrganizationProfileResource, BaseOrganizationProfileResource as BaseOrganizationProfileResource, type OrganizationProfile as OrganizationProfile, type OrganizationProfileUpdateParams as OrganizationProfileUpdateParams, };
export { Logs as Logs, BaseLogs as BaseLogs };
export { Billing as Billing, BaseBilling as BaseBilling };
}
//# sourceMappingURL=organizations.d.mts.map