// AUTO-GENERATED by scripts/generate.ts from .generated-specs. Do not edit. import * as S from "@distilled.cloud/core/schema"; import * as API from "@distilled.cloud/core/api"; import * as T from "../traits.ts"; import { CloudflareProtocol, CloudflarePaginatedProtocol, type CloudflareOpError, type CloudflareOpContext, } from "../protocol.ts"; import { cloudflarePaginate, ResultInfo } from "../pagination.ts"; import { CloudflareError, CloudflareRateLimited } from "../errors.ts"; import * as Retry from "../retry.ts"; export type { CloudflareOpError, CloudflareOpContext }; /** Fallback camelCase→wire mapping for opaque content (mined from the distilled SDK). */ const KEY_DICTIONARY: Record> = { accountCreation: "account_creation", accountDeletion: "account_deletion", accountMigration: "account_migration", accountMobility: "account_mobility", billedCost: "BilledCost", billingAccountId: "BillingAccountId", billingAccountName: "BillingAccountName", billingCurrency: "BillingCurrency", billingPeriodEnd: "BillingPeriodEnd", billingPeriodStart: "BillingPeriodStart", businessAddress: "business_address", businessEmail: "business_email", businessName: "business_name", businessPhone: "business_phone", cfRayId: "cf_ray_id", chargeCategory: "ChargeCategory", chargeClass: "ChargeClass", chargeDescription: "ChargeDescription", chargeFrequency: "ChargeFrequency", chargePeriodEnd: "ChargePeriodEnd", chargePeriodStart: "ChargePeriodStart", consumedQuantity: "ConsumedQuantity", consumedUnit: "ConsumedUnit", contractedCost: "ContractedCost", contractedUnitPrice: "ContractedUnitPrice", createTime: "create_time", effectiveCost: "EffectiveCost", externalMetadata: "external_metadata", hierarchyTags: "hierarchy_tags", hostProviderName: "HostProviderName", invoiceIssuerName: "InvoiceIssuerName", ipAddress: "ip_address", listCost: "ListCost", listUnitPrice: "ListUnitPrice", managedBy: "managed_by", pricingQuantity: "PricingQuantity", pricingUnit: "PricingUnit", regionId: "RegionId", regionName: "RegionName", resultInfo: "result_info", serviceProviderName: "ServiceProviderName", statusCode: "status_code", subAccountId: "SubAccountId", subAccountName: "SubAccountName", subOrgCreation: "sub_org_creation", tokenId: "token_id", tokenName: "token_name", userAgent: "user_agent", xBillableMetricId: "x_BillableMetricId", xBillableMetricName: "x_BillableMetricName", xProductFamilyName: "x_ProductFamilyName", xZoneId: "x_ZoneId", xZoneName: "x_ZoneName", }; export class Forbidden extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("Forbidden", { code: S.Number, message: S.String, }), [{ status: 403 }], ) {} export class OrganizationNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()( "OrganizationNotFound", { code: S.Number, message: S.String, }, ), [{ status: 404 }], ) {} export interface CreateMemberRequestMemberUser { email: string; } export const CreateMemberRequestMemberUser = /*@__PURE__*/ S.suspend(() => S.Struct({ email: S.String, }), ).annotate({ identifier: "CreateMemberRequestMemberUser", }) as any as S.Schema; export type CreateMemberRequestMemberStatus = "active" | "canceled"; export const CreateMemberRequestMemberStatus = /*@__PURE__*/ S.String; export interface CreateMemberRequestMember { user: CreateMemberRequestMemberUser; status?: CreateMemberRequestMemberStatus | (string & {}); } export const CreateMemberRequestMember = /*@__PURE__*/ S.suspend(() => S.Struct({ user: CreateMemberRequestMemberUser, status: S.optional(CreateMemberRequestMemberStatus), }), ).annotate({ identifier: "CreateMemberRequestMember", }) as any as S.Schema; export interface CreateMemberRequest { organizationId: string; member: CreateMemberRequestMember; } export const CreateMemberRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ organizationId: S.String.pipe(T.Label("organization_id")), member: CreateMemberRequestMember, }) .pipe( T.Http({ method: "POST", uri: "/organizations/{organization_id}/members", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateMemberRequest", }) as any as S.Schema; export type CreateMemberResponseMetaMap = { [key: string]: unknown | undefined; }; export const CreateMemberResponseMetaMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type CreateMemberResponseStatus = "active" | "canceled"; export const CreateMemberResponseStatus = /*@__PURE__*/ S.String; export interface CreateMemberResponseUser { id: string; email: string; name: string; twoFactorAuthenticationEnabled: boolean; } export const CreateMemberResponseUser = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, email: S.String, name: S.String, twoFactorAuthenticationEnabled: S.Boolean.pipe( T.Body("two_factor_authentication_enabled"), ), }), ).annotate({ identifier: "CreateMemberResponseUser", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateMemberResponse { /** Organization Member ID */ id: string; createTime: string; meta: CreateMemberResponseMetaMap; status: CreateMemberResponseStatus; updateTime: string; user: CreateMemberResponseUser; } export const CreateMemberResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, createTime: S.String.pipe(T.Body("create_time")), meta: CreateMemberResponseMetaMap, status: CreateMemberResponseStatus, updateTime: S.String.pipe(T.Body("update_time")), user: CreateMemberResponseUser, }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateMemberResponse", }) as any as S.Schema; export interface CreateRequestParent { id: string; name?: string; } export const CreateRequestParent = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, name: S.optional(S.String), }), ).annotate({ identifier: "CreateRequestParent", }) as any as S.Schema; export interface CreateRequestProfile { businessAddress: string; businessEmail: string; businessName: string; businessPhone: string; externalMetadata: string; } export const CreateRequestProfile = /*@__PURE__*/ S.suspend(() => S.Struct({ businessAddress: S.String.pipe(T.Body("business_address")), businessEmail: S.String.pipe(T.Body("business_email")), businessName: S.String.pipe(T.Body("business_name")), businessPhone: S.String.pipe(T.Body("business_phone")), externalMetadata: S.String.pipe(T.Body("external_metadata")), }), ).annotate({ identifier: "CreateRequestProfile", }) as any as S.Schema; export interface CreateOrganizationRequest { name: string; parent?: CreateRequestParent; profile?: CreateRequestProfile; } export const CreateOrganizationRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ name: S.String, parent: S.optional(CreateRequestParent), profile: S.optional(CreateRequestProfile), }) .pipe(T.Http({ method: "POST", uri: "/organizations", code: 200 })) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateOrganizationRequest", }) as any as S.Schema; export interface CreateResponseMetaFlags { accountCreation: string; accountDeletion: string; accountMigration: string; accountMobility: string; subOrgCreation: string; } export const CreateResponseMetaFlags = /*@__PURE__*/ S.suspend(() => S.Struct({ accountCreation: S.String.pipe(T.Body("account_creation")), accountDeletion: S.String.pipe(T.Body("account_deletion")), accountMigration: S.String.pipe(T.Body("account_migration")), accountMobility: S.String.pipe(T.Body("account_mobility")), subOrgCreation: S.String.pipe(T.Body("sub_org_creation")), }), ).annotate({ identifier: "CreateResponseMetaFlags", }) as any as S.Schema; export type CreateResponseMetaHierarchyTagsList = Array; export const CreateResponseMetaHierarchyTagsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface CreateResponseMeta { /** Enable features for Organizations. */ flags?: CreateResponseMetaFlags | null; /** Ordered chain of organization tags from the root organization down to */ hierarchyTags?: CreateResponseMetaHierarchyTagsList | null; managedBy?: string | null; } export const CreateResponseMeta = /*@__PURE__*/ S.suspend(() => S.Struct({ flags: S.optional(S.NullOr(CreateResponseMetaFlags)), hierarchyTags: S.optional( S.NullOr(CreateResponseMetaHierarchyTagsList).pipe( T.Body("hierarchy_tags"), ), ), managedBy: S.optional(S.NullOr(S.String).pipe(T.Body("managed_by"))), }), ).annotate({ identifier: "CreateResponseMeta", }) as any as S.Schema; export interface CreateResponseParent { id: string; name: string; } export const CreateResponseParent = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, name: S.String, }), ).annotate({ identifier: "CreateResponseParent", }) as any as S.Schema; export type CreateResponseProfile = CreateRequestProfile; export const CreateResponseProfile = CreateRequestProfile; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateOrganizationResponse { id: string; createTime: string; meta: CreateResponseMeta; name: string; parent?: CreateResponseParent | null; profile?: CreateRequestProfile | null; } export const CreateOrganizationResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, createTime: S.String.pipe(T.Body("create_time")), meta: CreateResponseMeta, name: S.String, parent: S.optional(S.NullOr(CreateResponseParent)), profile: S.optional(S.NullOr(CreateRequestProfile)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateOrganizationResponse", }) as any as S.Schema; export interface DeleteMemberRequest { organizationId: string; /** Organization Member ID */ memberId: string; } export const DeleteMemberRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ organizationId: S.String.pipe(T.Label("organization_id")), memberId: S.String.pipe(T.Label("member_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/organizations/{organization_id}/members/{member_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteMemberRequest", }) as any as S.Schema; export interface DeleteMemberResponse {} export const DeleteMemberResponse = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteMemberResponse", }) as any as S.Schema; export interface DeleteOrganizationRequest { organizationId: string; } export const DeleteOrganizationRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ organizationId: S.String.pipe(T.Label("organization_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/organizations/{organization_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteOrganizationRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface DeleteOrganizationResponse { id: string; } export const DeleteOrganizationResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteOrganizationResponse", }) as any as S.Schema; export interface GetBillingUsageRequest { /** Represents a Cloudflare resource identifier tag. */ organizationId: string; /** Start date for the usage query (ISO 8601). Required if `to` is set. When omitted along with `to`, defaults to the start of the current month. Filters by charge period (when consumption happened), not billing period. The maximum date range is 31 days. */ from?: string; /** Filter results by billable metric id (e.g., workers_standard_requests). */ metric?: string; /** End date for the usage query (ISO 8601). Required if `from` is set. When omitted along with `from`, defaults to today. Filters by charge period (when consumption happened), not billing period. The maximum date range is 31 days. */ to?: string; } export const GetBillingUsageRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ organizationId: S.String.pipe(T.Label("organization_id")), from: S.optional(S.String.pipe(T.Query())), metric: S.optional(S.String.pipe(T.Query())), to: S.optional(S.String.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/organizations/{organization_id}/billable/usage", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetBillingUsageRequest", }) as any as S.Schema; export type BillingUsageGetResultItemChargeCategory = "Usage"; export const BillingUsageGetResultItemChargeCategory = /*@__PURE__*/ S.String; export type BillingUsageGetResultItemChargeFrequency = "Usage-Based"; export const BillingUsageGetResultItemChargeFrequency = /*@__PURE__*/ S.String; export type BillingUsageGetResultItemChargeClass = "Correction"; export const BillingUsageGetResultItemChargeClass = /*@__PURE__*/ S.String; export interface BillingUsageGetResultItem { /** Public identifier of the Cloudflare account (account tag). */ billingAccountId: string; /** Display name of the Cloudflare account. */ billingAccountName: string; /** Highest-level classification of a charge based on the nature of how it gets billed. Currently only "Usage" is supported. */ chargeCategory: BillingUsageGetResultItemChargeCategory; /** Self-contained summary of the charge's purpose and price. */ chargeDescription: string; /** Indicates how often a charge occurs. Currently only "Usage-Based" is supported. */ chargeFrequency: BillingUsageGetResultItemChargeFrequency; /** Exclusive end of the time interval during which the usage was consumed. */ chargePeriodEnd: string; /** Inclusive start of the time interval during which the usage was consumed. */ chargePeriodStart: string; /** Measured usage amount within the charge period. Reflects raw metered consumption before pricing transformations. */ consumedQuantity: number; /** Unit of measure for the consumed quantity (e.g., "GB", "Requests", "vCPU-Hours"). */ consumedUnit: string; /** Name of the entity providing the underlying infrastructure or platform. */ hostProviderName: string; /** Name of the entity responsible for invoicing for the services consumed. */ invoiceIssuerName: string; /** Name of the entity that made the services available for purchase. */ serviceProviderName: string; /** The display name of the billable metric. Cloudflare extension; replaces FOCUS SkuMeter. */ xBillableMetricName: string; /** A charge serving as the basis for invoicing, inclusive of all reduced rates and discounts while excluding the amortization of upfront charges (one-time or recurring). */ billedCost?: number | null; /** Currency that a charge was billed in (ISO 4217). */ billingCurrency?: string | null; /** Exclusive end of the billing cycle that contains this usage record. */ billingPeriodEnd?: string | null; /** Inclusive start of the billing cycle that contains this usage record. */ billingPeriodStart?: string | null; /** Indicates whether the row represents a correction to one or more charges invoiced in a previous billing period. */ chargeClass?: BillingUsageGetResultItemChargeClass | null; /** Cost calculated by multiplying ContractedUnitPrice and the corresponding PricingQuantity. */ contractedCost?: number | null; /** The agreed-upon unit price for a single PricingUnit of the associated billable metric, inclusive of negotiated discounts, if present, while excluding any other discounts. */ contractedUnitPrice?: number | null; /** The amortized cost of the charge after applying all reduced rates, discounts, and the applicable portion of relevant, prepaid purchases (one-time or recurring) that covered the charge. */ effectiveCost?: number | null; /** Cost calculated by multiplying ListUnitPrice and the corresponding PricingQuantity. */ listCost?: number | null; /** Suggested provider-published unit price for a single PricingUnit of the associated billable metric, exclusive of any discounts. */ listUnitPrice?: number | null; /** Volume of a given service used or purchased, based on the PricingUnit. */ pricingQuantity?: number | null; /** Provider-specified measurement unit for determining unit prices, indicating how the provider rates measured usage after applying pricing rules like block pricing. */ pricingUnit?: string | null; /** Provider-assigned identifier for an isolated geographic area where a service is provided. */ regionId?: string | null; /** Name of an isolated geographic area where a service is provided. */ regionName?: string | null; /** Unique identifier assigned to a grouping of services. For Cloudflare, this is the subscription or contract ID. */ subAccountId?: string | null; /** Name assigned to a grouping of services. For Cloudflare, this is the subscription or contract display name. */ subAccountName?: string | null; /** The unique identifier for the billable metric in the Cloudflare catalog. Cloudflare extension; replaces FOCUS SkuId. */ xBillableMetricId?: string | null; /** The product family the charge belongs to (e.g., "R2", "Workers"). Cloudflare extension; replaces FOCUS ServiceName. */ xProductFamilyName?: string | null; /** The identifier for the Cloudflare zone (zone tag). Cloudflare extension. */ xZoneId?: string | null; /** The display name of the Cloudflare zone. Cloudflare extension. */ xZoneName?: string | null; } export const BillingUsageGetResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ billingAccountId: S.String.pipe(T.Body("BillingAccountId")), billingAccountName: S.String.pipe(T.Body("BillingAccountName")), chargeCategory: BillingUsageGetResultItemChargeCategory.pipe( T.Body("ChargeCategory"), ), chargeDescription: S.String.pipe(T.Body("ChargeDescription")), chargeFrequency: BillingUsageGetResultItemChargeFrequency.pipe( T.Body("ChargeFrequency"), ), chargePeriodEnd: S.String.pipe(T.Body("ChargePeriodEnd")), chargePeriodStart: S.String.pipe(T.Body("ChargePeriodStart")), consumedQuantity: S.Number.pipe(T.Body("ConsumedQuantity")), consumedUnit: S.String.pipe(T.Body("ConsumedUnit")), hostProviderName: S.String.pipe(T.Body("HostProviderName")), invoiceIssuerName: S.String.pipe(T.Body("InvoiceIssuerName")), serviceProviderName: S.String.pipe(T.Body("ServiceProviderName")), xBillableMetricName: S.String.pipe(T.Body("x_BillableMetricName")), billedCost: S.optional(S.NullOr(S.Number).pipe(T.Body("BilledCost"))), billingCurrency: S.optional( S.NullOr(S.String).pipe(T.Body("BillingCurrency")), ), billingPeriodEnd: S.optional( S.NullOr(S.String).pipe(T.Body("BillingPeriodEnd")), ), billingPeriodStart: S.optional( S.NullOr(S.String).pipe(T.Body("BillingPeriodStart")), ), chargeClass: S.optional( S.NullOr(BillingUsageGetResultItemChargeClass).pipe( T.Body("ChargeClass"), ), ), contractedCost: S.optional( S.NullOr(S.Number).pipe(T.Body("ContractedCost")), ), contractedUnitPrice: S.optional( S.NullOr(S.Number).pipe(T.Body("ContractedUnitPrice")), ), effectiveCost: S.optional(S.NullOr(S.Number).pipe(T.Body("EffectiveCost"))), listCost: S.optional(S.NullOr(S.Number).pipe(T.Body("ListCost"))), listUnitPrice: S.optional(S.NullOr(S.Number).pipe(T.Body("ListUnitPrice"))), pricingQuantity: S.optional( S.NullOr(S.Number).pipe(T.Body("PricingQuantity")), ), pricingUnit: S.optional(S.NullOr(S.String).pipe(T.Body("PricingUnit"))), regionId: S.optional(S.NullOr(S.String).pipe(T.Body("RegionId"))), regionName: S.optional(S.NullOr(S.String).pipe(T.Body("RegionName"))), subAccountId: S.optional(S.NullOr(S.String).pipe(T.Body("SubAccountId"))), subAccountName: S.optional( S.NullOr(S.String).pipe(T.Body("SubAccountName")), ), xBillableMetricId: S.optional( S.NullOr(S.String).pipe(T.Body("x_BillableMetricId")), ), xProductFamilyName: S.optional( S.NullOr(S.String).pipe(T.Body("x_ProductFamilyName")), ), xZoneId: S.optional(S.NullOr(S.String).pipe(T.Body("x_ZoneId"))), xZoneName: S.optional(S.NullOr(S.String).pipe(T.Body("x_ZoneName"))), }), ).annotate({ identifier: "BillingUsageGetResultItem", }) as any as S.Schema; export type BillingUsageGetResultList = Array; export const BillingUsageGetResultList = /*@__PURE__*/ S.Array( BillingUsageGetResultItem, ) as any as S.Schema; export type GetBillingUsageResponse = BillingUsageGetResultList; export const GetBillingUsageResponse = /*@__PURE__*/ S.suspend(() => BillingUsageGetResultList.pipe( T.EnvelopePayloadRoot(), T.KeyDictionary(KEY_DICTIONARY), ), ).annotate({ identifier: "GetBillingUsageResponse", }) as any as S.Schema; export interface GetMemberRequest { organizationId: string; /** Organization Member ID */ memberId: string; } export const GetMemberRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ organizationId: S.String.pipe(T.Label("organization_id")), memberId: S.String.pipe(T.Label("member_id")), }) .pipe( T.Http({ method: "GET", uri: "/organizations/{organization_id}/members/{member_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetMemberRequest", }) as any as S.Schema; export type GetMemberResponseMetaMap = { [key: string]: unknown | undefined }; export const GetMemberResponseMetaMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type GetMemberResponseStatus = "active" | "canceled"; export const GetMemberResponseStatus = /*@__PURE__*/ S.String; export type GetMemberResponseUser = CreateMemberResponseUser; export const GetMemberResponseUser = CreateMemberResponseUser; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetMemberResponse { /** Organization Member ID */ id: string; createTime: string; meta: GetMemberResponseMetaMap; status: GetMemberResponseStatus; updateTime: string; user: CreateMemberResponseUser; } export const GetMemberResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, createTime: S.String.pipe(T.Body("create_time")), meta: GetMemberResponseMetaMap, status: GetMemberResponseStatus, updateTime: S.String.pipe(T.Body("update_time")), user: CreateMemberResponseUser, }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetMemberResponse", }) as any as S.Schema; export interface GetOrganizationRequest { organizationId: string; } export const GetOrganizationRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ organizationId: S.String.pipe(T.Label("organization_id")), }) .pipe( T.Http({ method: "GET", uri: "/organizations/{organization_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetOrganizationRequest", }) as any as S.Schema; export type GetResponseMetaFlags = CreateResponseMetaFlags; export const GetResponseMetaFlags = CreateResponseMetaFlags; export type GetResponseMetaHierarchyTagsList = Array; export const GetResponseMetaHierarchyTagsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface GetResponseMeta { /** Enable features for Organizations. */ flags?: CreateResponseMetaFlags | null; /** Ordered chain of organization tags from the root organization down to */ hierarchyTags?: GetResponseMetaHierarchyTagsList | null; managedBy?: string | null; } export const GetResponseMeta = /*@__PURE__*/ S.suspend(() => S.Struct({ flags: S.optional(S.NullOr(CreateResponseMetaFlags)), hierarchyTags: S.optional( S.NullOr(GetResponseMetaHierarchyTagsList).pipe(T.Body("hierarchy_tags")), ), managedBy: S.optional(S.NullOr(S.String).pipe(T.Body("managed_by"))), }), ).annotate({ identifier: "GetResponseMeta", }) as any as S.Schema; export type GetResponseParent = CreateResponseParent; export const GetResponseParent = CreateResponseParent; export type GetResponseProfile = CreateRequestProfile; export const GetResponseProfile = CreateRequestProfile; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetOrganizationResponse { id: string; createTime: string; meta: GetResponseMeta; name: string; parent?: CreateResponseParent | null; profile?: CreateRequestProfile | null; } export const GetOrganizationResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, createTime: S.String.pipe(T.Body("create_time")), meta: GetResponseMeta, name: S.String, parent: S.optional(S.NullOr(CreateResponseParent)), profile: S.optional(S.NullOr(CreateRequestProfile)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetOrganizationResponse", }) as any as S.Schema; export interface GetOrganizationAccountRequestAccountPubname { /** (case-insensitive) Filter the list of accounts to where the account_pubname contains */ contains?: string; /** (case-insensitive) Filter the list of accounts to where the account_pubname ends with */ endsWith?: string; /** (case-insensitive) Filter the list of accounts to where the account_pubname starts with */ startsWith?: string; } export const GetOrganizationAccountRequestAccountPubname = /*@__PURE__*/ S.suspend(() => S.Struct({ contains: S.optional(S.String), endsWith: S.optional(S.String), startsWith: S.optional(S.String), }), ).annotate({ identifier: "GetOrganizationAccountRequestAccountPubname", }) as any as S.Schema; export type GetOrganizationAccountRequestDirection = "asc" | "desc"; export const GetOrganizationAccountRequestDirection = /*@__PURE__*/ S.String; export interface GetOrganizationAccountRequestName { /** (case-insensitive) Filter the list of accounts to where the name contains a particular */ contains?: string; /** (case-insensitive) Filter the list of accounts to where the name ends with a particular */ endsWith?: string; /** (case-insensitive) Filter the list of accounts to where the name starts with a */ startsWith?: string; } export const GetOrganizationAccountRequestName = /*@__PURE__*/ S.suspend(() => S.Struct({ contains: S.optional(S.String), endsWith: S.optional(S.String), startsWith: S.optional(S.String), }), ).annotate({ identifier: "GetOrganizationAccountRequestName", }) as any as S.Schema; export type GetOrganizationAccountRequestOrderBy = "account_name"; export const GetOrganizationAccountRequestOrderBy = /*@__PURE__*/ S.String; export interface GetOrganizationAccountRequest { organizationId: string; accountPubname?: GetOrganizationAccountRequestAccountPubname; /** Sort direction for the order_by field. Valid values: `asc`, `desc`. */ direction?: GetOrganizationAccountRequestDirection | (string & {}); name?: GetOrganizationAccountRequestName; /** Field to order results by. Currently supported values: `account_name`. */ orderBy?: GetOrganizationAccountRequestOrderBy | (string & {}); /** The amount of items to return. Defaults to 10. */ pageSize?: number; /** An opaque token returned from the last list response that when */ pageToken?: string; } export const GetOrganizationAccountRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ organizationId: S.String.pipe(T.Label("organization_id")), accountPubname: S.optional( GetOrganizationAccountRequestAccountPubname.pipe( T.Body("account_pubname"), T.DeepQuery("account_pubname"), ), ), direction: S.optional( GetOrganizationAccountRequestDirection.pipe(T.Query()), ), name: S.optional( GetOrganizationAccountRequestName.pipe(T.DeepQuery("name")), ), orderBy: S.optional( GetOrganizationAccountRequestOrderBy.pipe(T.Query("order_by")), ), pageSize: S.optional(S.Number.pipe(T.Query("page_size"))), pageToken: S.optional(S.String.pipe(T.Query("page_token"))), }) .pipe( T.Http({ method: "GET", uri: "/organizations/{organization_id}/accounts", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetOrganizationAccountRequest", }) as any as S.Schema; export interface GetOrganizationAccountResultItemSettings { abuseContactEmail: string; accessApprovalExpiry: string; apiAccessEnabled: boolean; /** Use [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-list-dns-settings) instead. Deprecated. */ defaultNameservers: string; enforceTwofactor: boolean; /** Use [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-list-dns-settings) instead. Deprecated. */ useAccountCustomNsByDefault: boolean; } export const GetOrganizationAccountResultItemSettings = /*@__PURE__*/ S.suspend( () => S.Struct({ abuseContactEmail: S.String.pipe(T.Body("abuse_contact_email")), accessApprovalExpiry: S.String.pipe(T.Body("access_approval_expiry")), apiAccessEnabled: S.Boolean.pipe(T.Body("api_access_enabled")), defaultNameservers: S.String.pipe(T.Body("default_nameservers")), enforceTwofactor: S.Boolean.pipe(T.Body("enforce_twofactor")), useAccountCustomNsByDefault: S.Boolean.pipe( T.Body("use_account_custom_ns_by_default"), ), }), ).annotate({ identifier: "GetOrganizationAccountResultItemSettings", }) as any as S.Schema; export type GetOrganizationAccountResultItemType = "standard" | "enterprise"; export const GetOrganizationAccountResultItemType = /*@__PURE__*/ S.String; export interface GetOrganizationAccountResultItem { id: string; createdOn: string; name: string; settings: GetOrganizationAccountResultItemSettings; type: GetOrganizationAccountResultItemType; } export const GetOrganizationAccountResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, createdOn: S.String.pipe(T.Body("created_on")), name: S.String, settings: GetOrganizationAccountResultItemSettings, type: GetOrganizationAccountResultItemType, }), ).annotate({ identifier: "GetOrganizationAccountResultItem", }) as any as S.Schema; export type GetOrganizationAccountResultList = Array; export const GetOrganizationAccountResultList = /*@__PURE__*/ S.Array( GetOrganizationAccountResultItem, ) as any as S.Schema; export type GetOrganizationAccountResponse = GetOrganizationAccountResultList; export const GetOrganizationAccountResponse = /*@__PURE__*/ S.suspend(() => GetOrganizationAccountResultList.pipe( T.EnvelopePayloadRoot(), T.KeyDictionary(KEY_DICTIONARY), ), ).annotate({ identifier: "GetOrganizationAccountResponse", }) as any as S.Schema; export interface GetOrganizationProfileRequest { organizationId: string; } export const GetOrganizationProfileRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ organizationId: S.String.pipe(T.Label("organization_id")), }) .pipe( T.Http({ method: "GET", uri: "/organizations/{organization_id}/profile", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetOrganizationProfileRequest", }) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetOrganizationProfileResponse { businessAddress: string; businessEmail: string; businessName: string; businessPhone: string; externalMetadata: string; } export const GetOrganizationProfileResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ businessAddress: S.String.pipe(T.Body("business_address")), businessEmail: S.String.pipe(T.Body("business_email")), businessName: S.String.pipe(T.Body("business_name")), businessPhone: S.String.pipe(T.Body("business_phone")), externalMetadata: S.String.pipe(T.Body("external_metadata")), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetOrganizationProfileResponse", }) as any as S.Schema; export type LogsAuditListRequestIdNotList = Array; export const LogsAuditListRequestIdNotList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface LogsAuditListRequestId { /** Filters out audit logs by their IDs. */ not?: LogsAuditListRequestIdNotList; } export const LogsAuditListRequestId = /*@__PURE__*/ S.suspend(() => S.Struct({ not: S.optional(LogsAuditListRequestIdNotList), }), ).annotate({ identifier: "LogsAuditListRequestId", }) as any as S.Schema; export type LogsAuditListRequestActionResultNotItem = "success" | "failure"; export const LogsAuditListRequestActionResultNotItem = /*@__PURE__*/ S.String; export type LogsAuditListRequestActionResultNotList = Array< LogsAuditListRequestActionResultNotItem | (string & {}) >; export const LogsAuditListRequestActionResultNotList = /*@__PURE__*/ S.Array( LogsAuditListRequestActionResultNotItem, ) as any as S.Schema; export interface LogsAuditListRequestActionResult { /** Filters out audit logs by whether the action was successful or not. */ not?: LogsAuditListRequestActionResultNotList; } export const LogsAuditListRequestActionResult = /*@__PURE__*/ S.suspend(() => S.Struct({ not: S.optional(LogsAuditListRequestActionResultNotList), }), ).annotate({ identifier: "LogsAuditListRequestActionResult", }) as any as S.Schema; export type LogsAuditListRequestActionTypeNotItem = | "create" | "delete" | "view" | "update"; export const LogsAuditListRequestActionTypeNotItem = /*@__PURE__*/ S.String; export type LogsAuditListRequestActionTypeNotList = Array< LogsAuditListRequestActionTypeNotItem | (string & {}) >; export const LogsAuditListRequestActionTypeNotList = /*@__PURE__*/ S.Array( LogsAuditListRequestActionTypeNotItem, ) as any as S.Schema; export interface LogsAuditListRequestActionType { /** Filters out audit logs by the action type. */ not?: LogsAuditListRequestActionTypeNotList; } export const LogsAuditListRequestActionType = /*@__PURE__*/ S.suspend(() => S.Struct({ not: S.optional(LogsAuditListRequestActionTypeNotList), }), ).annotate({ identifier: "LogsAuditListRequestActionType", }) as any as S.Schema; export type LogsAuditListRequestActorContextNotItem = | "api_key" | "api_token" | "dash" | "oauth" | "origin_ca_key"; export const LogsAuditListRequestActorContextNotItem = /*@__PURE__*/ S.String; export type LogsAuditListRequestActorContextNotList = Array< LogsAuditListRequestActorContextNotItem | (string & {}) >; export const LogsAuditListRequestActorContextNotList = /*@__PURE__*/ S.Array( LogsAuditListRequestActorContextNotItem, ) as any as S.Schema; export interface LogsAuditListRequestActorContext { /** Filters out audit logs by the actor context. */ not?: LogsAuditListRequestActorContextNotList; } export const LogsAuditListRequestActorContext = /*@__PURE__*/ S.suspend(() => S.Struct({ not: S.optional(LogsAuditListRequestActorContextNotList), }), ).annotate({ identifier: "LogsAuditListRequestActorContext", }) as any as S.Schema; export type LogsAuditListRequestActorEmailNotList = Array; export const LogsAuditListRequestActorEmailNotList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface LogsAuditListRequestActorEmail { /** Filters out audit logs by the actor's email address. */ not?: LogsAuditListRequestActorEmailNotList; } export const LogsAuditListRequestActorEmail = /*@__PURE__*/ S.suspend(() => S.Struct({ not: S.optional(LogsAuditListRequestActorEmailNotList), }), ).annotate({ identifier: "LogsAuditListRequestActorEmail", }) as any as S.Schema; export type LogsAuditListRequestActorIdNotList = Array; export const LogsAuditListRequestActorIdNotList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface LogsAuditListRequestActorId { /** Filters out audit logs by the actor's user ID. */ not?: LogsAuditListRequestActorIdNotList; } export const LogsAuditListRequestActorId = /*@__PURE__*/ S.suspend(() => S.Struct({ not: S.optional(LogsAuditListRequestActorIdNotList), }), ).annotate({ identifier: "LogsAuditListRequestActorId", }) as any as S.Schema; export type LogsAuditListRequestActorIpAddressNotList = Array; export const LogsAuditListRequestActorIpAddressNotList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface LogsAuditListRequestActorIpAddress { /** Filters out audit logs IP address where the action was initiated. */ not?: LogsAuditListRequestActorIpAddressNotList; } export const LogsAuditListRequestActorIpAddress = /*@__PURE__*/ S.suspend(() => S.Struct({ not: S.optional(LogsAuditListRequestActorIpAddressNotList), }), ).annotate({ identifier: "LogsAuditListRequestActorIpAddress", }) as any as S.Schema; export type LogsAuditListRequestActorTokenIdNotList = Array; export const LogsAuditListRequestActorTokenIdNotList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface LogsAuditListRequestActorTokenId { /** Filters out audit logs by the API token ID when the actor context is an api_token or oauth. */ not?: LogsAuditListRequestActorTokenIdNotList; } export const LogsAuditListRequestActorTokenId = /*@__PURE__*/ S.suspend(() => S.Struct({ not: S.optional(LogsAuditListRequestActorTokenIdNotList), }), ).annotate({ identifier: "LogsAuditListRequestActorTokenId", }) as any as S.Schema; export type LogsAuditListRequestActorTokenNameNotList = Array; export const LogsAuditListRequestActorTokenNameNotList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface LogsAuditListRequestActorTokenName { /** Filters out audit logs by the API token name when the actor context is an api_token or oauth. */ not?: LogsAuditListRequestActorTokenNameNotList; } export const LogsAuditListRequestActorTokenName = /*@__PURE__*/ S.suspend(() => S.Struct({ not: S.optional(LogsAuditListRequestActorTokenNameNotList), }), ).annotate({ identifier: "LogsAuditListRequestActorTokenName", }) as any as S.Schema; export type LogsAuditListRequestActorTypeNotItem = | "cloudflare_admin" | "system" | "user"; export const LogsAuditListRequestActorTypeNotItem = /*@__PURE__*/ S.String; export type LogsAuditListRequestActorTypeNotList = Array< LogsAuditListRequestActorTypeNotItem | (string & {}) >; export const LogsAuditListRequestActorTypeNotList = /*@__PURE__*/ S.Array( LogsAuditListRequestActorTypeNotItem, ) as any as S.Schema; export interface LogsAuditListRequestActorType { /** Filters out audit logs by the actor type. */ not?: LogsAuditListRequestActorTypeNotList; } export const LogsAuditListRequestActorType = /*@__PURE__*/ S.suspend(() => S.Struct({ not: S.optional(LogsAuditListRequestActorTypeNotList), }), ).annotate({ identifier: "LogsAuditListRequestActorType", }) as any as S.Schema; export type LogsAuditListRequestDirection = "desc" | "asc"; export const LogsAuditListRequestDirection = /*@__PURE__*/ S.String; export type LogsAuditListRequestRawCfRayIdNotList = Array; export const LogsAuditListRequestRawCfRayIdNotList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface LogsAuditListRequestRawCfRayId { /** Filters out audit logs by the response CF Ray ID. */ not?: LogsAuditListRequestRawCfRayIdNotList; } export const LogsAuditListRequestRawCfRayId = /*@__PURE__*/ S.suspend(() => S.Struct({ not: S.optional(LogsAuditListRequestRawCfRayIdNotList), }), ).annotate({ identifier: "LogsAuditListRequestRawCfRayId", }) as any as S.Schema; export type LogsAuditListRequestRawMethodNotList = Array; export const LogsAuditListRequestRawMethodNotList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface LogsAuditListRequestRawMethod { /** Filters out audit logs by the HTTP method for the API call. */ not?: LogsAuditListRequestRawMethodNotList; } export const LogsAuditListRequestRawMethod = /*@__PURE__*/ S.suspend(() => S.Struct({ not: S.optional(LogsAuditListRequestRawMethodNotList), }), ).annotate({ identifier: "LogsAuditListRequestRawMethod", }) as any as S.Schema; export type LogsAuditListRequestRawStatusCodeNotList = Array; export const LogsAuditListRequestRawStatusCodeNotList = /*@__PURE__*/ S.Array( S.Number, ) as any as S.Schema; export interface LogsAuditListRequestRawStatusCode { /** Filters out audit logs by the response status code that was returned. */ not?: LogsAuditListRequestRawStatusCodeNotList; } export const LogsAuditListRequestRawStatusCode = /*@__PURE__*/ S.suspend(() => S.Struct({ not: S.optional(LogsAuditListRequestRawStatusCodeNotList), }), ).annotate({ identifier: "LogsAuditListRequestRawStatusCode", }) as any as S.Schema; export type LogsAuditListRequestRawUriNotList = Array; export const LogsAuditListRequestRawUriNotList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface LogsAuditListRequestRawUri { /** Filters out audit logs by the request URI. */ not?: LogsAuditListRequestRawUriNotList; } export const LogsAuditListRequestRawUri = /*@__PURE__*/ S.suspend(() => S.Struct({ not: S.optional(LogsAuditListRequestRawUriNotList), }), ).annotate({ identifier: "LogsAuditListRequestRawUri", }) as any as S.Schema; export type LogsAuditListRequestResourceIdNotList = Array; export const LogsAuditListRequestResourceIdNotList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface LogsAuditListRequestResourceId { /** Filters out audit logs by the resource ID. */ not?: LogsAuditListRequestResourceIdNotList; } export const LogsAuditListRequestResourceId = /*@__PURE__*/ S.suspend(() => S.Struct({ not: S.optional(LogsAuditListRequestResourceIdNotList), }), ).annotate({ identifier: "LogsAuditListRequestResourceId", }) as any as S.Schema; export type LogsAuditListRequestResourceProductNotList = Array; export const LogsAuditListRequestResourceProductNotList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface LogsAuditListRequestResourceProduct { /** Filters out audit logs by the Cloudflare product associated with the changed resource. */ not?: LogsAuditListRequestResourceProductNotList; } export const LogsAuditListRequestResourceProduct = /*@__PURE__*/ S.suspend(() => S.Struct({ not: S.optional(LogsAuditListRequestResourceProductNotList), }), ).annotate({ identifier: "LogsAuditListRequestResourceProduct", }) as any as S.Schema; export type LogsAuditListRequestResourceScopeNotItem = "organizations"; export const LogsAuditListRequestResourceScopeNotItem = /*@__PURE__*/ S.String; export type LogsAuditListRequestResourceScopeNotList = Array< LogsAuditListRequestResourceScopeNotItem | (string & {}) >; export const LogsAuditListRequestResourceScopeNotList = /*@__PURE__*/ S.Array( LogsAuditListRequestResourceScopeNotItem, ) as any as S.Schema; export interface LogsAuditListRequestResourceScope { /** Filters out audit logs by the resource scope, specifying whether the resource is associated with an organization. */ not?: LogsAuditListRequestResourceScopeNotList; } export const LogsAuditListRequestResourceScope = /*@__PURE__*/ S.suspend(() => S.Struct({ not: S.optional(LogsAuditListRequestResourceScopeNotList), }), ).annotate({ identifier: "LogsAuditListRequestResourceScope", }) as any as S.Schema; export type LogsAuditListRequestResourceTypeNotList = Array; export const LogsAuditListRequestResourceTypeNotList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface LogsAuditListRequestResourceType { /** Filters out audit logs based on the unique type of resource changed by the action. */ not?: LogsAuditListRequestResourceTypeNotList; } export const LogsAuditListRequestResourceType = /*@__PURE__*/ S.suspend(() => S.Struct({ not: S.optional(LogsAuditListRequestResourceTypeNotList), }), ).annotate({ identifier: "LogsAuditListRequestResourceType", }) as any as S.Schema; export interface ListLogAuditsRequest { /** The unique id that identifies the organization. */ organizationId: string; /** Limits the returned results to logs older than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339. */ before: string; /** Limits the returned results to logs newer than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339. */ since: string; id?: LogsAuditListRequestId; actionResult?: LogsAuditListRequestActionResult; actionType?: LogsAuditListRequestActionType; actorContext?: LogsAuditListRequestActorContext; actorEmail?: LogsAuditListRequestActorEmail; actorId?: LogsAuditListRequestActorId; actorIpAddress?: LogsAuditListRequestActorIpAddress; actorTokenId?: LogsAuditListRequestActorTokenId; actorTokenName?: LogsAuditListRequestActorTokenName; actorType?: LogsAuditListRequestActorType; /** The cursor is an opaque token used to paginate through large sets of records. It indicates the position from which to continue when requesting the next set of records. A valid cursor value can be obtained from the cursor object in the result_info structure of a previous response. */ cursor?: string; /** Sets sorting order. */ direction?: LogsAuditListRequestDirection | (string & {}); /** The number limits the objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit. */ limit?: number; rawCfRayId?: LogsAuditListRequestRawCfRayId; rawMethod?: LogsAuditListRequestRawMethod; rawStatusCode?: LogsAuditListRequestRawStatusCode; rawUri?: LogsAuditListRequestRawUri; resourceId?: LogsAuditListRequestResourceId; resourceProduct?: LogsAuditListRequestResourceProduct; resourceScope?: LogsAuditListRequestResourceScope; resourceType?: LogsAuditListRequestResourceType; } export const ListLogAuditsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ organizationId: S.String.pipe(T.Label("organization_id")), before: S.String.pipe(T.Query()), since: S.String.pipe(T.Query()), id: S.optional(LogsAuditListRequestId.pipe(T.DeepQuery("id"))), actionResult: S.optional( LogsAuditListRequestActionResult.pipe( T.Body("action_result"), T.DeepQuery("action_result"), ), ), actionType: S.optional( LogsAuditListRequestActionType.pipe( T.Body("action_type"), T.DeepQuery("action_type"), ), ), actorContext: S.optional( LogsAuditListRequestActorContext.pipe( T.Body("actor_context"), T.DeepQuery("actor_context"), ), ), actorEmail: S.optional( LogsAuditListRequestActorEmail.pipe( T.Body("actor_email"), T.DeepQuery("actor_email"), ), ), actorId: S.optional( LogsAuditListRequestActorId.pipe( T.Body("actor_id"), T.DeepQuery("actor_id"), ), ), actorIpAddress: S.optional( LogsAuditListRequestActorIpAddress.pipe( T.Body("actor_ip_address"), T.DeepQuery("actor_ip_address"), ), ), actorTokenId: S.optional( LogsAuditListRequestActorTokenId.pipe( T.Body("actor_token_id"), T.DeepQuery("actor_token_id"), ), ), actorTokenName: S.optional( LogsAuditListRequestActorTokenName.pipe( T.Body("actor_token_name"), T.DeepQuery("actor_token_name"), ), ), actorType: S.optional( LogsAuditListRequestActorType.pipe( T.Body("actor_type"), T.DeepQuery("actor_type"), ), ), cursor: S.optional(S.String.pipe(T.Query())), direction: S.optional(LogsAuditListRequestDirection.pipe(T.Query())), limit: S.optional(S.Number.pipe(T.Query())), rawCfRayId: S.optional( LogsAuditListRequestRawCfRayId.pipe( T.Body("raw_cf_ray_id"), T.DeepQuery("raw_cf_ray_id"), ), ), rawMethod: S.optional( LogsAuditListRequestRawMethod.pipe( T.Body("raw_method"), T.DeepQuery("raw_method"), ), ), rawStatusCode: S.optional( LogsAuditListRequestRawStatusCode.pipe( T.Body("raw_status_code"), T.DeepQuery("raw_status_code"), ), ), rawUri: S.optional( LogsAuditListRequestRawUri.pipe( T.Body("raw_uri"), T.DeepQuery("raw_uri"), ), ), resourceId: S.optional( LogsAuditListRequestResourceId.pipe( T.Body("resource_id"), T.DeepQuery("resource_id"), ), ), resourceProduct: S.optional( LogsAuditListRequestResourceProduct.pipe( T.Body("resource_product"), T.DeepQuery("resource_product"), ), ), resourceScope: S.optional( LogsAuditListRequestResourceScope.pipe( T.Body("resource_scope"), T.DeepQuery("resource_scope"), ), ), resourceType: S.optional( LogsAuditListRequestResourceType.pipe( T.Body("resource_type"), T.DeepQuery("resource_type"), ), ), }) .pipe( T.Http({ method: "GET", uri: "/organizations/{organization_id}/logs/audit", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListLogAuditsRequest", }) as any as S.Schema; export interface LogsAuditListResultItemAction { /** A short description of the action performed. */ description?: string | null; /** The result of the action, indicating success or failure. */ result?: string | null; /** A timestamp indicating when the action was logged. */ time?: string | null; /** A short string that describes the action that was performed. */ type?: string | null; } export const LogsAuditListResultItemAction = /*@__PURE__*/ S.suspend(() => S.Struct({ description: S.optional(S.NullOr(S.String)), result: S.optional(S.NullOr(S.String)), time: S.optional(S.NullOr(S.String)), type: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "LogsAuditListResultItemAction", }) as any as S.Schema; export type LogsAuditListResultItemActorContext = | "api_key" | "api_token" | "dash" | "oauth" | "origin_ca_key"; export const LogsAuditListResultItemActorContext = /*@__PURE__*/ S.String; export type LogsAuditListResultItemActorType = | "cloudflare_admin" | "system" | "user"; export const LogsAuditListResultItemActorType = /*@__PURE__*/ S.String; export interface LogsAuditListResultItemActor { /** The ID of the actor who performed the action. If a user performed the action, this will be their User ID. */ id?: string | null; context?: LogsAuditListResultItemActorContext | null; /** The email of the actor who performed the action. */ email?: string | null; /** The IP address of the request that performed the action. */ ipAddress?: string | null; /** The API token ID when the actor context is an api_token or oauth. */ tokenId?: string | null; /** The API token name when the actor context is an api_token or oauth. */ tokenName?: string | null; /** The type of actor. */ type?: LogsAuditListResultItemActorType | null; } export const LogsAuditListResultItemActor = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), context: S.optional(S.NullOr(LogsAuditListResultItemActorContext)), email: S.optional(S.NullOr(S.String)), ipAddress: S.optional(S.NullOr(S.String).pipe(T.Body("ip_address"))), tokenId: S.optional(S.NullOr(S.String).pipe(T.Body("token_id"))), tokenName: S.optional(S.NullOr(S.String).pipe(T.Body("token_name"))), type: S.optional(S.NullOr(LogsAuditListResultItemActorType)), }), ).annotate({ identifier: "LogsAuditListResultItemActor", }) as any as S.Schema; export interface LogsAuditListResultItemOrganization { /** A unique identifier for the organization. */ id?: string | null; } export const LogsAuditListResultItemOrganization = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "LogsAuditListResultItemOrganization", }) as any as S.Schema; export interface LogsAuditListResultItemRaw { /** The Cloudflare Ray ID for the request. */ cfRayId?: string | null; /** The HTTP method of the request. */ method?: string | null; /** The HTTP response status code returned by the API. */ statusCode?: number | null; /** The URI of the request. */ uri?: string | null; /** The client's user agent string sent with the request. */ userAgent?: string | null; } export const LogsAuditListResultItemRaw = /*@__PURE__*/ S.suspend(() => S.Struct({ cfRayId: S.optional(S.NullOr(S.String).pipe(T.Body("cf_ray_id"))), method: S.optional(S.NullOr(S.String)), statusCode: S.optional(S.NullOr(S.Number).pipe(T.Body("status_code"))), uri: S.optional(S.NullOr(S.String)), userAgent: S.optional(S.NullOr(S.String).pipe(T.Body("user_agent"))), }), ).annotate({ identifier: "LogsAuditListResultItemRaw", }) as any as S.Schema; export interface LogsAuditListResultItemResource { /** The unique identifier for the affected resource. */ id?: string | null; /** The Cloudflare product associated with the resource. */ product?: string | null; request?: unknown | null; response?: unknown | null; /** The scope of the resource. */ scope?: unknown | null; /** The type of the resource. */ type?: string | null; } export const LogsAuditListResultItemResource = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), product: S.optional(S.NullOr(S.String)), request: S.optional(S.NullOr(S.Unknown)), response: S.optional(S.NullOr(S.Unknown)), scope: S.optional(S.NullOr(S.Unknown)), type: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "LogsAuditListResultItemResource", }) as any as S.Schema; export interface LogsAuditListResultItem { /** A unique identifier for the audit log entry. */ id?: string | null; /** Provides information about the action performed. */ action?: LogsAuditListResultItemAction | null; /** Provides details about the actor who performed the action. */ actor?: LogsAuditListResultItemActor | null; /** Contains organization related information. */ organization?: LogsAuditListResultItemOrganization | null; /** Provides raw information about the request and response. */ raw?: LogsAuditListResultItemRaw | null; /** Provides details about the affected resource. */ resource?: LogsAuditListResultItemResource | null; } export const LogsAuditListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), action: S.optional(S.NullOr(LogsAuditListResultItemAction)), actor: S.optional(S.NullOr(LogsAuditListResultItemActor)), organization: S.optional(S.NullOr(LogsAuditListResultItemOrganization)), raw: S.optional(S.NullOr(LogsAuditListResultItemRaw)), resource: S.optional(S.NullOr(LogsAuditListResultItemResource)), }), ).annotate({ identifier: "LogsAuditListResultItem", }) as any as S.Schema; export type LogsAuditListResultList = Array; export const LogsAuditListResultList = /*@__PURE__*/ S.Array( LogsAuditListResultItem, ) as any as S.Schema; export interface ListLogAuditsResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: LogsAuditListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListLogAuditsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: LogsAuditListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListLogAuditsResponse", }) as any as S.Schema; export type ListMembersRequestStatus = "active" | "canceled"; export const ListMembersRequestStatus = /*@__PURE__*/ S.String; export type ListMembersRequestStatusList = Array< ListMembersRequestStatus | (string & {}) >; export const ListMembersRequestStatusList = /*@__PURE__*/ S.Array( ListMembersRequestStatus, ) as any as S.Schema; export interface ListMembersRequestUser { /** Filter the list of memberships for a specific email that ends with a substring. */ email?: string; } export const ListMembersRequestUser = /*@__PURE__*/ S.suspend(() => S.Struct({ email: S.optional(S.String), }), ).annotate({ identifier: "ListMembersRequestUser", }) as any as S.Schema; export interface ListMembersRequest { organizationId: string; /** The amount of items to return. Defaults to 10. */ pageSize?: number; /** An opaque token returned from the last list response that when */ pageToken?: string; /** Filter the list of memberships by membership status. */ status?: ListMembersRequestStatusList; user?: ListMembersRequestUser; } export const ListMembersRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ organizationId: S.String.pipe(T.Label("organization_id")), pageSize: S.optional(S.Number.pipe(T.Query("page_size"))), pageToken: S.optional(S.String.pipe(T.Query("page_token"))), status: S.optional(ListMembersRequestStatusList.pipe(T.Query())), user: S.optional(ListMembersRequestUser.pipe(T.DeepQuery("user"))), }) .pipe( T.Http({ method: "GET", uri: "/organizations/{organization_id}/members", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListMembersRequest", }) as any as S.Schema; export type ListMembersResultItemMetaMap = { [key: string]: unknown | undefined; }; export const ListMembersResultItemMetaMap = /*@__PURE__*/ S.Record( S.String, S.Unknown, ) as any as S.Schema; export type ListMembersResultItemStatus = "active" | "canceled"; export const ListMembersResultItemStatus = /*@__PURE__*/ S.String; export type ListMembersResultItemUser = CreateMemberResponseUser; export const ListMembersResultItemUser = CreateMemberResponseUser; export interface ListMembersResultItem { /** Organization Member ID */ id: string; createTime: string; meta: ListMembersResultItemMetaMap; status: ListMembersResultItemStatus; updateTime: string; user: CreateMemberResponseUser; } export const ListMembersResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, createTime: S.String.pipe(T.Body("create_time")), meta: ListMembersResultItemMetaMap, status: ListMembersResultItemStatus, updateTime: S.String.pipe(T.Body("update_time")), user: CreateMemberResponseUser, }), ).annotate({ identifier: "ListMembersResultItem", }) as any as S.Schema; export type ListMembersResultList = Array; export const ListMembersResultList = /*@__PURE__*/ S.Array( ListMembersResultItem, ) as any as S.Schema; export type ListMembersResponse = ListMembersResultList; export const ListMembersResponse = /*@__PURE__*/ S.suspend(() => ListMembersResultList.pipe( T.EnvelopePayloadRoot(), T.KeyDictionary(KEY_DICTIONARY), ), ).annotate({ identifier: "ListMembersResponse", }) as any as S.Schema; export type ListRequestIdList = Array; export const ListRequestIdList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface ListRequestContaining { /** Filter the list of organizations to the ones that contain this particular */ account?: string; /** Filter the list of organizations to the ones that contain this particular */ organization?: string; /** Filter the list of organizations to the ones that contain this particular */ user?: string; } export const ListRequestContaining = /*@__PURE__*/ S.suspend(() => S.Struct({ account: S.optional(S.String), organization: S.optional(S.String), user: S.optional(S.String), }), ).annotate({ identifier: "ListRequestContaining", }) as any as S.Schema; export interface ListRequestName { /** (case-insensitive) Filter the list of organizations to where the name contains a particular */ contains?: string; /** (case-insensitive) Filter the list of organizations to where the name ends with a particular */ endsWith?: string; /** (case-insensitive) Filter the list of organizations to where the name starts with a */ startsWith?: string; } export const ListRequestName = /*@__PURE__*/ S.suspend(() => S.Struct({ contains: S.optional(S.String), endsWith: S.optional(S.String), startsWith: S.optional(S.String), }), ).annotate({ identifier: "ListRequestName", }) as any as S.Schema; export interface ListRequestParent { /** Filter the list of organizations to the ones that are a sub-organization */ id?: string; } export const ListRequestParent = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(S.String), }), ).annotate({ identifier: "ListRequestParent", }) as any as S.Schema; export interface ListOrganizationsRequest { /** Only return organizations with the specified IDs (ex. id=foo&id=bar). Send multiple elements */ id?: ListRequestIdList; containing?: ListRequestContaining; name?: ListRequestName; /** The amount of items to return. Defaults to 10. */ pageSize?: number; /** An opaque token returned from the last list response that when */ pageToken?: string; parent?: ListRequestParent; } export const ListOrganizationsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.optional(ListRequestIdList.pipe(T.Query())), containing: S.optional( ListRequestContaining.pipe(T.DeepQuery("containing")), ), name: S.optional(ListRequestName.pipe(T.DeepQuery("name"))), pageSize: S.optional(S.Number.pipe(T.Query("page_size"))), pageToken: S.optional(S.String.pipe(T.Query("page_token"))), parent: S.optional(ListRequestParent.pipe(T.DeepQuery("parent"))), }) .pipe(T.Http({ method: "GET", uri: "/organizations", code: 200 })) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListOrganizationsRequest", }) as any as S.Schema; export type ListResultItemMetaFlags = CreateResponseMetaFlags; export const ListResultItemMetaFlags = CreateResponseMetaFlags; export type ListResultItemMetaHierarchyTagsList = Array; export const ListResultItemMetaHierarchyTagsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface ListResultItemMeta { /** Enable features for Organizations. */ flags?: CreateResponseMetaFlags | null; /** Ordered chain of organization tags from the root organization down to */ hierarchyTags?: ListResultItemMetaHierarchyTagsList | null; managedBy?: string | null; } export const ListResultItemMeta = /*@__PURE__*/ S.suspend(() => S.Struct({ flags: S.optional(S.NullOr(CreateResponseMetaFlags)), hierarchyTags: S.optional( S.NullOr(ListResultItemMetaHierarchyTagsList).pipe( T.Body("hierarchy_tags"), ), ), managedBy: S.optional(S.NullOr(S.String).pipe(T.Body("managed_by"))), }), ).annotate({ identifier: "ListResultItemMeta", }) as any as S.Schema; export type ListResultItemParent = CreateResponseParent; export const ListResultItemParent = CreateResponseParent; export type ListResultItemProfile = CreateRequestProfile; export const ListResultItemProfile = CreateRequestProfile; export interface ListResultItem { id: string; createTime: string; meta: ListResultItemMeta; name: string; parent?: CreateResponseParent | null; profile?: CreateRequestProfile | null; } export const ListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, createTime: S.String.pipe(T.Body("create_time")), meta: ListResultItemMeta, name: S.String, parent: S.optional(S.NullOr(CreateResponseParent)), profile: S.optional(S.NullOr(CreateRequestProfile)), }), ).annotate({ identifier: "ListResultItem" }) as any as S.Schema; export type ListResultList = Array; export const ListResultList = /*@__PURE__*/ S.Array( ListResultItem, ) as any as S.Schema; export interface ListOrganizationsResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: ListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListOrganizationsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: ListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListOrganizationsResponse", }) as any as S.Schema; export interface PutOrganizationProfileRequest { organizationId: string; businessAddress: string; businessEmail: string; businessName: string; businessPhone: string; externalMetadata: string; } export const PutOrganizationProfileRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ organizationId: S.String.pipe(T.Label("organization_id")), businessAddress: S.String.pipe(T.Body("business_address")), businessEmail: S.String.pipe(T.Body("business_email")), businessName: S.String.pipe(T.Body("business_name")), businessPhone: S.String.pipe(T.Body("business_phone")), externalMetadata: S.String.pipe(T.Body("external_metadata")), }) .pipe( T.Http({ method: "PUT", uri: "/organizations/{organization_id}/profile", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PutOrganizationProfileRequest", }) as any as S.Schema; export interface PutOrganizationProfileResponse {} export const PutOrganizationProfileResponse = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "PutOrganizationProfileResponse", }) as any as S.Schema; export type UpdateRequestParent = CreateRequestParent; export const UpdateRequestParent = CreateRequestParent; export type UpdateRequestProfile = CreateRequestProfile; export const UpdateRequestProfile = CreateRequestProfile; export interface UpdateOrganizationRequest { organizationId: string; name: string; parent?: CreateRequestParent; profile?: CreateRequestProfile; } export const UpdateOrganizationRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ organizationId: S.String.pipe(T.Label("organization_id")), name: S.String, parent: S.optional(CreateRequestParent), profile: S.optional(CreateRequestProfile), }) .pipe( T.Http({ method: "PUT", uri: "/organizations/{organization_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateOrganizationRequest", }) as any as S.Schema; export type UpdateResponseMetaFlags = CreateResponseMetaFlags; export const UpdateResponseMetaFlags = CreateResponseMetaFlags; export type UpdateResponseMetaHierarchyTagsList = Array; export const UpdateResponseMetaHierarchyTagsList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export interface UpdateResponseMeta { /** Enable features for Organizations. */ flags?: CreateResponseMetaFlags | null; /** Ordered chain of organization tags from the root organization down to */ hierarchyTags?: UpdateResponseMetaHierarchyTagsList | null; managedBy?: string | null; } export const UpdateResponseMeta = /*@__PURE__*/ S.suspend(() => S.Struct({ flags: S.optional(S.NullOr(CreateResponseMetaFlags)), hierarchyTags: S.optional( S.NullOr(UpdateResponseMetaHierarchyTagsList).pipe( T.Body("hierarchy_tags"), ), ), managedBy: S.optional(S.NullOr(S.String).pipe(T.Body("managed_by"))), }), ).annotate({ identifier: "UpdateResponseMeta", }) as any as S.Schema; export type UpdateResponseParent = CreateResponseParent; export const UpdateResponseParent = CreateResponseParent; export type UpdateResponseProfile = CreateRequestProfile; export const UpdateResponseProfile = CreateRequestProfile; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface UpdateOrganizationResponse { id: string; createTime: string; meta: UpdateResponseMeta; name: string; parent?: CreateResponseParent | null; profile?: CreateRequestProfile | null; } export const UpdateOrganizationResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, createTime: S.String.pipe(T.Body("create_time")), meta: UpdateResponseMeta, name: S.String, parent: S.optional(S.NullOr(CreateResponseParent)), profile: S.optional(S.NullOr(CreateRequestProfile)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateOrganizationResponse", }) as any as S.Schema; export type CreateMemberError = CloudflareOpError; /** Create a membership that grants access to a specific Organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/) */ export const createMember: API.OperationMethod< CreateMemberRequest, CreateMemberResponse, CreateMemberError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateMemberRequest, output: CreateMemberResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateOrganizationError = Forbidden | CloudflareOpError; /** Create a new organization for a user. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/) */ export const createOrganization: API.OperationMethod< CreateOrganizationRequest, CreateOrganizationResponse, CreateOrganizationError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateOrganizationRequest, output: CreateOrganizationResponse, errors: [Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteMemberError = CloudflareOpError; /** Delete a membership to a particular Organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/) */ export const deleteMember: API.OperationMethod< DeleteMemberRequest, DeleteMemberResponse, DeleteMemberError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteMemberRequest, output: DeleteMemberResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteOrganizationError = | OrganizationNotFound | Forbidden | CloudflareOpError; /** Delete an organization. The organization MUST be empty before deleting. It must not contain any sub-organizations, accounts, members or users. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/) **Access Control:** Restricted to enterprise organizations. */ export const deleteOrganization: API.OperationMethod< DeleteOrganizationRequest, DeleteOrganizationResponse, DeleteOrganizationError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteOrganizationRequest, output: DeleteOrganizationResponse, errors: [ OrganizationNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetBillingUsageError = CloudflareOpError; /** Returns cost and usage data for all accounts within an organization, aligned with the [FinOps FOCUS v1.3](https://focus.finops.org/focus-specification/v1-3/) Cost and Usage dataset specification. Each record represents one billable metric for one account on one day. This includes all metered usage, including usage that falls within free-tier allowances and may result in zero cost. The response includes usage for every account belonging to the specified organization. **Note:** Cost and pricing fields are not yet populated and will be absent from responses until billing integration is complete. When `from` and `to` are omitted, defaults to the start of the current month through today. The maximum date range is 31 days. */ export const getBillingUsage: API.OperationMethod< GetBillingUsageRequest, GetBillingUsageResponse, GetBillingUsageError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetBillingUsageRequest, output: GetBillingUsageResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetMemberError = CloudflareOpError; /** Retrieve a single membership from an Organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/) */ export const getMember: API.OperationMethod< GetMemberRequest, GetMemberResponse, GetMemberError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetMemberRequest, output: GetMemberResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetOrganizationError = | OrganizationNotFound | Forbidden | CloudflareOpError; /** Retrieve the details of a certain organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/) */ export const getOrganization: API.OperationMethod< GetOrganizationRequest, GetOrganizationResponse, GetOrganizationError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetOrganizationRequest, output: GetOrganizationResponse, errors: [ OrganizationNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetOrganizationAccountError = CloudflareOpError; /** Retrieve a list of accounts that belong to a specific organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/) */ export const getOrganizationAccount: API.OperationMethod< GetOrganizationAccountRequest, GetOrganizationAccountResponse, GetOrganizationAccountError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetOrganizationAccountRequest, output: GetOrganizationAccountResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetOrganizationProfileError = | OrganizationNotFound | Forbidden | CloudflareOpError; /** Get an organizations profile if it exists. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/) */ export const getOrganizationProfile: API.OperationMethod< GetOrganizationProfileRequest, GetOrganizationProfileResponse, GetOrganizationProfileError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetOrganizationProfileRequest, output: GetOrganizationProfileResponse, errors: [ OrganizationNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type ListLogAuditsError = CloudflareOpError; /** Gets a list of audit logs for an organization. */ export const listLogAudits: API.PaginatedOperationMethod< ListLogAuditsRequest, ListLogAuditsResponse, ListLogAuditsError, CloudflareOpContext, LogsAuditListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListLogAuditsRequest, output: ListLogAuditsResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "cursor", inputToken: "cursor", outputToken: "resultInfo.cursors.after", items: "result", } as const, }), cloudflarePaginate, ) as any; export type ListMembersError = CloudflareOpError; /** List memberships for an Organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/) */ export const listMembers: API.OperationMethod< ListMembersRequest, ListMembersResponse, ListMembersError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: ListMembersRequest, output: ListMembersResponse, errors: [CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type ListOrganizationsError = Forbidden | CloudflareOpError; /** Retrieve a list of organizations a particular user has access to. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/) */ export const listOrganizations: API.PaginatedOperationMethod< ListOrganizationsRequest, ListOrganizationsResponse, ListOrganizationsError, CloudflareOpContext, ListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListOrganizationsRequest, output: ListOrganizationsResponse, errors: [Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "single", items: "result" } as const, }), cloudflarePaginate, ) as any; export type PutOrganizationProfileError = | OrganizationNotFound | Forbidden | CloudflareOpError; /** Modify organization profile. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/) */ export const putOrganizationProfile: API.OperationMethod< PutOrganizationProfileRequest, PutOrganizationProfileResponse, PutOrganizationProfileError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: PutOrganizationProfileRequest, output: PutOrganizationProfileResponse, errors: [ OrganizationNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type UpdateOrganizationError = | OrganizationNotFound | Forbidden | CloudflareOpError; /** Modify organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/) */ export const updateOrganization: API.OperationMethod< UpdateOrganizationRequest, UpdateOrganizationResponse, UpdateOrganizationError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateOrganizationRequest, output: UpdateOrganizationResponse, errors: [ OrganizationNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, }));