// 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> = { accountId: "account_id", accountName: "account_name", associatedRecipientCount: "associated_recipient_count", associatingRecipientCount: "associating_recipient_count", associationStatus: "association_status", bodyAccountId: "body_account_id", disassociatedRecipientCount: "disassociated_recipient_count", disassociatingRecipientCount: "disassociating_recipient_count", organizationId: "organization_id", perPage: "per_page", recipientAccountId: "recipient_account_id", resourceAccountId: "resource_account_id", resourceId: "resource_id", resourceType: "resource_type", resourceVersion: "resource_version", resultInfo: "result_info", targetType: "target_type", totalCount: "total_count", }; export class Forbidden extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("Forbidden", { code: S.Number, message: S.String, }), [{ status: 403 }], ) {} export class ShareNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()("ShareNotFound", { code: S.Number, message: S.String, }), [{ code: 1004 }, { status: 404 }], ) {} export class ShareRecipientNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()( "ShareRecipientNotFound", { code: S.Number, message: S.String, }, ), [{ code: 1004 }, { status: 404 }], ) {} export class ShareResourceNotFound extends /*@__PURE__*/ T.applyErrorMatchers( /*@__PURE__*/ S.TaggedError()( "ShareResourceNotFound", { code: S.Number, message: S.String, }, ), [{ code: 1004 }, { status: 404 }], ) {} export interface CreateRecipientRequest { /** Account identifier. */ accountId: string; /** Share identifier tag. */ shareId: string; /** Organization identifier. */ organizationId?: string; /** The account that will receive the share. */ recipientAccountId?: string; } export const CreateRecipientRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), shareId: S.String.pipe(T.Label("share_id")), organizationId: S.optional(S.String.pipe(T.Body("organization_id"))), recipientAccountId: S.optional( S.String.pipe(T.Body("recipient_account_id")), ), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/shares/{share_id}/recipients", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateRecipientRequest", }) as any as S.Schema; export type RecipientsCreateResponseAssociationStatus = | "associating" | "associated" | "disassociating" | "disassociated"; export const RecipientsCreateResponseAssociationStatus = /*@__PURE__*/ S.String; export interface RecipientsCreateResponseResourcesItem { /** Share Recipient error message. */ error: string; /** Share Resource identifier. */ resourceId: string; /** Resource Version. */ resourceVersion: number; /** Whether the error is terminal or will be continually retried. */ terminal: boolean; } export const RecipientsCreateResponseResourcesItem = /*@__PURE__*/ S.suspend( () => S.Struct({ error: S.String, resourceId: S.String.pipe(T.Body("resource_id")), resourceVersion: S.Number.pipe(T.Body("resource_version")), terminal: S.Boolean, }), ).annotate({ identifier: "RecipientsCreateResponseResourcesItem", }) as any as S.Schema; export type RecipientsCreateResponseResourcesList = Array; export const RecipientsCreateResponseResourcesList = /*@__PURE__*/ S.Array( RecipientsCreateResponseResourcesItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateRecipientResponse { /** Share Recipient identifier tag. */ id: string; /** Account identifier. */ accountId: string; /** Share Recipient association status. */ associationStatus: RecipientsCreateResponseAssociationStatus; /** When the share was created. */ created: string; /** When the share was modified. */ modified: string; resources?: RecipientsCreateResponseResourcesList | null; } export const CreateRecipientResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, accountId: S.String.pipe(T.Body("account_id")), associationStatus: RecipientsCreateResponseAssociationStatus.pipe( T.Body("association_status"), ), created: S.String, modified: S.String, resources: S.optional(S.NullOr(RecipientsCreateResponseResourcesList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateRecipientResponse", }) as any as S.Schema; export type ResourcesCreateRequestResourceType = | "custom-ruleset" | "gateway-policy" | "gateway-destination-ip" | "gateway-block-page-settings" | "gateway-extended-email-matching" | "idp-federation-grant"; export const ResourcesCreateRequestResourceType = /*@__PURE__*/ S.String; export interface CreateResourceRequest { /** Account identifier. */ accountId: string; /** Share identifier tag. */ shareId: string; /** Resource Metadata. */ meta: unknown; /** Account identifier. */ resourceAccountId: string; /** Share Resource identifier. */ resourceId: string; /** Resource Type. */ resourceType: ResourcesCreateRequestResourceType | (string & {}); } export const CreateResourceRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), shareId: S.String.pipe(T.Label("share_id")), meta: S.Unknown, resourceAccountId: S.String.pipe(T.Body("resource_account_id")), resourceId: S.String.pipe(T.Body("resource_id")), resourceType: ResourcesCreateRequestResourceType.pipe( T.Body("resource_type"), ), }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/shares/{share_id}/resources", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateResourceRequest", }) as any as S.Schema; export type ResourcesCreateResponseResourceType = | "custom-ruleset" | "gateway-policy" | "gateway-destination-ip" | "gateway-block-page-settings" | "gateway-extended-email-matching" | "idp-federation-grant"; export const ResourcesCreateResponseResourceType = /*@__PURE__*/ S.String; export type ResourcesCreateResponseStatus = "active" | "deleting" | "deleted"; export const ResourcesCreateResponseStatus = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateResourceResponse { /** Share Resource identifier. */ id: string; /** When the share was created. */ created: string; /** Resource Metadata. */ meta: unknown; /** When the share was modified. */ modified: string; /** Account identifier. */ resourceAccountId: string; /** Share Resource identifier. */ resourceId: string; /** Resource Type. */ resourceType: ResourcesCreateResponseResourceType; /** Resource Version. */ resourceVersion: number; /** Resource Status. */ status: ResourcesCreateResponseStatus; } export const CreateResourceResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, created: S.String, meta: S.Unknown, modified: S.String, resourceAccountId: S.String.pipe(T.Body("resource_account_id")), resourceId: S.String.pipe(T.Body("resource_id")), resourceType: ResourcesCreateResponseResourceType.pipe( T.Body("resource_type"), ), resourceVersion: S.Number.pipe(T.Body("resource_version")), status: ResourcesCreateResponseStatus, }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateResourceResponse", }) as any as S.Schema; export interface CreateRequestRecipientsItem { /** Deprecated alias for `recipient_account_id`. Use `recipient_account_id` instead. */ accountId?: string; /** Organization identifier. */ organizationId?: string; /** The account that will receive the share. */ recipientAccountId?: string; } export const CreateRequestRecipientsItem = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.optional(S.String.pipe(T.Body("account_id"))), organizationId: S.optional(S.String.pipe(T.Body("organization_id"))), recipientAccountId: S.optional( S.String.pipe(T.Body("recipient_account_id")), ), }), ).annotate({ identifier: "CreateRequestRecipientsItem", }) as any as S.Schema; export type CreateRequestRecipientsList = Array; export const CreateRequestRecipientsList = /*@__PURE__*/ S.Array( CreateRequestRecipientsItem, ) as any as S.Schema; export type CreateRequestResourcesItemResourceType = | "custom-ruleset" | "gateway-policy" | "gateway-destination-ip" | "gateway-block-page-settings" | "gateway-extended-email-matching" | "idp-federation-grant"; export const CreateRequestResourcesItemResourceType = /*@__PURE__*/ S.String; export interface CreateRequestResourcesItem { /** Resource Metadata. */ meta: unknown; /** Account identifier. */ resourceAccountId: string; /** Share Resource identifier. */ resourceId: string; /** Resource Type. */ resourceType: CreateRequestResourcesItemResourceType | (string & {}); } export const CreateRequestResourcesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ meta: S.Unknown, resourceAccountId: S.String.pipe(T.Body("resource_account_id")), resourceId: S.String.pipe(T.Body("resource_id")), resourceType: CreateRequestResourcesItemResourceType.pipe( T.Body("resource_type"), ), }), ).annotate({ identifier: "CreateRequestResourcesItem", }) as any as S.Schema; export type CreateRequestResourcesList = Array; export const CreateRequestResourcesList = /*@__PURE__*/ S.Array( CreateRequestResourcesItem, ) as any as S.Schema; export interface CreateResourceSharingRequest { /** Account identifier. */ accountId: string; /** The name of the share. */ name: string; recipients: CreateRequestRecipientsList; resources: CreateRequestResourcesList; } export const CreateResourceSharingRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), name: S.String, recipients: CreateRequestRecipientsList, resources: CreateRequestResourcesList, }) .pipe( T.Http({ method: "POST", uri: "/accounts/{account_id}/shares", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateResourceSharingRequest", }) as any as S.Schema; export type CreateResponseStatus = "active" | "deleting" | "deleted"; export const CreateResponseStatus = /*@__PURE__*/ S.String; export type CreateResponseTargetType = "account" | "organization"; export const CreateResponseTargetType = /*@__PURE__*/ S.String; export type CreateResponseKind = "sent" | "received"; export const CreateResponseKind = /*@__PURE__*/ S.String; export type CreateResponseResourcesItemResourceType = | "custom-ruleset" | "gateway-policy" | "gateway-destination-ip" | "gateway-block-page-settings" | "gateway-extended-email-matching" | "idp-federation-grant"; export const CreateResponseResourcesItemResourceType = /*@__PURE__*/ S.String; export type CreateResponseResourcesItemStatus = | "active" | "deleting" | "deleted"; export const CreateResponseResourcesItemStatus = /*@__PURE__*/ S.String; export interface CreateResponseResourcesItem { /** Share Resource identifier. */ id: string; /** When the share was created. */ created: string; /** Resource Metadata. */ meta: unknown; /** When the share was modified. */ modified: string; /** Account identifier. */ resourceAccountId: string; /** Share Resource identifier. */ resourceId: string; /** Resource Type. */ resourceType: CreateResponseResourcesItemResourceType; /** Resource Version. */ resourceVersion: number; /** Resource Status. */ status: CreateResponseResourcesItemStatus; } export const CreateResponseResourcesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, created: S.String, meta: S.Unknown, modified: S.String, resourceAccountId: S.String.pipe(T.Body("resource_account_id")), resourceId: S.String.pipe(T.Body("resource_id")), resourceType: CreateResponseResourcesItemResourceType.pipe( T.Body("resource_type"), ), resourceVersion: S.Number.pipe(T.Body("resource_version")), status: CreateResponseResourcesItemStatus, }), ).annotate({ identifier: "CreateResponseResourcesItem", }) as any as S.Schema; export type CreateResponseResourcesList = Array; export const CreateResponseResourcesList = /*@__PURE__*/ S.Array( CreateResponseResourcesItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface CreateResourceSharingResponse { /** Share identifier tag. */ id: string; /** Account identifier. */ accountId: string; /** The display name of an account. */ accountName: string; /** When the share was created. */ created: string; /** When the share was modified. */ modified: string; /** The name of the share. */ name: string; /** Organization identifier. */ organizationId: string; status: CreateResponseStatus; targetType: CreateResponseTargetType; /** The number of recipients in the 'associated' state. This field is only included when requested via the 'include_recipient_counts' parameter. */ associatedRecipientCount?: number | null; /** The number of recipients in the 'associating' state. This field is only included when requested via the 'include_recipient_counts' parameter. */ associatingRecipientCount?: number | null; /** The number of recipients in the 'disassociated' state. This field is only included when requested via the 'include_recipient_counts' parameter. */ disassociatedRecipientCount?: number | null; /** The number of recipients in the 'disassociating' state. This field is only included when requested via the 'include_recipient_counts' parameter. */ disassociatingRecipientCount?: number | null; kind?: CreateResponseKind | null; /** A list of resources that are part of the share. This field is only included when requested via the 'include_resources' parameter. */ resources?: CreateResponseResourcesList | null; } export const CreateResourceSharingResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, accountId: S.String.pipe(T.Body("account_id")), accountName: S.String.pipe(T.Body("account_name")), created: S.String, modified: S.String, name: S.String, organizationId: S.String.pipe(T.Body("organization_id")), status: CreateResponseStatus, targetType: CreateResponseTargetType.pipe(T.Body("target_type")), associatedRecipientCount: S.optional( S.NullOr(S.Number).pipe(T.Body("associated_recipient_count")), ), associatingRecipientCount: S.optional( S.NullOr(S.Number).pipe(T.Body("associating_recipient_count")), ), disassociatedRecipientCount: S.optional( S.NullOr(S.Number).pipe(T.Body("disassociated_recipient_count")), ), disassociatingRecipientCount: S.optional( S.NullOr(S.Number).pipe(T.Body("disassociating_recipient_count")), ), kind: S.optional(S.NullOr(CreateResponseKind)), resources: S.optional(S.NullOr(CreateResponseResourcesList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "CreateResourceSharingResponse", }) as any as S.Schema; export interface DeleteRecipientRequest { /** Account identifier. */ accountId: string; /** Share identifier tag. */ shareId: string; /** Share Recipient identifier tag. */ recipientId: string; } export const DeleteRecipientRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), shareId: S.String.pipe(T.Label("share_id")), recipientId: S.String.pipe(T.Label("recipient_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/accounts/{account_id}/shares/{share_id}/recipients/{recipient_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteRecipientRequest", }) as any as S.Schema; export type RecipientsDeleteResponseAssociationStatus = | "associating" | "associated" | "disassociating" | "disassociated"; export const RecipientsDeleteResponseAssociationStatus = /*@__PURE__*/ S.String; export type RecipientsDeleteResponseResourcesItem = RecipientsCreateResponseResourcesItem; export const RecipientsDeleteResponseResourcesItem = RecipientsCreateResponseResourcesItem; export type RecipientsDeleteResponseResourcesList = Array; export const RecipientsDeleteResponseResourcesList = /*@__PURE__*/ S.Array( RecipientsCreateResponseResourcesItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface DeleteRecipientResponse { /** Share Recipient identifier tag. */ id: string; /** Account identifier. */ accountId: string; /** Share Recipient association status. */ associationStatus: RecipientsDeleteResponseAssociationStatus; /** When the share was created. */ created: string; /** When the share was modified. */ modified: string; resources?: RecipientsDeleteResponseResourcesList | null; } export const DeleteRecipientResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, accountId: S.String.pipe(T.Body("account_id")), associationStatus: RecipientsDeleteResponseAssociationStatus.pipe( T.Body("association_status"), ), created: S.String, modified: S.String, resources: S.optional(S.NullOr(RecipientsDeleteResponseResourcesList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteRecipientResponse", }) as any as S.Schema; export interface DeleteResourceRequest { /** Account identifier. */ accountId: string; /** Share identifier tag. */ shareId: string; /** Share Resource identifier. */ shareResourceId: string; } export const DeleteResourceRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), shareId: S.String.pipe(T.Label("share_id")), shareResourceId: S.String.pipe(T.Label("share_resource_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/accounts/{account_id}/shares/{share_id}/resources/{share_resource_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteResourceRequest", }) as any as S.Schema; export type ResourcesDeleteResponseResourceType = | "custom-ruleset" | "gateway-policy" | "gateway-destination-ip" | "gateway-block-page-settings" | "gateway-extended-email-matching" | "idp-federation-grant"; export const ResourcesDeleteResponseResourceType = /*@__PURE__*/ S.String; export type ResourcesDeleteResponseStatus = "active" | "deleting" | "deleted"; export const ResourcesDeleteResponseStatus = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface DeleteResourceResponse { /** Share Resource identifier. */ id: string; /** When the share was created. */ created: string; /** Resource Metadata. */ meta: unknown; /** When the share was modified. */ modified: string; /** Account identifier. */ resourceAccountId: string; /** Share Resource identifier. */ resourceId: string; /** Resource Type. */ resourceType: ResourcesDeleteResponseResourceType; /** Resource Version. */ resourceVersion: number; /** Resource Status. */ status: ResourcesDeleteResponseStatus; } export const DeleteResourceResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, created: S.String, meta: S.Unknown, modified: S.String, resourceAccountId: S.String.pipe(T.Body("resource_account_id")), resourceId: S.String.pipe(T.Body("resource_id")), resourceType: ResourcesDeleteResponseResourceType.pipe( T.Body("resource_type"), ), resourceVersion: S.Number.pipe(T.Body("resource_version")), status: ResourcesDeleteResponseStatus, }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteResourceResponse", }) as any as S.Schema; export interface DeleteResourceSharingRequest { /** Account identifier. */ accountId: string; /** Share identifier tag. */ shareId: string; } export const DeleteResourceSharingRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), shareId: S.String.pipe(T.Label("share_id")), }) .pipe( T.Http({ method: "DELETE", uri: "/accounts/{account_id}/shares/{share_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteResourceSharingRequest", }) as any as S.Schema; export type DeleteResponseStatus = "active" | "deleting" | "deleted"; export const DeleteResponseStatus = /*@__PURE__*/ S.String; export type DeleteResponseTargetType = "account" | "organization"; export const DeleteResponseTargetType = /*@__PURE__*/ S.String; export type DeleteResponseKind = "sent" | "received"; export const DeleteResponseKind = /*@__PURE__*/ S.String; export type DeleteResponseResourcesItemResourceType = | "custom-ruleset" | "gateway-policy" | "gateway-destination-ip" | "gateway-block-page-settings" | "gateway-extended-email-matching" | "idp-federation-grant"; export const DeleteResponseResourcesItemResourceType = /*@__PURE__*/ S.String; export type DeleteResponseResourcesItemStatus = | "active" | "deleting" | "deleted"; export const DeleteResponseResourcesItemStatus = /*@__PURE__*/ S.String; export interface DeleteResponseResourcesItem { /** Share Resource identifier. */ id: string; /** When the share was created. */ created: string; /** Resource Metadata. */ meta: unknown; /** When the share was modified. */ modified: string; /** Account identifier. */ resourceAccountId: string; /** Share Resource identifier. */ resourceId: string; /** Resource Type. */ resourceType: DeleteResponseResourcesItemResourceType; /** Resource Version. */ resourceVersion: number; /** Resource Status. */ status: DeleteResponseResourcesItemStatus; } export const DeleteResponseResourcesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, created: S.String, meta: S.Unknown, modified: S.String, resourceAccountId: S.String.pipe(T.Body("resource_account_id")), resourceId: S.String.pipe(T.Body("resource_id")), resourceType: DeleteResponseResourcesItemResourceType.pipe( T.Body("resource_type"), ), resourceVersion: S.Number.pipe(T.Body("resource_version")), status: DeleteResponseResourcesItemStatus, }), ).annotate({ identifier: "DeleteResponseResourcesItem", }) as any as S.Schema; export type DeleteResponseResourcesList = Array; export const DeleteResponseResourcesList = /*@__PURE__*/ S.Array( DeleteResponseResourcesItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface DeleteResourceSharingResponse { /** Share identifier tag. */ id: string; /** Account identifier. */ accountId: string; /** The display name of an account. */ accountName: string; /** When the share was created. */ created: string; /** When the share was modified. */ modified: string; /** The name of the share. */ name: string; /** Organization identifier. */ organizationId: string; status: DeleteResponseStatus; targetType: DeleteResponseTargetType; /** The number of recipients in the 'associated' state. This field is only included when requested via the 'include_recipient_counts' parameter. */ associatedRecipientCount?: number | null; /** The number of recipients in the 'associating' state. This field is only included when requested via the 'include_recipient_counts' parameter. */ associatingRecipientCount?: number | null; /** The number of recipients in the 'disassociated' state. This field is only included when requested via the 'include_recipient_counts' parameter. */ disassociatedRecipientCount?: number | null; /** The number of recipients in the 'disassociating' state. This field is only included when requested via the 'include_recipient_counts' parameter. */ disassociatingRecipientCount?: number | null; kind?: DeleteResponseKind | null; /** A list of resources that are part of the share. This field is only included when requested via the 'include_resources' parameter. */ resources?: DeleteResponseResourcesList | null; } export const DeleteResourceSharingResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, accountId: S.String.pipe(T.Body("account_id")), accountName: S.String.pipe(T.Body("account_name")), created: S.String, modified: S.String, name: S.String, organizationId: S.String.pipe(T.Body("organization_id")), status: DeleteResponseStatus, targetType: DeleteResponseTargetType.pipe(T.Body("target_type")), associatedRecipientCount: S.optional( S.NullOr(S.Number).pipe(T.Body("associated_recipient_count")), ), associatingRecipientCount: S.optional( S.NullOr(S.Number).pipe(T.Body("associating_recipient_count")), ), disassociatedRecipientCount: S.optional( S.NullOr(S.Number).pipe(T.Body("disassociated_recipient_count")), ), disassociatingRecipientCount: S.optional( S.NullOr(S.Number).pipe(T.Body("disassociating_recipient_count")), ), kind: S.optional(S.NullOr(DeleteResponseKind)), resources: S.optional(S.NullOr(DeleteResponseResourcesList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "DeleteResourceSharingResponse", }) as any as S.Schema; export interface GetRecipientRequest { /** Account identifier. */ accountId: string; /** Share identifier tag. */ shareId: string; /** Share Recipient identifier tag. */ recipientId: string; /** Include resources in the response. */ includeResources?: boolean; } export const GetRecipientRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), shareId: S.String.pipe(T.Label("share_id")), recipientId: S.String.pipe(T.Label("recipient_id")), includeResources: S.optional(S.Boolean.pipe(T.Query("include_resources"))), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/shares/{share_id}/recipients/{recipient_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetRecipientRequest", }) as any as S.Schema; export type RecipientsGetResponseAssociationStatus = | "associating" | "associated" | "disassociating" | "disassociated"; export const RecipientsGetResponseAssociationStatus = /*@__PURE__*/ S.String; export type RecipientsGetResponseResourcesItem = RecipientsCreateResponseResourcesItem; export const RecipientsGetResponseResourcesItem = RecipientsCreateResponseResourcesItem; export type RecipientsGetResponseResourcesList = Array; export const RecipientsGetResponseResourcesList = /*@__PURE__*/ S.Array( RecipientsCreateResponseResourcesItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetRecipientResponse { /** Share Recipient identifier tag. */ id: string; /** Account identifier. */ accountId: string; /** Share Recipient association status. */ associationStatus: RecipientsGetResponseAssociationStatus; /** When the share was created. */ created: string; /** When the share was modified. */ modified: string; resources?: RecipientsGetResponseResourcesList | null; } export const GetRecipientResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, accountId: S.String.pipe(T.Body("account_id")), associationStatus: RecipientsGetResponseAssociationStatus.pipe( T.Body("association_status"), ), created: S.String, modified: S.String, resources: S.optional(S.NullOr(RecipientsGetResponseResourcesList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetRecipientResponse", }) as any as S.Schema; export interface GetResourceRequest { /** Account identifier. */ accountId: string; /** Share identifier tag. */ shareId: string; /** Share Resource identifier. */ shareResourceId: string; } export const GetResourceRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), shareId: S.String.pipe(T.Label("share_id")), shareResourceId: S.String.pipe(T.Label("share_resource_id")), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/shares/{share_id}/resources/{share_resource_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetResourceRequest", }) as any as S.Schema; export type ResourcesGetResponseResourceType = | "custom-ruleset" | "gateway-policy" | "gateway-destination-ip" | "gateway-block-page-settings" | "gateway-extended-email-matching" | "idp-federation-grant"; export const ResourcesGetResponseResourceType = /*@__PURE__*/ S.String; export type ResourcesGetResponseStatus = "active" | "deleting" | "deleted"; export const ResourcesGetResponseStatus = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetResourceResponse { /** Share Resource identifier. */ id: string; /** When the share was created. */ created: string; /** Resource Metadata. */ meta: unknown; /** When the share was modified. */ modified: string; /** Account identifier. */ resourceAccountId: string; /** Share Resource identifier. */ resourceId: string; /** Resource Type. */ resourceType: ResourcesGetResponseResourceType; /** Resource Version. */ resourceVersion: number; /** Resource Status. */ status: ResourcesGetResponseStatus; } export const GetResourceResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, created: S.String, meta: S.Unknown, modified: S.String, resourceAccountId: S.String.pipe(T.Body("resource_account_id")), resourceId: S.String.pipe(T.Body("resource_id")), resourceType: ResourcesGetResponseResourceType.pipe( T.Body("resource_type"), ), resourceVersion: S.Number.pipe(T.Body("resource_version")), status: ResourcesGetResponseStatus, }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetResourceResponse", }) as any as S.Schema; export interface GetResourceSharingRequest { /** Account identifier. */ accountId: string; /** Share identifier tag. */ shareId: string; /** Include recipient counts in the response. */ includeRecipientCounts?: boolean; /** Include resources in the response. */ includeResources?: boolean; } export const GetResourceSharingRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), shareId: S.String.pipe(T.Label("share_id")), includeRecipientCounts: S.optional( S.Boolean.pipe(T.Query("include_recipient_counts")), ), includeResources: S.optional(S.Boolean.pipe(T.Query("include_resources"))), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/shares/{share_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetResourceSharingRequest", }) as any as S.Schema; export type GetResponseStatus = "active" | "deleting" | "deleted"; export const GetResponseStatus = /*@__PURE__*/ S.String; export type GetResponseTargetType = "account" | "organization"; export const GetResponseTargetType = /*@__PURE__*/ S.String; export type GetResponseKind = "sent" | "received"; export const GetResponseKind = /*@__PURE__*/ S.String; export type GetResponseResourcesItemResourceType = | "custom-ruleset" | "gateway-policy" | "gateway-destination-ip" | "gateway-block-page-settings" | "gateway-extended-email-matching" | "idp-federation-grant"; export const GetResponseResourcesItemResourceType = /*@__PURE__*/ S.String; export type GetResponseResourcesItemStatus = "active" | "deleting" | "deleted"; export const GetResponseResourcesItemStatus = /*@__PURE__*/ S.String; export interface GetResponseResourcesItem { /** Share Resource identifier. */ id: string; /** When the share was created. */ created: string; /** Resource Metadata. */ meta: unknown; /** When the share was modified. */ modified: string; /** Account identifier. */ resourceAccountId: string; /** Share Resource identifier. */ resourceId: string; /** Resource Type. */ resourceType: GetResponseResourcesItemResourceType; /** Resource Version. */ resourceVersion: number; /** Resource Status. */ status: GetResponseResourcesItemStatus; } export const GetResponseResourcesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, created: S.String, meta: S.Unknown, modified: S.String, resourceAccountId: S.String.pipe(T.Body("resource_account_id")), resourceId: S.String.pipe(T.Body("resource_id")), resourceType: GetResponseResourcesItemResourceType.pipe( T.Body("resource_type"), ), resourceVersion: S.Number.pipe(T.Body("resource_version")), status: GetResponseResourcesItemStatus, }), ).annotate({ identifier: "GetResponseResourcesItem", }) as any as S.Schema; export type GetResponseResourcesList = Array; export const GetResponseResourcesList = /*@__PURE__*/ S.Array( GetResponseResourcesItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface GetResourceSharingResponse { /** Share identifier tag. */ id: string; /** Account identifier. */ accountId: string; /** The display name of an account. */ accountName: string; /** When the share was created. */ created: string; /** When the share was modified. */ modified: string; /** The name of the share. */ name: string; /** Organization identifier. */ organizationId: string; status: GetResponseStatus; targetType: GetResponseTargetType; /** The number of recipients in the 'associated' state. This field is only included when requested via the 'include_recipient_counts' parameter. */ associatedRecipientCount?: number | null; /** The number of recipients in the 'associating' state. This field is only included when requested via the 'include_recipient_counts' parameter. */ associatingRecipientCount?: number | null; /** The number of recipients in the 'disassociated' state. This field is only included when requested via the 'include_recipient_counts' parameter. */ disassociatedRecipientCount?: number | null; /** The number of recipients in the 'disassociating' state. This field is only included when requested via the 'include_recipient_counts' parameter. */ disassociatingRecipientCount?: number | null; kind?: GetResponseKind | null; /** A list of resources that are part of the share. This field is only included when requested via the 'include_resources' parameter. */ resources?: GetResponseResourcesList | null; } export const GetResourceSharingResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, accountId: S.String.pipe(T.Body("account_id")), accountName: S.String.pipe(T.Body("account_name")), created: S.String, modified: S.String, name: S.String, organizationId: S.String.pipe(T.Body("organization_id")), status: GetResponseStatus, targetType: GetResponseTargetType.pipe(T.Body("target_type")), associatedRecipientCount: S.optional( S.NullOr(S.Number).pipe(T.Body("associated_recipient_count")), ), associatingRecipientCount: S.optional( S.NullOr(S.Number).pipe(T.Body("associating_recipient_count")), ), disassociatedRecipientCount: S.optional( S.NullOr(S.Number).pipe(T.Body("disassociated_recipient_count")), ), disassociatingRecipientCount: S.optional( S.NullOr(S.Number).pipe(T.Body("disassociating_recipient_count")), ), kind: S.optional(S.NullOr(GetResponseKind)), resources: S.optional(S.NullOr(GetResponseResourcesList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "GetResourceSharingResponse", }) as any as S.Schema; export interface ListRecipientsRequest { /** Account identifier. */ accountId: string; /** Share identifier tag. */ shareId: string; /** Include resources in the response. */ includeResources?: boolean; /** Page number. Defaults to `1` when `per_page` is supplied without */ page?: number; /** Number of objects to return per page. Defaults to `20` when `page` */ perPage?: number; } export const ListRecipientsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), shareId: S.String.pipe(T.Label("share_id")), includeResources: S.optional(S.Boolean.pipe(T.Query("include_resources"))), page: S.optional(S.Number.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/shares/{share_id}/recipients", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListRecipientsRequest", }) as any as S.Schema; export type RecipientsListResultItemAssociationStatus = | "associating" | "associated" | "disassociating" | "disassociated"; export const RecipientsListResultItemAssociationStatus = /*@__PURE__*/ S.String; export type RecipientsListResultItemResourcesItem = RecipientsCreateResponseResourcesItem; export const RecipientsListResultItemResourcesItem = RecipientsCreateResponseResourcesItem; export type RecipientsListResultItemResourcesList = Array; export const RecipientsListResultItemResourcesList = /*@__PURE__*/ S.Array( RecipientsCreateResponseResourcesItem, ) as any as S.Schema; export interface RecipientsListResultItem { /** Share Recipient identifier tag. */ id: string; /** Account identifier. */ accountId: string; /** Share Recipient association status. */ associationStatus: RecipientsListResultItemAssociationStatus; /** When the share was created. */ created: string; /** When the share was modified. */ modified: string; resources?: RecipientsListResultItemResourcesList | null; } export const RecipientsListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, accountId: S.String.pipe(T.Body("account_id")), associationStatus: RecipientsListResultItemAssociationStatus.pipe( T.Body("association_status"), ), created: S.String, modified: S.String, resources: S.optional(S.NullOr(RecipientsListResultItemResourcesList)), }), ).annotate({ identifier: "RecipientsListResultItem", }) as any as S.Schema; export type RecipientsListResultList = Array; export const RecipientsListResultList = /*@__PURE__*/ S.Array( RecipientsListResultItem, ) as any as S.Schema; export interface ListRecipientsResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: RecipientsListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListRecipientsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: RecipientsListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListRecipientsResponse", }) as any as S.Schema; export type ResourcesListRequestResourceType = | "custom-ruleset" | "gateway-policy" | "gateway-destination-ip" | "gateway-block-page-settings" | "gateway-extended-email-matching" | "idp-federation-grant"; export const ResourcesListRequestResourceType = /*@__PURE__*/ S.String; export type ResourcesListRequestStatus = "active" | "deleting" | "deleted"; export const ResourcesListRequestStatus = /*@__PURE__*/ S.String; export interface ListResourcesRequest { /** Account identifier. */ accountId: string; /** Share identifier tag. */ shareId: string; /** Page number. Defaults to `1` when `per_page` is supplied without */ page?: number; /** Number of objects to return per page. Defaults to `20` when `page` */ perPage?: number; /** Filter share resources by resource_type. */ resourceType?: ResourcesListRequestResourceType | (string & {}); /** Filter share resources by status. */ status?: ResourcesListRequestStatus | (string & {}); } export const ListResourcesRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), shareId: S.String.pipe(T.Label("share_id")), page: S.optional(S.Number.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), resourceType: S.optional( ResourcesListRequestResourceType.pipe(T.Query("resource_type")), ), status: S.optional(ResourcesListRequestStatus.pipe(T.Query())), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/shares/{share_id}/resources", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListResourcesRequest", }) as any as S.Schema; export type ResourcesListResultItemResourceType = | "custom-ruleset" | "gateway-policy" | "gateway-destination-ip" | "gateway-block-page-settings" | "gateway-extended-email-matching" | "idp-federation-grant"; export const ResourcesListResultItemResourceType = /*@__PURE__*/ S.String; export type ResourcesListResultItemStatus = "active" | "deleting" | "deleted"; export const ResourcesListResultItemStatus = /*@__PURE__*/ S.String; export interface ResourcesListResultItem { /** Share Resource identifier. */ id: string; /** When the share was created. */ created: string; /** Resource Metadata. */ meta: unknown; /** When the share was modified. */ modified: string; /** Account identifier. */ resourceAccountId: string; /** Share Resource identifier. */ resourceId: string; /** Resource Type. */ resourceType: ResourcesListResultItemResourceType; /** Resource Version. */ resourceVersion: number; /** Resource Status. */ status: ResourcesListResultItemStatus; } export const ResourcesListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, created: S.String, meta: S.Unknown, modified: S.String, resourceAccountId: S.String.pipe(T.Body("resource_account_id")), resourceId: S.String.pipe(T.Body("resource_id")), resourceType: ResourcesListResultItemResourceType.pipe( T.Body("resource_type"), ), resourceVersion: S.Number.pipe(T.Body("resource_version")), status: ResourcesListResultItemStatus, }), ).annotate({ identifier: "ResourcesListResultItem", }) as any as S.Schema; export type ResourcesListResultList = Array; export const ResourcesListResultList = /*@__PURE__*/ S.Array( ResourcesListResultItem, ) as any as S.Schema; export interface ListResourcesResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: ResourcesListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListResourcesResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ result: ResourcesListResultList.pipe(T.EnvelopePayload()), resultInfo: S.optional(S.NullOr(ResultInfo).pipe(T.ResultInfo())), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListResourcesResponse", }) as any as S.Schema; export type ListRequestDirection = "asc" | "desc"; export const ListRequestDirection = /*@__PURE__*/ S.String; export type ListRequestKind = "sent" | "received"; export const ListRequestKind = /*@__PURE__*/ S.String; export type ListRequestOrder = "name" | "created"; export const ListRequestOrder = /*@__PURE__*/ S.String; export type ListRequestResourceTypes = | "custom-ruleset" | "gateway-policy" | "gateway-destination-ip" | "gateway-block-page-settings" | "gateway-extended-email-matching" | "idp-federation-grant"; export const ListRequestResourceTypes = /*@__PURE__*/ S.String; export type ListRequestResourceTypesList = Array< ListRequestResourceTypes | (string & {}) >; export const ListRequestResourceTypesList = /*@__PURE__*/ S.Array( ListRequestResourceTypes, ) as any as S.Schema; export type ListRequestStatus = "active" | "deleting" | "deleted"; export const ListRequestStatus = /*@__PURE__*/ S.String; export type ListRequestTagList = Array; export const ListRequestTagList = /*@__PURE__*/ S.Array( S.String, ) as any as S.Schema; export type ListRequestTargetType = "account" | "organization"; export const ListRequestTargetType = /*@__PURE__*/ S.String; export interface ListResourceSharingsRequest { /** Account identifier. */ accountId: string; /** Direction to sort objects. */ direction?: ListRequestDirection | (string & {}); /** Include recipient counts in the response. */ includeRecipientCounts?: boolean; /** Include resources in the response. */ includeResources?: boolean; /** Filter shares by kind. */ kind?: ListRequestKind | (string & {}); /** Order shares by values in the given field. */ order?: ListRequestOrder | (string & {}); /** Page number. Defaults to `1` when `per_page` is supplied without */ page?: number; /** Number of objects to return per page. Defaults to `20` when `page` */ perPage?: number; /** Filter share resources by resource_types. */ resourceTypes?: ListRequestResourceTypesList; /** Filter shares by status. */ status?: ListRequestStatus | (string & {}); /** Filter shares by tag. Each value is either `key=value` (matches shares whose tags contain that key/value pair) or `key` alone (matches shares that have any value for that key). May be repeated; multiple `tag` parameters are ANDed together. Maximum 20 `tag` parameters per request. */ tag?: ListRequestTagList; /** Filter shares by target_type. */ targetType?: ListRequestTargetType | (string & {}); } export const ListResourceSharingsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), direction: S.optional(ListRequestDirection.pipe(T.Query())), includeRecipientCounts: S.optional( S.Boolean.pipe(T.Query("include_recipient_counts")), ), includeResources: S.optional(S.Boolean.pipe(T.Query("include_resources"))), kind: S.optional(ListRequestKind.pipe(T.Query())), order: S.optional(ListRequestOrder.pipe(T.Query())), page: S.optional(S.Number.pipe(T.Query())), perPage: S.optional(S.Number.pipe(T.Query("per_page"))), resourceTypes: S.optional( ListRequestResourceTypesList.pipe(T.Query("resource_types")), ), status: S.optional(ListRequestStatus.pipe(T.Query())), tag: S.optional(ListRequestTagList.pipe(T.Query())), targetType: S.optional(ListRequestTargetType.pipe(T.Query("target_type"))), }) .pipe( T.Http({ method: "GET", uri: "/accounts/{account_id}/shares", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "ListResourceSharingsRequest", }) as any as S.Schema; export type ListResultItemStatus = "active" | "deleting" | "deleted"; export const ListResultItemStatus = /*@__PURE__*/ S.String; export type ListResultItemTargetType = "account" | "organization"; export const ListResultItemTargetType = /*@__PURE__*/ S.String; export type ListResultItemKind = "sent" | "received"; export const ListResultItemKind = /*@__PURE__*/ S.String; export type ListResultItemResourcesItemResourceType = | "custom-ruleset" | "gateway-policy" | "gateway-destination-ip" | "gateway-block-page-settings" | "gateway-extended-email-matching" | "idp-federation-grant"; export const ListResultItemResourcesItemResourceType = /*@__PURE__*/ S.String; export type ListResultItemResourcesItemStatus = | "active" | "deleting" | "deleted"; export const ListResultItemResourcesItemStatus = /*@__PURE__*/ S.String; export interface ListResultItemResourcesItem { /** Share Resource identifier. */ id: string; /** When the share was created. */ created: string; /** Resource Metadata. */ meta: unknown; /** When the share was modified. */ modified: string; /** Account identifier. */ resourceAccountId: string; /** Share Resource identifier. */ resourceId: string; /** Resource Type. */ resourceType: ListResultItemResourcesItemResourceType; /** Resource Version. */ resourceVersion: number; /** Resource Status. */ status: ListResultItemResourcesItemStatus; } export const ListResultItemResourcesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, created: S.String, meta: S.Unknown, modified: S.String, resourceAccountId: S.String.pipe(T.Body("resource_account_id")), resourceId: S.String.pipe(T.Body("resource_id")), resourceType: ListResultItemResourcesItemResourceType.pipe( T.Body("resource_type"), ), resourceVersion: S.Number.pipe(T.Body("resource_version")), status: ListResultItemResourcesItemStatus, }), ).annotate({ identifier: "ListResultItemResourcesItem", }) as any as S.Schema; export type ListResultItemResourcesList = Array; export const ListResultItemResourcesList = /*@__PURE__*/ S.Array( ListResultItemResourcesItem, ) as any as S.Schema; export interface ListResultItem { /** Share identifier tag. */ id: string; /** Account identifier. */ accountId: string; /** The display name of an account. */ accountName: string; /** When the share was created. */ created: string; /** When the share was modified. */ modified: string; /** The name of the share. */ name: string; /** Organization identifier. */ organizationId: string; status: ListResultItemStatus; targetType: ListResultItemTargetType; /** The number of recipients in the 'associated' state. This field is only included when requested via the 'include_recipient_counts' parameter. */ associatedRecipientCount?: number | null; /** The number of recipients in the 'associating' state. This field is only included when requested via the 'include_recipient_counts' parameter. */ associatingRecipientCount?: number | null; /** The number of recipients in the 'disassociated' state. This field is only included when requested via the 'include_recipient_counts' parameter. */ disassociatedRecipientCount?: number | null; /** The number of recipients in the 'disassociating' state. This field is only included when requested via the 'include_recipient_counts' parameter. */ disassociatingRecipientCount?: number | null; kind?: ListResultItemKind | null; /** A list of resources that are part of the share. This field is only included when requested via the 'include_resources' parameter. */ resources?: ListResultItemResourcesList | null; } export const ListResultItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, accountId: S.String.pipe(T.Body("account_id")), accountName: S.String.pipe(T.Body("account_name")), created: S.String, modified: S.String, name: S.String, organizationId: S.String.pipe(T.Body("organization_id")), status: ListResultItemStatus, targetType: ListResultItemTargetType.pipe(T.Body("target_type")), associatedRecipientCount: S.optional( S.NullOr(S.Number).pipe(T.Body("associated_recipient_count")), ), associatingRecipientCount: S.optional( S.NullOr(S.Number).pipe(T.Body("associating_recipient_count")), ), disassociatedRecipientCount: S.optional( S.NullOr(S.Number).pipe(T.Body("disassociated_recipient_count")), ), disassociatingRecipientCount: S.optional( S.NullOr(S.Number).pipe(T.Body("disassociating_recipient_count")), ), kind: S.optional(S.NullOr(ListResultItemKind)), resources: S.optional(S.NullOr(ListResultItemResourcesList)), }), ).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 ListResourceSharingsResponse { /** The unwrapped `result` payload of the v4 response envelope. */ result: ListResultList; /** Pagination info from the envelope's `result_info`. */ resultInfo?: ResultInfo | null; } export const ListResourceSharingsResponse = /*@__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: "ListResourceSharingsResponse", }) as any as S.Schema; export interface UpdateResourceRequest { /** Account identifier. */ accountId: string; /** Share identifier tag. */ shareId: string; /** Share Resource identifier. */ shareResourceId: string; /** Resource Metadata. */ meta: unknown; } export const UpdateResourceRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), shareId: S.String.pipe(T.Label("share_id")), shareResourceId: S.String.pipe(T.Label("share_resource_id")), meta: S.Unknown, }) .pipe( T.Http({ method: "PUT", uri: "/accounts/{account_id}/shares/{share_id}/resources/{share_resource_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateResourceRequest", }) as any as S.Schema; export type ResourcesUpdateResponseResourceType = | "custom-ruleset" | "gateway-policy" | "gateway-destination-ip" | "gateway-block-page-settings" | "gateway-extended-email-matching" | "idp-federation-grant"; export const ResourcesUpdateResponseResourceType = /*@__PURE__*/ S.String; export type ResourcesUpdateResponseStatus = "active" | "deleting" | "deleted"; export const ResourcesUpdateResponseStatus = /*@__PURE__*/ S.String; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface UpdateResourceResponse { /** Share Resource identifier. */ id: string; /** When the share was created. */ created: string; /** Resource Metadata. */ meta: unknown; /** When the share was modified. */ modified: string; /** Account identifier. */ resourceAccountId: string; /** Share Resource identifier. */ resourceId: string; /** Resource Type. */ resourceType: ResourcesUpdateResponseResourceType; /** Resource Version. */ resourceVersion: number; /** Resource Status. */ status: ResourcesUpdateResponseStatus; } export const UpdateResourceResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, created: S.String, meta: S.Unknown, modified: S.String, resourceAccountId: S.String.pipe(T.Body("resource_account_id")), resourceId: S.String.pipe(T.Body("resource_id")), resourceType: ResourcesUpdateResponseResourceType.pipe( T.Body("resource_type"), ), resourceVersion: S.Number.pipe(T.Body("resource_version")), status: ResourcesUpdateResponseStatus, }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateResourceResponse", }) as any as S.Schema; export interface UpdateResourceSharingRequest { /** Account identifier. */ accountId: string; /** Share identifier tag. */ shareId: string; /** The name of the share. */ name: string; } export const UpdateResourceSharingRequest = /*@__PURE__*/ S.suspend(() => S.Struct({ accountId: S.String.pipe(T.Label("account_id")), shareId: S.String.pipe(T.Label("share_id")), name: S.String, }) .pipe( T.Http({ method: "PUT", uri: "/accounts/{account_id}/shares/{share_id}", code: 200, }), ) .pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateResourceSharingRequest", }) as any as S.Schema; export type UpdateResponseStatus = "active" | "deleting" | "deleted"; export const UpdateResponseStatus = /*@__PURE__*/ S.String; export type UpdateResponseTargetType = "account" | "organization"; export const UpdateResponseTargetType = /*@__PURE__*/ S.String; export type UpdateResponseKind = "sent" | "received"; export const UpdateResponseKind = /*@__PURE__*/ S.String; export type UpdateResponseResourcesItemResourceType = | "custom-ruleset" | "gateway-policy" | "gateway-destination-ip" | "gateway-block-page-settings" | "gateway-extended-email-matching" | "idp-federation-grant"; export const UpdateResponseResourcesItemResourceType = /*@__PURE__*/ S.String; export type UpdateResponseResourcesItemStatus = | "active" | "deleting" | "deleted"; export const UpdateResponseResourcesItemStatus = /*@__PURE__*/ S.String; export interface UpdateResponseResourcesItem { /** Share Resource identifier. */ id: string; /** When the share was created. */ created: string; /** Resource Metadata. */ meta: unknown; /** When the share was modified. */ modified: string; /** Account identifier. */ resourceAccountId: string; /** Share Resource identifier. */ resourceId: string; /** Resource Type. */ resourceType: UpdateResponseResourcesItemResourceType; /** Resource Version. */ resourceVersion: number; /** Resource Status. */ status: UpdateResponseResourcesItemStatus; } export const UpdateResponseResourcesItem = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, created: S.String, meta: S.Unknown, modified: S.String, resourceAccountId: S.String.pipe(T.Body("resource_account_id")), resourceId: S.String.pipe(T.Body("resource_id")), resourceType: UpdateResponseResourcesItemResourceType.pipe( T.Body("resource_type"), ), resourceVersion: S.Number.pipe(T.Body("resource_version")), status: UpdateResponseResourcesItemStatus, }), ).annotate({ identifier: "UpdateResponseResourcesItem", }) as any as S.Schema; export type UpdateResponseResourcesList = Array; export const UpdateResponseResourcesList = /*@__PURE__*/ S.Array( UpdateResponseResourcesItem, ) as any as S.Schema; /** Unwrapped `result` payload of the Cloudflare v4 response envelope. */ export interface UpdateResourceSharingResponse { /** Share identifier tag. */ id: string; /** Account identifier. */ accountId: string; /** The display name of an account. */ accountName: string; /** When the share was created. */ created: string; /** When the share was modified. */ modified: string; /** The name of the share. */ name: string; /** Organization identifier. */ organizationId: string; status: UpdateResponseStatus; targetType: UpdateResponseTargetType; /** The number of recipients in the 'associated' state. This field is only included when requested via the 'include_recipient_counts' parameter. */ associatedRecipientCount?: number | null; /** The number of recipients in the 'associating' state. This field is only included when requested via the 'include_recipient_counts' parameter. */ associatingRecipientCount?: number | null; /** The number of recipients in the 'disassociated' state. This field is only included when requested via the 'include_recipient_counts' parameter. */ disassociatedRecipientCount?: number | null; /** The number of recipients in the 'disassociating' state. This field is only included when requested via the 'include_recipient_counts' parameter. */ disassociatingRecipientCount?: number | null; kind?: UpdateResponseKind | null; /** A list of resources that are part of the share. This field is only included when requested via the 'include_resources' parameter. */ resources?: UpdateResponseResourcesList | null; } export const UpdateResourceSharingResponse = /*@__PURE__*/ S.suspend(() => S.Struct({ id: S.String, accountId: S.String.pipe(T.Body("account_id")), accountName: S.String.pipe(T.Body("account_name")), created: S.String, modified: S.String, name: S.String, organizationId: S.String.pipe(T.Body("organization_id")), status: UpdateResponseStatus, targetType: UpdateResponseTargetType.pipe(T.Body("target_type")), associatedRecipientCount: S.optional( S.NullOr(S.Number).pipe(T.Body("associated_recipient_count")), ), associatingRecipientCount: S.optional( S.NullOr(S.Number).pipe(T.Body("associating_recipient_count")), ), disassociatedRecipientCount: S.optional( S.NullOr(S.Number).pipe(T.Body("disassociated_recipient_count")), ), disassociatingRecipientCount: S.optional( S.NullOr(S.Number).pipe(T.Body("disassociating_recipient_count")), ), kind: S.optional(S.NullOr(UpdateResponseKind)), resources: S.optional(S.NullOr(UpdateResponseResourcesList)), }).pipe(T.KeyDictionary(KEY_DICTIONARY)), ).annotate({ identifier: "UpdateResourceSharingResponse", }) as any as S.Schema; export type CreateRecipientError = | ShareNotFound | Forbidden | CloudflareOpError; /** Adds a recipient to a resource share, granting them access to the shared resources. */ export const createRecipient: API.OperationMethod< CreateRecipientRequest, CreateRecipientResponse, CreateRecipientError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateRecipientRequest, output: CreateRecipientResponse, errors: [ShareNotFound, Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateResourceError = ShareNotFound | Forbidden | CloudflareOpError; /** Adds a resource to an existing share, making it available to share recipients. */ export const createResource: API.OperationMethod< CreateResourceRequest, CreateResourceResponse, CreateResourceError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateResourceRequest, output: CreateResourceResponse, errors: [ShareNotFound, Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type CreateResourceSharingError = Forbidden | CloudflareOpError; /** Creates a new resource share for sharing Cloudflare resources with other accounts or organizations. */ export const createResourceSharing: API.OperationMethod< CreateResourceSharingRequest, CreateResourceSharingResponse, CreateResourceSharingError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: CreateResourceSharingRequest, output: CreateResourceSharingResponse, errors: [Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteRecipientError = | ShareRecipientNotFound | Forbidden | CloudflareOpError; /** Deletion is not immediate, an updated share recipient object with a new status will be returned. */ export const deleteRecipient: API.OperationMethod< DeleteRecipientRequest, DeleteRecipientResponse, DeleteRecipientError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteRecipientRequest, output: DeleteRecipientResponse, errors: [ ShareRecipientNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteResourceError = | ShareResourceNotFound | Forbidden | CloudflareOpError; /** Deletion is not immediate, an updated share resource object with a new status will be returned. */ export const deleteResource: API.OperationMethod< DeleteResourceRequest, DeleteResourceResponse, DeleteResourceError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteResourceRequest, output: DeleteResourceResponse, errors: [ ShareResourceNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type DeleteResourceSharingError = | ShareNotFound | Forbidden | CloudflareOpError; /** Deletion is not immediate, an updated share object with a new status will be returned. */ export const deleteResourceSharing: API.OperationMethod< DeleteResourceSharingRequest, DeleteResourceSharingResponse, DeleteResourceSharingError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: DeleteResourceSharingRequest, output: DeleteResourceSharingResponse, errors: [ShareNotFound, Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetRecipientError = | ShareRecipientNotFound | Forbidden | CloudflareOpError; /** Get share recipient by ID. */ export const getRecipient: API.OperationMethod< GetRecipientRequest, GetRecipientResponse, GetRecipientError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetRecipientRequest, output: GetRecipientResponse, errors: [ ShareRecipientNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetResourceError = | ShareResourceNotFound | Forbidden | CloudflareOpError; /** Get share resource by ID. */ export const getResource: API.OperationMethod< GetResourceRequest, GetResourceResponse, GetResourceError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetResourceRequest, output: GetResourceResponse, errors: [ ShareResourceNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type GetResourceSharingError = | ShareNotFound | Forbidden | CloudflareOpError; /** Fetches share by ID. */ export const getResourceSharing: API.OperationMethod< GetResourceSharingRequest, GetResourceSharingResponse, GetResourceSharingError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: GetResourceSharingRequest, output: GetResourceSharingResponse, errors: [ShareNotFound, Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type ListRecipientsError = ShareNotFound | Forbidden | CloudflareOpError; /** List share recipients by share ID. */ export const listRecipients: API.PaginatedOperationMethod< ListRecipientsRequest, ListRecipientsResponse, ListRecipientsError, CloudflareOpContext, RecipientsListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListRecipientsRequest, output: ListRecipientsResponse, errors: [ShareNotFound, Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "page", inputToken: "page", outputToken: "resultInfo.page", items: "result", pageSize: "perPage", } as const, }), cloudflarePaginate, ) as any; export type ListResourcesError = ShareNotFound | Forbidden | CloudflareOpError; /** List share resources by share ID. */ export const listResources: API.PaginatedOperationMethod< ListResourcesRequest, ListResourcesResponse, ListResourcesError, CloudflareOpContext, ResourcesListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListResourcesRequest, output: ListResourcesResponse, errors: [ShareNotFound, Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "page", inputToken: "page", outputToken: "resultInfo.page", items: "result", pageSize: "perPage", } as const, }), cloudflarePaginate, ) as any; export type ListResourceSharingsError = Forbidden | CloudflareOpError; /** Lists all account shares. */ export const listResourceSharings: API.PaginatedOperationMethod< ListResourceSharingsRequest, ListResourceSharingsResponse, ListResourceSharingsError, CloudflareOpContext, ListResultItem > = /*@__PURE__*/ API.makePaginated( () => ({ input: ListResourceSharingsRequest, output: ListResourceSharingsResponse, errors: [Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflarePaginatedProtocol, retry: Retry.Retry, pagination: { mode: "page", inputToken: "page", outputToken: "resultInfo.page", items: "result", pageSize: "perPage", } as const, }), cloudflarePaginate, ) as any; export type UpdateResourceError = | ShareResourceNotFound | Forbidden | CloudflareOpError; /** Update is not immediate, an updated share resource object with a new status will be returned. */ export const updateResource: API.OperationMethod< UpdateResourceRequest, UpdateResourceResponse, UpdateResourceError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateResourceRequest, output: UpdateResourceResponse, errors: [ ShareResourceNotFound, Forbidden, CloudflareRateLimited, CloudflareError, ], protocol: CloudflareProtocol, retry: Retry.Retry, })); export type UpdateResourceSharingError = | ShareNotFound | Forbidden | CloudflareOpError; /** Updating is not immediate, an updated share object with a new status will be returned. */ export const updateResourceSharing: API.OperationMethod< UpdateResourceSharingRequest, UpdateResourceSharingResponse, UpdateResourceSharingError, CloudflareOpContext > = /*@__PURE__*/ API.make(() => ({ input: UpdateResourceSharingRequest, output: UpdateResourceSharingResponse, errors: [ShareNotFound, Forbidden, CloudflareRateLimited, CloudflareError], protocol: CloudflareProtocol, retry: Retry.Retry, }));