/**
 * Cloudflare USER API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service user
 */
import * as Schema from "effect/Schema";
import * as API from "../client/api.js";
import * as T from "../traits.js";
import {} from "../errors.js";
// =============================================================================
// Errors
// =============================================================================
export class InvalidRoute extends Schema.TaggedErrorClass()("InvalidRoute", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(InvalidRoute, [{ code: 7003 }]);
export class InvalidTokenName extends Schema.TaggedErrorClass()("InvalidTokenName", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(InvalidTokenName, [
    { code: 400, message: { includes: "name must have a length" } },
]);
export class MethodNotAllowed extends Schema.TaggedErrorClass()("MethodNotAllowed", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(MethodNotAllowed, [{ code: 7001 }]);
export class PermissionGroupNotFound extends Schema.TaggedErrorClass()("PermissionGroupNotFound", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(PermissionGroupNotFound, [
    { code: 1001, message: { includes: "Permission group" } },
]);
export class TokenNotFound extends Schema.TaggedErrorClass()("TokenNotFound", { code: Schema.Number, message: Schema.String }) {
}
T.applyErrorMatchers(TokenNotFound, [{ code: 1003 }]);
export const ListAuditLogsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({}).pipe(T.Http({ method: "GET", path: "/user/audit_logs" }));
export const ListAuditLogsResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        action: Schema.optional(Schema.Union([
            Schema.Struct({
                result: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                type: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
            Schema.Null,
        ])),
        actor: Schema.optional(Schema.Union([
            Schema.Struct({
                id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                email: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                ip: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                type: Schema.optional(Schema.Union([
                    Schema.Literals(["user", "admin", "Cloudflare"]),
                    Schema.Null,
                ])),
            }),
            Schema.Null,
        ])),
        interface: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        metadata: Schema.optional(Schema.Union([Schema.Unknown, Schema.Null])),
        newValue: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        oldValue: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        owner: Schema.optional(Schema.Union([
            Schema.Struct({
                id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
            Schema.Null,
        ])),
        resource: Schema.optional(Schema.Union([
            Schema.Struct({
                id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                type: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
            Schema.Null,
        ])),
        when: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    })),
    resultInfo: Schema.optional(Schema.Union([
        Schema.Struct({
            count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            count: "count",
            page: "page",
            perPage: "per_page",
            totalCount: "total_count",
        })),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({ result: "result", resultInfo: "result_info" }));
export const listAuditLogs = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListAuditLogsRequest,
    output: ListAuditLogsResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const ListBillingHistoriesRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({}).pipe(T.Http({ method: "GET", path: "/user/billing/history" }));
export const ListBillingHistoriesResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.String,
        action: Schema.String,
        amount: Schema.Number,
        currency: Schema.String,
        description: Schema.String,
        occurredAt: Schema.String,
        type: Schema.String,
        zone: Schema.Struct({
            name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
    }).pipe(Schema.encodeKeys({
        id: "id",
        action: "action",
        amount: "amount",
        currency: "currency",
        description: "description",
        occurredAt: "occurred_at",
        type: "type",
        zone: "zone",
    }))),
    resultInfo: Schema.optional(Schema.Union([
        Schema.Struct({
            count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            count: "count",
            page: "page",
            perPage: "per_page",
            totalCount: "total_count",
        })),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({ result: "result", resultInfo: "result_info" }));
export const listBillingHistories = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListBillingHistoriesRequest,
    output: ListBillingHistoriesResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const GetBillingProfileRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({}).pipe(T.Http({ method: "GET", path: "/user/billing/profile" }));
export const GetBillingProfileResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    accountType: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    address: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    address2: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    balance: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    cardExpiryMonth: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    cardExpiryYear: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    cardNumber: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    city: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    company: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    country: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    deviceData: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    editedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    enterpriseBillingEmail: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    enterprisePrimaryEmail: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    firstName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    isPartner: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    lastName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    nextBillDate: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    paymentAddress: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    paymentAddress2: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    paymentCity: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    paymentCountry: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    paymentEmail: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    paymentFirstName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    paymentGateway: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    paymentLastName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    paymentNonce: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    paymentState: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    paymentZipcode: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    primaryEmail: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    state: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    taxIdType: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    telephone: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    useLegacy: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    validationCode: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    vat: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    zipcode: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    accountType: "account_type",
    address: "address",
    address2: "address2",
    balance: "balance",
    cardExpiryMonth: "card_expiry_month",
    cardExpiryYear: "card_expiry_year",
    cardNumber: "card_number",
    city: "city",
    company: "company",
    country: "country",
    createdOn: "created_on",
    deviceData: "device_data",
    editedOn: "edited_on",
    enterpriseBillingEmail: "enterprise_billing_email",
    enterprisePrimaryEmail: "enterprise_primary_email",
    firstName: "first_name",
    isPartner: "is_partner",
    lastName: "last_name",
    nextBillDate: "next_bill_date",
    paymentAddress: "payment_address",
    paymentAddress2: "payment_address2",
    paymentCity: "payment_city",
    paymentCountry: "payment_country",
    paymentEmail: "payment_email",
    paymentFirstName: "payment_first_name",
    paymentGateway: "payment_gateway",
    paymentLastName: "payment_last_name",
    paymentNonce: "payment_nonce",
    paymentState: "payment_state",
    paymentZipcode: "payment_zipcode",
    primaryEmail: "primary_email",
    state: "state",
    taxIdType: "tax_id_type",
    telephone: "telephone",
    useLegacy: "use_legacy",
    validationCode: "validation_code",
    vat: "vat",
    zipcode: "zipcode",
}))
    .pipe(T.ResponsePath("result"));
export const getBillingProfile = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetBillingProfileRequest,
    output: GetBillingProfileResponse,
    errors: [],
}));
export const GetInviteRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    inviteId: Schema.String.pipe(T.HttpPath("inviteId")),
}).pipe(T.Http({ method: "GET", path: "/user/invites/{inviteId}" }));
export const GetInviteResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    invitedMemberId: Schema.Union([Schema.String, Schema.Null]),
    organizationId: Schema.String,
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    expiresOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    invitedBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    invitedMemberEmail: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    invitedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    organizationIsEnforcingTwofactor: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    organizationName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    roles: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
    status: Schema.optional(Schema.Union([
        Schema.Literals(["pending", "accepted", "rejected", "expired"]),
        Schema.Null,
    ])),
})
    .pipe(Schema.encodeKeys({
    invitedMemberId: "invited_member_id",
    organizationId: "organization_id",
    id: "id",
    expiresOn: "expires_on",
    invitedBy: "invited_by",
    invitedMemberEmail: "invited_member_email",
    invitedOn: "invited_on",
    organizationIsEnforcingTwofactor: "organization_is_enforcing_twofactor",
    organizationName: "organization_name",
    roles: "roles",
    status: "status",
}))
    .pipe(T.ResponsePath("result"));
export const getInvite = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetInviteRequest,
    output: GetInviteResponse,
    errors: [],
}));
export const ListInvitesRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({}).pipe(T.Http({ method: "GET", path: "/user/invites" }));
export const ListInvitesResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        invitedMemberId: Schema.Union([Schema.String, Schema.Null]),
        organizationId: Schema.String,
        id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        expiresOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        invitedBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        invitedMemberEmail: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        invitedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        organizationIsEnforcingTwofactor: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        organizationName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        roles: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
        status: Schema.optional(Schema.Union([
            Schema.Literals(["pending", "accepted", "rejected", "expired"]),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        invitedMemberId: "invited_member_id",
        organizationId: "organization_id",
        id: "id",
        expiresOn: "expires_on",
        invitedBy: "invited_by",
        invitedMemberEmail: "invited_member_email",
        invitedOn: "invited_on",
        organizationIsEnforcingTwofactor: "organization_is_enforcing_twofactor",
        organizationName: "organization_name",
        roles: "roles",
        status: "status",
    }))),
});
export const listInvites = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListInvitesRequest,
    output: ListInvitesResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const PatchInviteRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    inviteId: Schema.String.pipe(T.HttpPath("inviteId")),
    status: Schema.Literals(["accepted", "rejected"]),
}).pipe(T.Http({ method: "PATCH", path: "/user/invites/{inviteId}" }));
export const PatchInviteResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    invitedMemberId: Schema.Union([Schema.String, Schema.Null]),
    organizationId: Schema.String,
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    expiresOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    invitedBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    invitedMemberEmail: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    invitedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    organizationIsEnforcingTwofactor: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    organizationName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    roles: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
    status: Schema.optional(Schema.Union([
        Schema.Literals(["pending", "accepted", "rejected", "expired"]),
        Schema.Null,
    ])),
})
    .pipe(Schema.encodeKeys({
    invitedMemberId: "invited_member_id",
    organizationId: "organization_id",
    id: "id",
    expiresOn: "expires_on",
    invitedBy: "invited_by",
    invitedMemberEmail: "invited_member_email",
    invitedOn: "invited_on",
    organizationIsEnforcingTwofactor: "organization_is_enforcing_twofactor",
    organizationName: "organization_name",
    roles: "roles",
    status: "status",
}))
    .pipe(T.ResponsePath("result"));
export const patchInvite = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchInviteRequest,
    output: PatchInviteResponse,
    errors: [],
}));
export const GetOrganizationRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    organizationId: Schema.String.pipe(T.HttpPath("organizationId")),
}).pipe(T.Http({ method: "GET", path: "/user/organizations/{organizationId}" }));
export const GetOrganizationResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown.pipe(T.ResponsePath("result"));
export const getOrganization = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetOrganizationRequest,
    output: GetOrganizationResponse,
    errors: [],
}));
export const ListOrganizationsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({}).pipe(T.Http({ method: "GET", path: "/user/organizations" }));
export const ListOrganizationsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        permissions: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
        roles: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
        status: Schema.optional(Schema.Union([Schema.Literals(["member", "invited"]), Schema.Null])),
    })),
    resultInfo: Schema.optional(Schema.Union([
        Schema.Struct({
            count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            count: "count",
            page: "page",
            perPage: "per_page",
            totalCount: "total_count",
        })),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({ result: "result", resultInfo: "result_info" }));
export const listOrganizations = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListOrganizationsRequest,
    output: ListOrganizationsResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const DeleteOrganizationRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    organizationId: Schema.String.pipe(T.HttpPath("organizationId")),
}).pipe(T.Http({ method: "DELETE", path: "/user/organizations/{organizationId}" }));
export const DeleteOrganizationResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
});
export const deleteOrganization = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteOrganizationRequest,
    output: DeleteOrganizationResponse,
    errors: [],
}));
export const GetSubscriptionRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({}).pipe(T.Http({ method: "GET", path: "/user/subscriptions" }));
export const GetSubscriptionResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        currency: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        currentPeriodEnd: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        currentPeriodStart: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        frequency: Schema.optional(Schema.Union([
            Schema.Literals(["weekly", "monthly", "quarterly", "yearly"]),
            Schema.Null,
        ])),
        price: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        ratePlan: Schema.optional(Schema.Union([
            Schema.Struct({
                id: Schema.optional(Schema.Union([
                    Schema.Literals([
                        "free",
                        "lite",
                        "pro",
                        "pro_plus",
                        "business",
                        "enterprise",
                        "partners_free",
                        "partners_pro",
                        "partners_business",
                        "partners_enterprise",
                    ]),
                    Schema.Null,
                ])),
                currency: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                externallyManaged: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                isContract: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                publicName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                scope: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                sets: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
            }).pipe(Schema.encodeKeys({
                id: "id",
                currency: "currency",
                externallyManaged: "externally_managed",
                isContract: "is_contract",
                publicName: "public_name",
                scope: "scope",
                sets: "sets",
            })),
            Schema.Null,
        ])),
        state: Schema.optional(Schema.Union([
            Schema.Literals([
                "Trial",
                "Provisioned",
                "Paid",
                "AwaitingPayment",
                "Cancelled",
                "Failed",
                "Expired",
            ]),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        currency: "currency",
        currentPeriodEnd: "current_period_end",
        currentPeriodStart: "current_period_start",
        frequency: "frequency",
        price: "price",
        ratePlan: "rate_plan",
        state: "state",
    }))),
});
export const getSubscription = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: GetSubscriptionRequest,
    output: GetSubscriptionResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const PutSubscriptionRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    identifier: Schema.String.pipe(T.HttpPath("identifier")),
    frequency: Schema.optional(Schema.Literals(["weekly", "monthly", "quarterly", "yearly"])),
    ratePlan: Schema.optional(Schema.Struct({
        id: Schema.optional(Schema.Literals([
            "free",
            "lite",
            "pro",
            "pro_plus",
            "business",
            "enterprise",
            "partners_free",
            "partners_pro",
            "partners_business",
            "partners_enterprise",
        ])),
        currency: Schema.optional(Schema.String),
        externallyManaged: Schema.optional(Schema.Boolean),
        isContract: Schema.optional(Schema.Boolean),
        publicName: Schema.optional(Schema.String),
        scope: Schema.optional(Schema.String),
        sets: Schema.optional(Schema.Array(Schema.String)),
    }).pipe(Schema.encodeKeys({
        id: "id",
        currency: "currency",
        externallyManaged: "externally_managed",
        isContract: "is_contract",
        publicName: "public_name",
        scope: "scope",
        sets: "sets",
    }))),
}).pipe(Schema.encodeKeys({ frequency: "frequency", ratePlan: "rate_plan" }), T.Http({ method: "PUT", path: "/user/subscriptions/{identifier}" }));
export const PutSubscriptionResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([Schema.String, Schema.Null]).pipe(T.ResponsePath("result"));
export const putSubscription = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutSubscriptionRequest,
    output: PutSubscriptionResponse,
    errors: [],
}));
export const DeleteSubscriptionRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    identifier: Schema.String.pipe(T.HttpPath("identifier")),
}).pipe(T.Http({ method: "DELETE", path: "/user/subscriptions/{identifier}" }));
export const DeleteSubscriptionResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    subscriptionId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(Schema.encodeKeys({ subscriptionId: "subscription_id" }));
export const deleteSubscription = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteSubscriptionRequest,
    output: DeleteSubscriptionResponse,
    errors: [],
}));
export const GetTokenRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    tokenId: Schema.String.pipe(T.HttpPath("tokenId")),
}).pipe(T.Http({ method: "GET", path: "/user/tokens/{tokenId}" }));
export const GetTokenResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    condition: Schema.optional(Schema.Union([
        Schema.Struct({
            requestIp: Schema.optional(Schema.Union([
                Schema.Struct({
                    in: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
                    notIn: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
                }).pipe(Schema.encodeKeys({ in: "in", notIn: "not_in" })),
                Schema.Null,
            ])),
        }).pipe(Schema.encodeKeys({ requestIp: "request_ip" })),
        Schema.Null,
    ])),
    expiresOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    issuedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    lastUsedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    notBefore: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    policies: Schema.optional(Schema.Union([
        Schema.Array(Schema.Struct({
            id: Schema.String,
            effect: Schema.Literals(["allow", "deny"]),
            permissionGroups: Schema.Array(Schema.Struct({
                id: Schema.String,
                meta: Schema.optional(Schema.Union([
                    Schema.Struct({
                        key: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    }),
                    Schema.Null,
                ])),
                name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            })),
            resources: Schema.Record(Schema.String, Schema.Unknown),
        }).pipe(Schema.encodeKeys({
            id: "id",
            effect: "effect",
            permissionGroups: "permission_groups",
            resources: "resources",
        }))),
        Schema.Null,
    ])),
    status: Schema.optional(Schema.Union([
        Schema.Literals(["active", "disabled", "expired"]),
        Schema.Null,
    ])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    condition: "condition",
    expiresOn: "expires_on",
    issuedOn: "issued_on",
    lastUsedOn: "last_used_on",
    modifiedOn: "modified_on",
    name: "name",
    notBefore: "not_before",
    policies: "policies",
    status: "status",
}))
    .pipe(T.ResponsePath("result"));
export const getToken = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetTokenRequest,
    output: GetTokenResponse,
    errors: [InvalidRoute, TokenNotFound],
}));
export const ListTokensRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({}).pipe(T.Http({ method: "GET", path: "/user/tokens" }));
export const ListTokensResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        condition: Schema.optional(Schema.Union([
            Schema.Struct({
                requestIp: Schema.optional(Schema.Union([
                    Schema.Struct({
                        in: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
                        notIn: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
                    }).pipe(Schema.encodeKeys({ in: "in", notIn: "not_in" })),
                    Schema.Null,
                ])),
            }).pipe(Schema.encodeKeys({ requestIp: "request_ip" })),
            Schema.Null,
        ])),
        expiresOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        issuedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        lastUsedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        notBefore: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        policies: Schema.optional(Schema.Union([
            Schema.Array(Schema.Struct({
                id: Schema.String,
                effect: Schema.Literals(["allow", "deny"]),
                permissionGroups: Schema.Array(Schema.Struct({
                    id: Schema.String,
                    meta: Schema.optional(Schema.Union([
                        Schema.Struct({
                            key: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        }),
                        Schema.Null,
                    ])),
                    name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                })),
                resources: Schema.Record(Schema.String, Schema.Unknown),
            }).pipe(Schema.encodeKeys({
                id: "id",
                effect: "effect",
                permissionGroups: "permission_groups",
                resources: "resources",
            }))),
            Schema.Null,
        ])),
        status: Schema.optional(Schema.Union([
            Schema.Literals(["active", "disabled", "expired"]),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        condition: "condition",
        expiresOn: "expires_on",
        issuedOn: "issued_on",
        lastUsedOn: "last_used_on",
        modifiedOn: "modified_on",
        name: "name",
        notBefore: "not_before",
        policies: "policies",
        status: "status",
    }))),
    resultInfo: Schema.optional(Schema.Union([
        Schema.Struct({
            count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            count: "count",
            page: "page",
            perPage: "per_page",
            totalCount: "total_count",
        })),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({ result: "result", resultInfo: "result_info" }));
export const listTokens = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListTokensRequest,
    output: ListTokensResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateTokenRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    name: Schema.String,
    policies: Schema.Array(Schema.Struct({
        effect: Schema.Literals(["allow", "deny"]),
        permissionGroups: Schema.Array(Schema.Struct({
            id: Schema.String,
            meta: Schema.optional(Schema.Struct({
                key: Schema.optional(Schema.String),
                value: Schema.optional(Schema.String),
            })),
        })),
        resources: Schema.Record(Schema.String, Schema.Unknown),
    }).pipe(Schema.encodeKeys({
        effect: "effect",
        permissionGroups: "permission_groups",
        resources: "resources",
    }))),
    condition: Schema.optional(Schema.Struct({
        requestIp: Schema.optional(Schema.Struct({
            in: Schema.optional(Schema.Array(Schema.String)),
            notIn: Schema.optional(Schema.Array(Schema.String)),
        }).pipe(Schema.encodeKeys({ in: "in", notIn: "not_in" }))),
    }).pipe(Schema.encodeKeys({ requestIp: "request_ip" }))),
    expiresOn: Schema.optional(Schema.String),
    notBefore: Schema.optional(Schema.String),
}).pipe(Schema.encodeKeys({
    name: "name",
    policies: "policies",
    condition: "condition",
    expiresOn: "expires_on",
    notBefore: "not_before",
}), T.Http({ method: "POST", path: "/user/tokens" }));
export const CreateTokenResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    condition: Schema.optional(Schema.Union([
        Schema.Struct({
            requestIp: Schema.optional(Schema.Union([
                Schema.Struct({
                    in: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
                    notIn: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
                }).pipe(Schema.encodeKeys({ in: "in", notIn: "not_in" })),
                Schema.Null,
            ])),
        }).pipe(Schema.encodeKeys({ requestIp: "request_ip" })),
        Schema.Null,
    ])),
    expiresOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    issuedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    lastUsedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    notBefore: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    policies: Schema.optional(Schema.Union([
        Schema.Array(Schema.Struct({
            id: Schema.String,
            effect: Schema.Literals(["allow", "deny"]),
            permissionGroups: Schema.Array(Schema.Struct({
                id: Schema.String,
                meta: Schema.optional(Schema.Union([
                    Schema.Struct({
                        key: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    }),
                    Schema.Null,
                ])),
                name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            })),
            resources: Schema.Record(Schema.String, Schema.Unknown),
        }).pipe(Schema.encodeKeys({
            id: "id",
            effect: "effect",
            permissionGroups: "permission_groups",
            resources: "resources",
        }))),
        Schema.Null,
    ])),
    status: Schema.optional(Schema.Union([
        Schema.Literals(["active", "disabled", "expired"]),
        Schema.Null,
    ])),
    value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    condition: "condition",
    expiresOn: "expires_on",
    issuedOn: "issued_on",
    lastUsedOn: "last_used_on",
    modifiedOn: "modified_on",
    name: "name",
    notBefore: "not_before",
    policies: "policies",
    status: "status",
    value: "value",
}))
    .pipe(T.ResponsePath("result"));
export const createToken = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateTokenRequest,
    output: CreateTokenResponse,
    errors: [InvalidRoute, InvalidTokenName, PermissionGroupNotFound],
}));
export const UpdateTokenRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    tokenId: Schema.String.pipe(T.HttpPath("tokenId")),
    name: Schema.String,
    policies: Schema.Array(Schema.Struct({
        effect: Schema.Literals(["allow", "deny"]),
        permissionGroups: Schema.Array(Schema.Struct({
            id: Schema.String,
            meta: Schema.optional(Schema.Struct({
                key: Schema.optional(Schema.String),
                value: Schema.optional(Schema.String),
            })),
        })),
        resources: Schema.Record(Schema.String, Schema.Unknown),
    }).pipe(Schema.encodeKeys({
        effect: "effect",
        permissionGroups: "permission_groups",
        resources: "resources",
    }))),
    condition: Schema.optional(Schema.Struct({
        requestIp: Schema.optional(Schema.Struct({
            in: Schema.optional(Schema.Array(Schema.String)),
            notIn: Schema.optional(Schema.Array(Schema.String)),
        }).pipe(Schema.encodeKeys({ in: "in", notIn: "not_in" }))),
    }).pipe(Schema.encodeKeys({ requestIp: "request_ip" }))),
    expiresOn: Schema.optional(Schema.String),
    notBefore: Schema.optional(Schema.String),
    status: Schema.optional(Schema.Literals(["active", "disabled", "expired"])),
}).pipe(Schema.encodeKeys({
    name: "name",
    policies: "policies",
    condition: "condition",
    expiresOn: "expires_on",
    notBefore: "not_before",
    status: "status",
}), T.Http({ method: "PUT", path: "/user/tokens/{tokenId}" }));
export const UpdateTokenResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    condition: Schema.optional(Schema.Union([
        Schema.Struct({
            requestIp: Schema.optional(Schema.Union([
                Schema.Struct({
                    in: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
                    notIn: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
                }).pipe(Schema.encodeKeys({ in: "in", notIn: "not_in" })),
                Schema.Null,
            ])),
        }).pipe(Schema.encodeKeys({ requestIp: "request_ip" })),
        Schema.Null,
    ])),
    expiresOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    issuedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    lastUsedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    notBefore: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    policies: Schema.optional(Schema.Union([
        Schema.Array(Schema.Struct({
            id: Schema.String,
            effect: Schema.Literals(["allow", "deny"]),
            permissionGroups: Schema.Array(Schema.Struct({
                id: Schema.String,
                meta: Schema.optional(Schema.Union([
                    Schema.Struct({
                        key: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    }),
                    Schema.Null,
                ])),
                name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            })),
            resources: Schema.Record(Schema.String, Schema.Unknown),
        }).pipe(Schema.encodeKeys({
            id: "id",
            effect: "effect",
            permissionGroups: "permission_groups",
            resources: "resources",
        }))),
        Schema.Null,
    ])),
    status: Schema.optional(Schema.Union([
        Schema.Literals(["active", "disabled", "expired"]),
        Schema.Null,
    ])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    condition: "condition",
    expiresOn: "expires_on",
    issuedOn: "issued_on",
    lastUsedOn: "last_used_on",
    modifiedOn: "modified_on",
    name: "name",
    notBefore: "not_before",
    policies: "policies",
    status: "status",
}))
    .pipe(T.ResponsePath("result"));
export const updateToken = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateTokenRequest,
    output: UpdateTokenResponse,
    errors: [
        InvalidRoute,
        MethodNotAllowed,
        TokenNotFound,
        PermissionGroupNotFound,
    ],
}));
export const DeleteTokenRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    tokenId: Schema.String.pipe(T.HttpPath("tokenId")),
}).pipe(T.Http({ method: "DELETE", path: "/user/tokens/{tokenId}" }));
export const DeleteTokenResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
}).pipe(T.ResponsePath("result"));
export const deleteToken = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteTokenRequest,
    output: DeleteTokenResponse,
    errors: [InvalidRoute, MethodNotAllowed, TokenNotFound],
}));
export const VerifyTokenRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({}).pipe(T.Http({ method: "GET", path: "/user/tokens/verify" }));
export const VerifyTokenResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    status: Schema.Literals(["active", "disabled", "expired"]),
    expiresOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    notBefore: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    status: "status",
    expiresOn: "expires_on",
    notBefore: "not_before",
}))
    .pipe(T.ResponsePath("result"));
export const verifyToken = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: VerifyTokenRequest,
    output: VerifyTokenResponse,
    errors: [],
}));
export const ListTokenPermissionGroupsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({}).pipe(T.Http({ method: "GET", path: "/user/tokens/permission_groups" }));
export const ListTokenPermissionGroupsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        scopes: Schema.optional(Schema.Union([
            Schema.Array(Schema.Literals([
                "com.cloudflare.api.account",
                "com.cloudflare.api.account.zone",
                "com.cloudflare.api.user",
                "com.cloudflare.edge.r2.bucket",
            ])),
            Schema.Null,
        ])),
    })),
});
export const listTokenPermissionGroups = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListTokenPermissionGroupsRequest,
    output: ListTokenPermissionGroupsResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const PutTokenValueRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    tokenId: Schema.String.pipe(T.HttpPath("tokenId")),
}).pipe(T.Http({ method: "PUT", path: "/user/tokens/{tokenId}/value" }));
export const PutTokenValueResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.String.pipe(T.ResponsePath("result"));
export const putTokenValue = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutTokenValueRequest,
    output: PutTokenValueResponse,
    errors: [InvalidRoute, TokenNotFound],
}));
export const GetUserRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({}).pipe(T.Http({ method: "GET", path: "/user" }));
export const GetUserResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    betas: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
    country: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    firstName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    hasBusinessZones: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    hasEnterpriseZones: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    hasProZones: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    lastName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    organizations: Schema.optional(Schema.Union([
        Schema.Array(Schema.Struct({
            id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            permissions: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
            roles: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
            status: Schema.optional(Schema.Union([Schema.Literals(["member", "invited"]), Schema.Null])),
        })),
        Schema.Null,
    ])),
    suspended: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    telephone: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    twoFactorAuthenticationEnabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    twoFactorAuthenticationLocked: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    zipcode: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    betas: "betas",
    country: "country",
    firstName: "first_name",
    hasBusinessZones: "has_business_zones",
    hasEnterpriseZones: "has_enterprise_zones",
    hasProZones: "has_pro_zones",
    lastName: "last_name",
    organizations: "organizations",
    suspended: "suspended",
    telephone: "telephone",
    twoFactorAuthenticationEnabled: "two_factor_authentication_enabled",
    twoFactorAuthenticationLocked: "two_factor_authentication_locked",
    zipcode: "zipcode",
}))
    .pipe(T.ResponsePath("result"));
export const getUser = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetUserRequest,
    output: GetUserResponse,
    errors: [],
}));
export const PatchUserRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    country: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    firstName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    lastName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    telephone: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    zipcode: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(Schema.encodeKeys({
    country: "country",
    firstName: "first_name",
    lastName: "last_name",
    telephone: "telephone",
    zipcode: "zipcode",
}), T.Http({ method: "PATCH", path: "/user" }));
export const PatchUserResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    betas: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
    country: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    firstName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    hasBusinessZones: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    hasEnterpriseZones: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    hasProZones: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    lastName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    organizations: Schema.optional(Schema.Union([
        Schema.Array(Schema.Struct({
            id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            permissions: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
            roles: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
            status: Schema.optional(Schema.Union([Schema.Literals(["member", "invited"]), Schema.Null])),
        })),
        Schema.Null,
    ])),
    suspended: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    telephone: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    twoFactorAuthenticationEnabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    twoFactorAuthenticationLocked: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    zipcode: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    betas: "betas",
    country: "country",
    firstName: "first_name",
    hasBusinessZones: "has_business_zones",
    hasEnterpriseZones: "has_enterprise_zones",
    hasProZones: "has_pro_zones",
    lastName: "last_name",
    organizations: "organizations",
    suspended: "suspended",
    telephone: "telephone",
    twoFactorAuthenticationEnabled: "two_factor_authentication_enabled",
    twoFactorAuthenticationLocked: "two_factor_authentication_locked",
    zipcode: "zipcode",
}))
    .pipe(T.ResponsePath("result"));
export const patchUser = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchUserRequest,
    output: PatchUserResponse,
    errors: [],
}));
//# sourceMappingURL=user.js.map