import {z} from 'zod' export type UUID = string; export type CountryCodeAlpha2 = 'AD' | 'AE' | 'AF' | 'AG' | 'AI' | 'AL' | 'AM' | 'AO' | 'AQ' | 'AR' | 'AS' | 'AT' | 'AU' | 'AW' | 'AX' | 'AZ' | 'BA' | 'BB' | 'BD' | 'BE' | 'BF' | 'BG' | 'BH' | 'BI' | 'BJ' | 'BL' | 'BM' | 'BN' | 'BO' | 'BQ' | 'BR' | 'BS' | 'BT' | 'BV' | 'BW' | 'BY' | 'BZ' | 'CA' | 'CC' | 'CD' | 'CF' | 'CG' | 'CH' | 'CI' | 'CK' | 'CL' | 'CM' | 'CN' | 'CO' | 'CR' | 'CU' | 'CV' | 'CW' | 'CX' | 'CY' | 'CZ' | 'DE' | 'DJ' | 'DK' | 'DM' | 'DO' | 'DZ' | 'EC' | 'EE' | 'EG' | 'EH' | 'ER' | 'ES' | 'ET' | 'FI' | 'FJ' | 'FK' | 'FM' | 'FO' | 'FR' | 'GA' | 'GB' | 'GD' | 'GE' | 'GF' | 'GG' | 'GH' | 'GI' | 'GL' | 'GM' | 'GN' | 'GP' | 'GQ' | 'GR' | 'GS' | 'GT' | 'GU' | 'GW' | 'GY' | 'HK' | 'HM' | 'HN' | 'HR' | 'HT' | 'HU' | 'ID' | 'IE' | 'IL' | 'IM' | 'IN' | 'IO' | 'IQ' | 'IR' | 'IS' | 'IT' | 'JE' | 'JM' | 'JO' | 'JP' | 'KE' | 'KG' | 'KH' | 'KI' | 'KM' | 'KN' | 'KP' | 'KR' | 'KW' | 'KY' | 'KZ' | 'LA' | 'LB' | 'LC' | 'LI' | 'LK' | 'LR' | 'LS' | 'LT' | 'LU' | 'LV' | 'LY' | 'MA' | 'MC' | 'MD' | 'ME' | 'MF' | 'MG' | 'MH' | 'MK' | 'ML' | 'MM' | 'MN' | 'MO' | 'MP' | 'MQ' | 'MR' | 'MS' | 'MT' | 'MU' | 'MV' | 'MW' | 'MX' | 'MY' | 'MZ' | 'NA' | 'NC' | 'NE' | 'NF' | 'NG' | 'NI' | 'NL' | 'NO' | 'NP' | 'NR' | 'NU' | 'NZ' | 'OM' | 'PA' | 'PE' | 'PF' | 'PG' | 'PH' | 'PK' | 'PL' | 'PM' | 'PN' | 'PR' | 'PS' | 'PT' | 'PW' | 'PY' | 'QA' | 'RE' | 'RO' | 'RS' | 'RU' | 'RW' | 'SA' | 'SB' | 'SC' | 'SD' | 'SE' | 'SG' | 'SH' | 'SI' | 'SJ' | 'SK' | 'SL' | 'SM' | 'SN' | 'SO' | 'SR' | 'SS' | 'ST' | 'SV' | 'SX' | 'SY' | 'SZ' | 'TC' | 'TD' | 'TF' | 'TG' | 'TH' | 'TJ' | 'TK' | 'TL' | 'TM' | 'TN' | 'TO' | 'TR' | 'TT' | 'TV' | 'TW' | 'TZ' | 'UA' | 'UG' | 'UM' | 'US' | 'UY' | 'UZ' | 'VA' | 'VC' | 'VE' | 'VG' | 'VI' | 'VN' | 'VU' | 'WF' | 'WS' | 'YE' | 'YT' | 'ZA' | 'ZM' | 'ZW'; export type TaxIdentificationNumberByCountry = Array<{country: 'FR', taxIdentificationNumber?: (string | null) | undefined} | {country: 'GF', taxIdentificationNumber?: (string | null) | undefined} | {country: 'GP', taxIdentificationNumber?: (string | null) | undefined} | {country: 'MQ', taxIdentificationNumber?: (string | null) | undefined} | {country: 'RE', taxIdentificationNumber?: (string | null) | undefined} | {country: 'YT', taxIdentificationNumber?: (string | null) | undefined} | {country: 'AT', taxIdentificationNumber?: (string | null) | undefined} | {country: 'BE', taxIdentificationNumber?: (string | null) | undefined} | {country: 'BG', taxIdentificationNumber?: (string | null) | undefined} | {country: 'CY', taxIdentificationNumber?: (string | null) | undefined} | {country: 'CZ', taxIdentificationNumber?: (string | null) | undefined} | {country: 'DE', taxIdentificationNumber?: (string | null) | undefined} | {country: 'DK', taxIdentificationNumber?: (string | null) | undefined} | {country: 'EE', taxIdentificationNumber?: (string | null) | undefined} | {country: 'ES', taxIdentificationNumber?: (string | null) | undefined} | {country: 'FI', taxIdentificationNumber?: (string | null) | undefined} | {country: 'GB', taxIdentificationNumber?: (string | null) | undefined} | {country: 'GR', taxIdentificationNumber?: (string | null) | undefined} | {country: 'HR', taxIdentificationNumber?: (string | null) | undefined} | {country: 'HU', taxIdentificationNumber?: (string | null) | undefined} | {country: 'IE', taxIdentificationNumber?: (string | null) | undefined} | {country: 'IT', taxIdentificationNumber?: (string | null) | undefined} | {country: 'LT', taxIdentificationNumber?: (string | null) | undefined} | {country: 'LU', taxIdentificationNumber?: (string | null) | undefined} | {country: 'LV', taxIdentificationNumber?: (string | null) | undefined} | {country: 'MT', taxIdentificationNumber?: (string | null) | undefined} | {country: 'NL', taxIdentificationNumber?: (string | null) | undefined} | {country: 'PL', taxIdentificationNumber?: (string | null) | undefined} | {country: 'PT', taxIdentificationNumber?: (string | null) | undefined} | {country: 'RO', taxIdentificationNumber?: (string | null) | undefined} | {country: 'SE', taxIdentificationNumber?: (string | null) | undefined} | {country: 'SI', taxIdentificationNumber?: (string | null) | undefined} | {country: 'SK', taxIdentificationNumber?: (string | null) | undefined} | {country: 'AD' | 'AE' | 'AF' | 'AG' | 'AI' | 'AL' | 'AM' | 'AO' | 'AQ' | 'AR' | 'AS' | 'AU' | 'AW' | 'AX' | 'AZ' | 'BA' | 'BB' | 'BD' | 'BF' | 'BH' | 'BI' | 'BJ' | 'BL' | 'BM' | 'BN' | 'BO' | 'BQ' | 'BR' | 'BS' | 'BT' | 'BV' | 'BW' | 'BY' | 'BZ' | 'CA' | 'CC' | 'CD' | 'CF' | 'CG' | 'CH' | 'CI' | 'CK' | 'CL' | 'CM' | 'CN' | 'CO' | 'CR' | 'CU' | 'CV' | 'CW' | 'CX' | 'DJ' | 'DM' | 'DO' | 'DZ' | 'EC' | 'EG' | 'EH' | 'ER' | 'ET' | 'FJ' | 'FK' | 'FM' | 'FO' | 'GA' | 'GD' | 'GE' | 'GG' | 'GH' | 'GI' | 'GL' | 'GM' | 'GN' | 'GQ' | 'GS' | 'GT' | 'GU' | 'GW' | 'GY' | 'HK' | 'HM' | 'HN' | 'HT' | 'ID' | 'IL' | 'IM' | 'IN' | 'IO' | 'IQ' | 'IR' | 'IS' | 'JE' | 'JM' | 'JO' | 'JP' | 'KE' | 'KG' | 'KH' | 'KI' | 'KM' | 'KN' | 'KP' | 'KR' | 'KW' | 'KY' | 'KZ' | 'LA' | 'LB' | 'LC' | 'LI' | 'LK' | 'LR' | 'LS' | 'LY' | 'MA' | 'MC' | 'MD' | 'ME' | 'MF' | 'MG' | 'MH' | 'MK' | 'ML' | 'MM' | 'MN' | 'MO' | 'MP' | 'MR' | 'MS' | 'MU' | 'MV' | 'MW' | 'MX' | 'MY' | 'MZ' | 'NA' | 'NC' | 'NE' | 'NF' | 'NG' | 'NI' | 'NO' | 'NP' | 'NR' | 'NU' | 'NZ' | 'OM' | 'PA' | 'PE' | 'PF' | 'PG' | 'PH' | 'PK' | 'PM' | 'PN' | 'PR' | 'PS' | 'PW' | 'PY' | 'QA' | 'RS' | 'RU' | 'RW' | 'SA' | 'SB' | 'SC' | 'SD' | 'SG' | 'SH' | 'SJ' | 'SL' | 'SM' | 'SN' | 'SO' | 'SR' | 'SS' | 'ST' | 'SV' | 'SX' | 'SY' | 'SZ' | 'TC' | 'TD' | 'TF' | 'TG' | 'TH' | 'TJ' | 'TK' | 'TL' | 'TM' | 'TN' | 'TO' | 'TR' | 'TT' | 'TV' | 'TW' | 'TZ' | 'UA' | 'UG' | 'UM' | 'US' | 'UY' | 'UZ' | 'VA' | 'VC' | 'VE' | 'VG' | 'VI' | 'VN' | 'VU' | 'WF' | 'WS' | 'YE' | 'ZA' | 'ZM' | 'ZW', taxIdentificationNumber?: (string | null) | undefined}>; export type Day = string; export type LegalEntityName = string; export type ShareClassSymbol = 'EUTBL' | 'USTBL' | 'eurUSTBL' | 'SPKCC' | 'eurSPKCC' | 'UKTBL' | 'eurUKTBL' | 'SAFO' | 'SAFOd' | 'eurSAFO' | 'eurSAFOd' | 'gbpSAFO' | 'gbpSAFOd' | 'chfSAFO' | 'sekSAFO' | 'nokSAFO' | 'dkkSAFO' | 'plnSAFO' | 'hufSAFO' | 'czkSAFO'; export type PatchApiV0InvestorsIdArgs = {id: UUID, body: {firstName?: string | undefined, lastName?: string | undefined, country?: CountryCodeAlpha2 | undefined, address?: string | undefined, zipCode?: string | undefined, city?: string | undefined, details?: ({taxInformationByCountryOfResidence?: TaxIdentificationNumberByCountry | undefined, dateOfBirth?: Day | undefined, placeOfBirth?: string | undefined, gender?: ('Female' | 'Male') | undefined, nationality?: CountryCodeAlpha2 | undefined, industry?: ('AgricultureAndFoodProcessing' | 'ArtsMediaAndEntertainment' | 'CasinosAndGambling' | 'Construction' | 'Cryptocurrency' | 'DefenseAndMilitaryIndustry' | 'Education' | 'EnergyAndUtilities' | 'FinancialServices' | 'FoodAndLodging' | 'Government' | 'HealthProfessions' | 'HoldingCompany' | 'IndustryAndManufacturing' | 'Mining' | 'NonProfit' | 'ProfessionalServices' | 'RealEstate' | 'RetailTradeAutomotive' | 'RetailTradeJewelryAntiques' | 'RetailTradeOthers' | 'SportAndTourism' | 'TechnologyAndComputing' | 'Transportation' | 'Politics' | 'Retired' | 'Student') | undefined} | {legalName?: LegalEntityName | undefined, legalEntityType?: string | undefined, registrationNumber?: string | undefined, industry?: ('AgricultureAndFoodProcessing' | 'ArtsMediaAndEntertainment' | 'CasinosAndGambling' | 'Construction' | 'Cryptocurrency' | 'DefenseAndMilitaryIndustry' | 'Education' | 'EnergyAndUtilities' | 'FinancialServices' | 'FoodAndLodging' | 'Government' | 'HealthProfessions' | 'HoldingCompany' | 'IndustryAndManufacturing' | 'Mining' | 'NonProfit' | 'ProfessionalServices' | 'RealEstate' | 'RetailTradeAutomotive' | 'RetailTradeJewelryAntiques' | 'RetailTradeOthers' | 'SportAndTourism' | 'TechnologyAndComputing' | 'Transportation') | undefined, fatcaCrsStatus?: ('activeNFE' | 'passiveNFE' | 'FE') | undefined}) | undefined, relatedPersons?: (Array<{firstName: string, lastName: string, gender?: ('Female' | 'Male' | null) | undefined, dateOfBirth?: (Day | null) | undefined, cityOfBirth?: (string | null) | undefined, countryOfBirth?: (CountryCodeAlpha2 | null) | undefined, nationality?: (CountryCodeAlpha2 | null) | undefined, addressOfResidence?: (string | null) | undefined, cityOfResidence?: (string | null) | undefined, zipCodeOfResidence?: (string | null) | undefined, countryOfResidence?: (CountryCodeAlpha2 | null) | undefined, relationshipTypes: Array<'ubo' | 'director' | 'self' | 'other'>, fiscalIdentificationNumber?: (string | null) | undefined}>) | undefined, investorEmail?: string | undefined, allowedByDistributorShareClasses?: (Array | null) | undefined}}; export type PatchApiV0InvestorsIdOptions = {baseUrl?: string | undefined, basicAuth?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; export const countryCodeAlpha2 = z.enum(["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "ZA", "ZM", "ZW"]); export const day = z.string(); export const legalEntityName = z.string(); export const uUID = z.string(); export const shareClassSymbol = z.enum(["EUTBL", "USTBL", "eurUSTBL", "SPKCC", "eurSPKCC", "UKTBL", "eurUKTBL", "SAFO", "SAFOd", "eurSAFO", "eurSAFOd", "gbpSAFO", "gbpSAFOd", "chfSAFO", "sekSAFO", "nokSAFO", "dkkSAFO", "plnSAFO", "hufSAFO", "czkSAFO"]); export const patchApiV0InvestorsIdResponse = z.union([z.object({firstName: z.string(), lastName: z.string(), country: countryCodeAlpha2, address: z.string(), zipCode: z.string(), city: z.string(), details: z.union([z.object({type: z.literal("individual"), taxInformationByCountryOfResidence: z.array(z.object({country: countryCodeAlpha2, taxInformation: z.object({taxIdentificationNumber: z.string(), updatedAt: z.string()}).nullable().optional()})), dateOfBirth: day.nullable(), placeOfBirth: z.string().min(1).nullable(), gender: z.enum(["Female", "Male"]).nullable(), industry: z.enum(["AgricultureAndFoodProcessing", "ArtsMediaAndEntertainment", "CasinosAndGambling", "Construction", "Cryptocurrency", "DefenseAndMilitaryIndustry", "Education", "EnergyAndUtilities", "FinancialServices", "FoodAndLodging", "Government", "HealthProfessions", "HoldingCompany", "IndustryAndManufacturing", "Mining", "NonProfit", "ProfessionalServices", "RealEstate", "RetailTradeAutomotive", "RetailTradeJewelryAntiques", "RetailTradeOthers", "SportAndTourism", "TechnologyAndComputing", "Transportation", "Politics", "Retired", "Student"]).nullable()}), z.object({type: z.literal("organization"), legalName: legalEntityName, legalEntityType: z.string(), registrationNumber: z.string(), industry: z.enum(["AgricultureAndFoodProcessing", "ArtsMediaAndEntertainment", "CasinosAndGambling", "Construction", "Cryptocurrency", "DefenseAndMilitaryIndustry", "Education", "EnergyAndUtilities", "FinancialServices", "FoodAndLodging", "Government", "HealthProfessions", "HoldingCompany", "IndustryAndManufacturing", "Mining", "NonProfit", "ProfessionalServices", "RealEstate", "RetailTradeAutomotive", "RetailTradeJewelryAntiques", "RetailTradeOthers", "SportAndTourism", "TechnologyAndComputing", "Transportation"])})]), relatedPersons: z.array(z.object({firstName: z.string(), lastName: z.string(), gender: z.enum(["Female", "Male"]).nullable().optional(), dateOfBirth: day.nullable().optional(), cityOfBirth: z.string().nullable().optional(), countryOfBirth: countryCodeAlpha2.nullable().optional(), nationality: countryCodeAlpha2.nullable().optional(), addressOfResidence: z.string().nullable().optional(), cityOfResidence: z.string().nullable().optional(), zipCodeOfResidence: z.string().nullable().optional(), countryOfResidence: countryCodeAlpha2.nullable().optional(), relationshipTypes: z.array(z.enum(["ubo", "director", "self", "other"])), fiscalIdentificationNumber: z.string().nullable().optional()})).optional(), id: uUID, distributorId: uUID, createdOn: z.string(), updatedOn: z.string(), status: z.literal("compliant"), complianceStatus: z.literal("compliant"), allowedByDistributorShareClasses: z.array(shareClassSymbol).nullable().optional(), hasAccessToProfessionalProducts: z.boolean()}), z.object({firstName: z.string(), lastName: z.string(), country: countryCodeAlpha2, address: z.string(), zipCode: z.string(), city: z.string(), details: z.union([z.object({type: z.literal("individual"), taxInformationByCountryOfResidence: z.array(z.object({country: countryCodeAlpha2, taxInformation: z.object({taxIdentificationNumber: z.string(), updatedAt: z.string()}).nullable().optional()})), dateOfBirth: day.nullable(), placeOfBirth: z.string().min(1).nullable(), gender: z.enum(["Female", "Male"]).nullable(), industry: z.enum(["AgricultureAndFoodProcessing", "ArtsMediaAndEntertainment", "CasinosAndGambling", "Construction", "Cryptocurrency", "DefenseAndMilitaryIndustry", "Education", "EnergyAndUtilities", "FinancialServices", "FoodAndLodging", "Government", "HealthProfessions", "HoldingCompany", "IndustryAndManufacturing", "Mining", "NonProfit", "ProfessionalServices", "RealEstate", "RetailTradeAutomotive", "RetailTradeJewelryAntiques", "RetailTradeOthers", "SportAndTourism", "TechnologyAndComputing", "Transportation", "Politics", "Retired", "Student"]).nullable()}), z.object({type: z.literal("organization"), legalName: legalEntityName, legalEntityType: z.string(), registrationNumber: z.string(), industry: z.enum(["AgricultureAndFoodProcessing", "ArtsMediaAndEntertainment", "CasinosAndGambling", "Construction", "Cryptocurrency", "DefenseAndMilitaryIndustry", "Education", "EnergyAndUtilities", "FinancialServices", "FoodAndLodging", "Government", "HealthProfessions", "HoldingCompany", "IndustryAndManufacturing", "Mining", "NonProfit", "ProfessionalServices", "RealEstate", "RetailTradeAutomotive", "RetailTradeJewelryAntiques", "RetailTradeOthers", "SportAndTourism", "TechnologyAndComputing", "Transportation"])})]), relatedPersons: z.array(z.object({firstName: z.string(), lastName: z.string(), gender: z.enum(["Female", "Male"]).nullable().optional(), dateOfBirth: day.nullable().optional(), cityOfBirth: z.string().nullable().optional(), countryOfBirth: countryCodeAlpha2.nullable().optional(), nationality: countryCodeAlpha2.nullable().optional(), addressOfResidence: z.string().nullable().optional(), cityOfResidence: z.string().nullable().optional(), zipCodeOfResidence: z.string().nullable().optional(), countryOfResidence: countryCodeAlpha2.nullable().optional(), relationshipTypes: z.array(z.enum(["ubo", "director", "self", "other"])), fiscalIdentificationNumber: z.string().nullable().optional()})).optional(), id: uUID, distributorId: uUID, createdOn: z.string(), updatedOn: z.string(), status: z.literal("non-compliant"), complianceStatus: z.literal("non-compliant"), allowedByDistributorShareClasses: z.array(shareClassSymbol).nullable().optional()}), z.object({firstName: z.string(), lastName: z.string(), country: countryCodeAlpha2, address: z.string(), zipCode: z.string(), city: z.string(), details: z.union([z.object({type: z.literal("individual"), taxInformationByCountryOfResidence: z.array(z.object({country: countryCodeAlpha2, taxInformation: z.object({taxIdentificationNumber: z.string(), updatedAt: z.string()}).nullable().optional()})), dateOfBirth: day.nullable(), placeOfBirth: z.string().min(1).nullable(), gender: z.enum(["Female", "Male"]).nullable(), industry: z.enum(["AgricultureAndFoodProcessing", "ArtsMediaAndEntertainment", "CasinosAndGambling", "Construction", "Cryptocurrency", "DefenseAndMilitaryIndustry", "Education", "EnergyAndUtilities", "FinancialServices", "FoodAndLodging", "Government", "HealthProfessions", "HoldingCompany", "IndustryAndManufacturing", "Mining", "NonProfit", "ProfessionalServices", "RealEstate", "RetailTradeAutomotive", "RetailTradeJewelryAntiques", "RetailTradeOthers", "SportAndTourism", "TechnologyAndComputing", "Transportation", "Politics", "Retired", "Student"]).nullable()}), z.object({type: z.literal("organization"), legalName: legalEntityName, legalEntityType: z.string(), registrationNumber: z.string(), industry: z.enum(["AgricultureAndFoodProcessing", "ArtsMediaAndEntertainment", "CasinosAndGambling", "Construction", "Cryptocurrency", "DefenseAndMilitaryIndustry", "Education", "EnergyAndUtilities", "FinancialServices", "FoodAndLodging", "Government", "HealthProfessions", "HoldingCompany", "IndustryAndManufacturing", "Mining", "NonProfit", "ProfessionalServices", "RealEstate", "RetailTradeAutomotive", "RetailTradeJewelryAntiques", "RetailTradeOthers", "SportAndTourism", "TechnologyAndComputing", "Transportation"])})]), relatedPersons: z.array(z.object({firstName: z.string(), lastName: z.string(), gender: z.enum(["Female", "Male"]).nullable().optional(), dateOfBirth: day.nullable().optional(), cityOfBirth: z.string().nullable().optional(), countryOfBirth: countryCodeAlpha2.nullable().optional(), nationality: countryCodeAlpha2.nullable().optional(), addressOfResidence: z.string().nullable().optional(), cityOfResidence: z.string().nullable().optional(), zipCodeOfResidence: z.string().nullable().optional(), countryOfResidence: countryCodeAlpha2.nullable().optional(), relationshipTypes: z.array(z.enum(["ubo", "director", "self", "other"])), fiscalIdentificationNumber: z.string().nullable().optional()})).optional(), id: uUID, distributorId: uUID, createdOn: z.string(), updatedOn: z.string(), status: z.literal("pending-onboarding-workflow"), complianceStatus: z.literal("pending-onboarding"), allowedByDistributorShareClasses: z.array(shareClassSymbol).nullable().optional()})]); export const validateResponse = async ( schema: { readonly '~standard': { readonly validate: (value: unknown) => ({ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }) | Promise<{ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }> } }, value: unknown ): Promise => { const result = await schema['~standard'].validate(value) if (result.issues !== undefined) { const detail = result.issues .map(({ message, path }) => path?.length ? `${path.map((segment) => String(typeof segment === 'object' ? segment.key : segment)).join('.')}: ${message}` : message ) .join('; ') throw new Error(`Response does not match the schema: ${detail}`, { cause: { issues: result.issues } }) } return result.value }; /** * Update investor * * PATCH /v0/investors/{id} */ export const patchApiV0InvestorsId = async (args: PatchApiV0InvestorsIdArgs, options?: PatchApiV0InvestorsIdOptions) => { const {baseUrl = "https://distributor-api.spiko.io", fetch: fetchFn = fetch, basicAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (basicAuth !== undefined) headers.set('authorization', `Basic ${btoa(`${basicAuth.username}:${basicAuth.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/v0/investors/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 validateResponse(patchApiV0InvestorsIdResponse, await res.json()) };