/**
 * Cloudflare ORGANIZATIONS API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service organizations
 */
import * as Schema from "effect/Schema";
import * as API from "../client/api.js";
import * as T from "../traits.js";
import {} from "../errors.js";
export const GetOrganizationRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    organizationId: Schema.String.pipe(T.HttpPath("organizationId")),
}).pipe(T.Http({ method: "GET", path: "/organizations/{organizationId}" }));
export const GetOrganizationResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    createTime: Schema.String,
    meta: Schema.Struct({
        flags: Schema.optional(Schema.Union([
            Schema.Struct({
                accountCreation: Schema.String,
                accountDeletion: Schema.String,
                accountMigration: Schema.String,
                accountMobility: Schema.String,
                subOrgCreation: Schema.String,
            }).pipe(Schema.encodeKeys({
                accountCreation: "account_creation",
                accountDeletion: "account_deletion",
                accountMigration: "account_migration",
                accountMobility: "account_mobility",
                subOrgCreation: "sub_org_creation",
            })),
            Schema.Null,
        ])),
        managedBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({ flags: "flags", managedBy: "managed_by" })),
    name: Schema.String,
    parent: Schema.optional(Schema.Union([
        Schema.Struct({
            id: Schema.String,
            name: Schema.String,
        }),
        Schema.Null,
    ])),
    profile: Schema.optional(Schema.Union([
        Schema.Struct({
            businessAddress: Schema.String,
            businessEmail: Schema.String,
            businessName: Schema.String,
            businessPhone: Schema.String,
            externalMetadata: Schema.String,
        }).pipe(Schema.encodeKeys({
            businessAddress: "business_address",
            businessEmail: "business_email",
            businessName: "business_name",
            businessPhone: "business_phone",
            externalMetadata: "external_metadata",
        })),
        Schema.Null,
    ])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    createTime: "create_time",
    meta: "meta",
    name: "name",
    parent: "parent",
    profile: "profile",
}))
    .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: "/organizations" }));
export const ListOrganizationsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.String,
        createTime: Schema.String,
        meta: Schema.Struct({
            flags: Schema.optional(Schema.Union([
                Schema.Struct({
                    accountCreation: Schema.String,
                    accountDeletion: Schema.String,
                    accountMigration: Schema.String,
                    accountMobility: Schema.String,
                    subOrgCreation: Schema.String,
                }).pipe(Schema.encodeKeys({
                    accountCreation: "account_creation",
                    accountDeletion: "account_deletion",
                    accountMigration: "account_migration",
                    accountMobility: "account_mobility",
                    subOrgCreation: "sub_org_creation",
                })),
                Schema.Null,
            ])),
            managedBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }).pipe(Schema.encodeKeys({ flags: "flags", managedBy: "managed_by" })),
        name: Schema.String,
        parent: Schema.optional(Schema.Union([
            Schema.Struct({
                id: Schema.String,
                name: Schema.String,
            }),
            Schema.Null,
        ])),
        profile: Schema.optional(Schema.Union([
            Schema.Struct({
                businessAddress: Schema.String,
                businessEmail: Schema.String,
                businessName: Schema.String,
                businessPhone: Schema.String,
                externalMetadata: Schema.String,
            }).pipe(Schema.encodeKeys({
                businessAddress: "business_address",
                businessEmail: "business_email",
                businessName: "business_name",
                businessPhone: "business_phone",
                externalMetadata: "external_metadata",
            })),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        createTime: "create_time",
        meta: "meta",
        name: "name",
        parent: "parent",
        profile: "profile",
    }))),
});
export const listOrganizations = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListOrganizationsRequest,
    output: ListOrganizationsResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const CreateOrganizationRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    name: Schema.String,
    parent: Schema.optional(Schema.Struct({
        id: Schema.String,
    })),
    profile: Schema.optional(Schema.Struct({
        businessAddress: Schema.String,
        businessEmail: Schema.String,
        businessName: Schema.String,
        businessPhone: Schema.String,
        externalMetadata: Schema.String,
    }).pipe(Schema.encodeKeys({
        businessAddress: "business_address",
        businessEmail: "business_email",
        businessName: "business_name",
        businessPhone: "business_phone",
        externalMetadata: "external_metadata",
    }))),
}).pipe(T.Http({ method: "POST", path: "/organizations" }));
export const CreateOrganizationResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    createTime: Schema.String,
    meta: Schema.Struct({
        flags: Schema.optional(Schema.Union([
            Schema.Struct({
                accountCreation: Schema.String,
                accountDeletion: Schema.String,
                accountMigration: Schema.String,
                accountMobility: Schema.String,
                subOrgCreation: Schema.String,
            }).pipe(Schema.encodeKeys({
                accountCreation: "account_creation",
                accountDeletion: "account_deletion",
                accountMigration: "account_migration",
                accountMobility: "account_mobility",
                subOrgCreation: "sub_org_creation",
            })),
            Schema.Null,
        ])),
        managedBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({ flags: "flags", managedBy: "managed_by" })),
    name: Schema.String,
    parent: Schema.optional(Schema.Union([
        Schema.Struct({
            id: Schema.String,
            name: Schema.String,
        }),
        Schema.Null,
    ])),
    profile: Schema.optional(Schema.Union([
        Schema.Struct({
            businessAddress: Schema.String,
            businessEmail: Schema.String,
            businessName: Schema.String,
            businessPhone: Schema.String,
            externalMetadata: Schema.String,
        }).pipe(Schema.encodeKeys({
            businessAddress: "business_address",
            businessEmail: "business_email",
            businessName: "business_name",
            businessPhone: "business_phone",
            externalMetadata: "external_metadata",
        })),
        Schema.Null,
    ])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    createTime: "create_time",
    meta: "meta",
    name: "name",
    parent: "parent",
    profile: "profile",
}))
    .pipe(T.ResponsePath("result"));
export const createOrganization = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateOrganizationRequest,
    output: CreateOrganizationResponse,
    errors: [],
}));
export const UpdateOrganizationRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    organizationId: Schema.String.pipe(T.HttpPath("organizationId")),
    name: Schema.String,
    parent: Schema.optional(Schema.Struct({
        id: Schema.String,
    })),
    profile: Schema.optional(Schema.Struct({
        businessAddress: Schema.String,
        businessEmail: Schema.String,
        businessName: Schema.String,
        businessPhone: Schema.String,
        externalMetadata: Schema.String,
    }).pipe(Schema.encodeKeys({
        businessAddress: "business_address",
        businessEmail: "business_email",
        businessName: "business_name",
        businessPhone: "business_phone",
        externalMetadata: "external_metadata",
    }))),
}).pipe(T.Http({ method: "PUT", path: "/organizations/{organizationId}" }));
export const UpdateOrganizationResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    createTime: Schema.String,
    meta: Schema.Struct({
        flags: Schema.optional(Schema.Union([
            Schema.Struct({
                accountCreation: Schema.String,
                accountDeletion: Schema.String,
                accountMigration: Schema.String,
                accountMobility: Schema.String,
                subOrgCreation: Schema.String,
            }).pipe(Schema.encodeKeys({
                accountCreation: "account_creation",
                accountDeletion: "account_deletion",
                accountMigration: "account_migration",
                accountMobility: "account_mobility",
                subOrgCreation: "sub_org_creation",
            })),
            Schema.Null,
        ])),
        managedBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({ flags: "flags", managedBy: "managed_by" })),
    name: Schema.String,
    parent: Schema.optional(Schema.Union([
        Schema.Struct({
            id: Schema.String,
            name: Schema.String,
        }),
        Schema.Null,
    ])),
    profile: Schema.optional(Schema.Union([
        Schema.Struct({
            businessAddress: Schema.String,
            businessEmail: Schema.String,
            businessName: Schema.String,
            businessPhone: Schema.String,
            externalMetadata: Schema.String,
        }).pipe(Schema.encodeKeys({
            businessAddress: "business_address",
            businessEmail: "business_email",
            businessName: "business_name",
            businessPhone: "business_phone",
            externalMetadata: "external_metadata",
        })),
        Schema.Null,
    ])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    createTime: "create_time",
    meta: "meta",
    name: "name",
    parent: "parent",
    profile: "profile",
}))
    .pipe(T.ResponsePath("result"));
export const updateOrganization = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateOrganizationRequest,
    output: UpdateOrganizationResponse,
    errors: [],
}));
export const DeleteOrganizationRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    organizationId: Schema.String.pipe(T.HttpPath("organizationId")),
}).pipe(T.Http({ method: "DELETE", path: "/organizations/{organizationId}" }));
export const DeleteOrganizationResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
}).pipe(T.ResponsePath("result"));
export const deleteOrganization = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteOrganizationRequest,
    output: DeleteOrganizationResponse,
    errors: [],
}));
export const GetOrganizationProfileRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    organizationId: Schema.String.pipe(T.HttpPath("organizationId")),
}).pipe(T.Http({ method: "GET", path: "/organizations/{organizationId}/profile" }));
export const GetOrganizationProfileResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    businessAddress: Schema.String,
    businessEmail: Schema.String,
    businessName: Schema.String,
    businessPhone: Schema.String,
    externalMetadata: Schema.String,
})
    .pipe(Schema.encodeKeys({
    businessAddress: "business_address",
    businessEmail: "business_email",
    businessName: "business_name",
    businessPhone: "business_phone",
    externalMetadata: "external_metadata",
}))
    .pipe(T.ResponsePath("result"));
export const getOrganizationProfile = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetOrganizationProfileRequest,
    output: GetOrganizationProfileResponse,
    errors: [],
}));
export const PutOrganizationProfileRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    organizationId: Schema.String.pipe(T.HttpPath("organizationId")),
    businessAddress: Schema.String,
    businessEmail: Schema.String,
    businessName: Schema.String,
    businessPhone: Schema.String,
    externalMetadata: Schema.String,
}).pipe(Schema.encodeKeys({
    businessAddress: "business_address",
    businessEmail: "business_email",
    businessName: "business_name",
    businessPhone: "business_phone",
    externalMetadata: "external_metadata",
}), T.Http({ method: "PUT", path: "/organizations/{organizationId}/profile" }));
export const PutOrganizationProfileResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown;
export const putOrganizationProfile = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutOrganizationProfileRequest,
    output: PutOrganizationProfileResponse,
    errors: [],
}));
//# sourceMappingURL=organizations.js.map