export type CustomStorage = {type?: ('S3' | 'S3_COMPATIBLE' | 'GCP' | 'AZURE' | 'DISTRIBUTOR_CLOUD') | undefined, s3Key?: string | undefined, s3Secret?: string | undefined, s3Region?: ('US_EST' | 'EU' | 'EU_FRANKFURT' | 'CANADA' | 'ASIA_SIDNEY' | 'ASIA_TOKYO' | 'LONDON' | 'EU_PARIS' | 'AFRICA_CAPE_TOWN' | 'ASIA_MUMBAI' | 'EU_ZURICH') | undefined, s3Bucket?: string | undefined, endPoint?: string | undefined}; export type CreatePartnerAccountDTO = {email?: string | undefined, password: string, displayName?: string | undefined, region?: ('US_EST' | 'US_EST_OHIO' | 'US_WEST_OREGON' | 'US_WEST_CAL' | 'EU' | 'EU_FRANKFURT' | 'ASIA_HONG_KONG' | 'ASIA_MUMBAI' | 'ASIA_SEOUL' | 'ASIA_SINGAPORE' | 'ASIA_SIDNEY' | 'ASIA_TOKYO' | 'SOUTH_AMERICA' | 'AFRICA_CAPE_TOWN' | 'ASIA_CHINA' | 'CANADA' | 'LONDON' | 'EU_PARIS' | 'EU_STOCKHOLM' | 'EU_ZURICH') | undefined, partnerId?: string | undefined, partnerEmail?: string | undefined, customStorage?: CustomStorage | undefined}; export type CreateApiV2DistributorsAccountsArgs = {'client-id': string, 'client-secret': string, body: CreatePartnerAccountDTO}; export type CreateApiV2DistributorsAccountsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * addAccount * * POST /v2/distributors/accounts */ export const createApiV2DistributorsAccounts = async (args: CreateApiV2DistributorsAccountsArgs, options?: CreateApiV2DistributorsAccountsOptions) => { const {baseUrl = "https://api.cloudally.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") if (args['client-id'] != null) headers.set("client-id", String(args['client-id'])) if (args['client-secret'] != null) headers.set("client-secret", String(args['client-secret'])) const url = `${baseUrl.replace(/\/+$/, '')}/v2/distributors/accounts${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };