@schematichq/schematic-typescript-node 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Client.js +87 -0
- package/dist/api/errors/BadRequestError.js +52 -0
- package/dist/api/errors/ForbiddenError.js +52 -0
- package/dist/api/errors/InternalServerError.js +52 -0
- package/dist/api/errors/NotFoundError.js +52 -0
- package/dist/api/errors/UnauthorizedError.js +52 -0
- package/dist/api/errors/index.js +21 -0
- package/dist/api/index.js +19 -0
- package/dist/api/resources/accesstokens/client/Client.js +184 -0
- package/dist/api/resources/accesstokens/client/index.js +17 -0
- package/dist/api/resources/accesstokens/client/requests/IssueTemporaryAccessTokenRequestBody.js +5 -0
- package/dist/api/resources/accesstokens/client/requests/index.js +2 -0
- package/dist/api/resources/accesstokens/index.js +18 -0
- package/dist/api/resources/accesstokens/types/IssueTemporaryAccessTokenResponse.js +5 -0
- package/dist/api/resources/accesstokens/types/index.js +17 -0
- package/dist/api/resources/accounts/client/Client.js +1755 -0
- package/dist/api/resources/accounts/client/index.js +17 -0
- package/dist/api/resources/accounts/client/requests/CountApiKeysRequest.js +5 -0
- package/dist/api/resources/accounts/client/requests/CountApiRequestsRequest.js +5 -0
- package/dist/api/resources/accounts/client/requests/CreateApiKeyRequestBody.js +5 -0
- package/dist/api/resources/accounts/client/requests/CreateEnvironmentRequestBody.js +5 -0
- package/dist/api/resources/accounts/client/requests/ListApiKeysRequest.js +5 -0
- package/dist/api/resources/accounts/client/requests/ListApiRequestsRequest.js +5 -0
- package/dist/api/resources/accounts/client/requests/ListEnvironmentsRequest.js +5 -0
- package/dist/api/resources/accounts/client/requests/UpdateApiKeyRequestBody.js +5 -0
- package/dist/api/resources/accounts/client/requests/UpdateEnvironmentRequestBody.js +5 -0
- package/dist/api/resources/accounts/client/requests/index.js +2 -0
- package/dist/api/resources/accounts/index.js +18 -0
- package/dist/api/resources/accounts/types/CountApiKeysParams.js +5 -0
- package/dist/api/resources/accounts/types/CountApiKeysResponse.js +5 -0
- package/dist/api/resources/accounts/types/CountApiRequestsParams.js +5 -0
- package/dist/api/resources/accounts/types/CountApiRequestsResponse.js +5 -0
- package/dist/api/resources/accounts/types/CreateApiKeyResponse.js +5 -0
- package/dist/api/resources/accounts/types/CreateEnvironmentRequestBodyEnvironmentType.d.ts +9 -0
- package/dist/api/resources/accounts/types/CreateEnvironmentRequestBodyEnvironmentType.js +11 -0
- package/dist/api/resources/accounts/types/CreateEnvironmentResponse.js +5 -0
- package/dist/api/resources/accounts/types/DeleteApiKeyResponse.js +5 -0
- package/dist/api/resources/accounts/types/DeleteEnvironmentResponse.js +5 -0
- package/dist/api/resources/accounts/types/GetApiKeyResponse.js +5 -0
- package/dist/api/resources/accounts/types/GetApiRequestResponse.js +5 -0
- package/dist/api/resources/accounts/types/GetEnvironmentResponse.js +5 -0
- package/dist/api/resources/accounts/types/ListApiKeysParams.js +5 -0
- package/dist/api/resources/accounts/types/ListApiKeysResponse.js +5 -0
- package/dist/api/resources/accounts/types/ListApiRequestsParams.js +5 -0
- package/dist/api/resources/accounts/types/ListApiRequestsResponse.js +5 -0
- package/dist/api/resources/accounts/types/ListEnvironmentsParams.js +5 -0
- package/dist/api/resources/accounts/types/ListEnvironmentsResponse.js +5 -0
- package/dist/api/resources/accounts/types/QuickstartResponse.js +5 -0
- package/dist/api/resources/accounts/types/UpdateApiKeyResponse.js +5 -0
- package/dist/api/resources/accounts/types/UpdateEnvironmentRequestBodyEnvironmentType.d.ts +9 -0
- package/dist/api/resources/accounts/types/UpdateEnvironmentRequestBodyEnvironmentType.js +11 -0
- package/dist/api/resources/accounts/types/UpdateEnvironmentResponse.js +5 -0
- package/dist/api/resources/accounts/types/index.js +38 -0
- package/dist/api/resources/billing/client/Client.js +2585 -0
- package/dist/api/resources/billing/client/index.js +17 -0
- package/dist/api/resources/billing/client/requests/CountBillingProductsRequest.js +5 -0
- package/dist/api/resources/billing/client/requests/CountCustomersRequest.js +5 -0
- package/dist/api/resources/billing/client/requests/CreateBillingCustomerRequestBody.js +5 -0
- package/dist/api/resources/billing/client/requests/CreateBillingPriceRequestBody.js +5 -0
- package/dist/api/resources/billing/client/requests/CreateBillingProductRequestBody.js +5 -0
- package/dist/api/resources/billing/client/requests/CreateBillingSubscriptionsRequestBody.d.ts +49 -0
- package/dist/api/resources/billing/client/requests/CreateBillingSubscriptionsRequestBody.js +5 -0
- package/dist/api/resources/billing/client/requests/CreateCouponRequestBody.js +5 -0
- package/dist/api/resources/billing/client/requests/CreateInvoiceRequestBody.js +5 -0
- package/dist/api/resources/billing/client/requests/CreateMeterRequestBody.js +5 -0
- package/dist/api/resources/billing/client/requests/CreatePaymentMethodRequestBody.js +5 -0
- package/dist/api/resources/billing/client/requests/ListBillingProductsRequest.js +5 -0
- package/dist/api/resources/billing/client/requests/ListCouponsRequest.js +5 -0
- package/dist/api/resources/billing/client/requests/ListCustomersWithSubscriptionsRequest.js +5 -0
- package/dist/api/resources/billing/client/requests/ListInvoicesRequest.js +5 -0
- package/dist/api/resources/billing/client/requests/ListMetersRequest.js +5 -0
- package/dist/api/resources/billing/client/requests/ListPaymentMethodsRequest.js +5 -0
- package/dist/api/resources/billing/client/requests/ListProductPricesRequest.d.ts +42 -0
- package/dist/api/resources/billing/client/requests/ListProductPricesRequest.js +5 -0
- package/dist/api/resources/billing/client/requests/SearchBillingPricesRequest.d.ts +24 -0
- package/dist/api/resources/billing/client/requests/SearchBillingPricesRequest.js +5 -0
- package/dist/api/resources/billing/client/requests/index.js +2 -0
- package/dist/api/resources/billing/index.js +18 -0
- package/dist/api/resources/billing/types/CountBillingProductsParams.js +5 -0
- package/dist/api/resources/billing/types/CountBillingProductsRequestPriceUsageType.d.ts +8 -0
- package/dist/api/resources/billing/types/CountBillingProductsRequestPriceUsageType.js +10 -0
- package/dist/api/resources/billing/types/CountBillingProductsResponse.js +5 -0
- package/dist/api/resources/billing/types/CountBillingProductsResponseParamsPriceUsageType.d.ts +8 -0
- package/dist/api/resources/billing/types/CountBillingProductsResponseParamsPriceUsageType.js +10 -0
- package/dist/api/resources/billing/types/CountCustomersParams.js +5 -0
- package/dist/api/resources/billing/types/CountCustomersResponse.js +5 -0
- package/dist/api/resources/billing/types/CreateBillingPriceRequestBodyBillingScheme.d.ts +8 -0
- package/dist/api/resources/billing/types/CreateBillingPriceRequestBodyBillingScheme.js +10 -0
- package/dist/api/resources/billing/types/CreateBillingPriceRequestBodyTiersMode.d.ts +8 -0
- package/dist/api/resources/billing/types/CreateBillingPriceRequestBodyTiersMode.js +10 -0
- package/dist/api/resources/billing/types/CreateBillingPriceRequestBodyUsageType.d.ts +8 -0
- package/dist/api/resources/billing/types/CreateBillingPriceRequestBodyUsageType.js +10 -0
- package/dist/api/resources/billing/types/CreateBillingSubscriptionsRequestBodyTrialEndSetting.d.ts +8 -0
- package/dist/api/resources/billing/types/CreateBillingSubscriptionsRequestBodyTrialEndSetting.js +10 -0
- package/dist/api/resources/billing/types/DeleteBillingProductResponse.js +5 -0
- package/dist/api/resources/billing/types/DeleteProductPriceResponse.js +5 -0
- package/dist/api/resources/billing/types/ListBillingProductsParams.js +5 -0
- package/dist/api/resources/billing/types/ListBillingProductsRequestPriceUsageType.d.ts +8 -0
- package/dist/api/resources/billing/types/ListBillingProductsRequestPriceUsageType.js +10 -0
- package/dist/api/resources/billing/types/ListBillingProductsResponse.js +5 -0
- package/dist/api/resources/billing/types/ListBillingProductsResponseParamsPriceUsageType.d.ts +8 -0
- package/dist/api/resources/billing/types/ListBillingProductsResponseParamsPriceUsageType.js +10 -0
- package/dist/api/resources/billing/types/ListCouponsParams.js +5 -0
- package/dist/api/resources/billing/types/ListCouponsResponse.js +5 -0
- package/dist/api/resources/billing/types/ListCustomersWithSubscriptionsParams.js +5 -0
- package/dist/api/resources/billing/types/ListCustomersWithSubscriptionsResponse.js +5 -0
- package/dist/api/resources/billing/types/ListInvoicesParams.js +5 -0
- package/dist/api/resources/billing/types/ListInvoicesResponse.js +5 -0
- package/dist/api/resources/billing/types/ListMetersParams.js +5 -0
- package/dist/api/resources/billing/types/ListMetersResponse.js +5 -0
- package/dist/api/resources/billing/types/ListPaymentMethodsParams.js +5 -0
- package/dist/api/resources/billing/types/ListPaymentMethodsResponse.js +5 -0
- package/dist/api/resources/billing/types/ListProductPricesParams.d.ts +27 -0
- package/dist/api/resources/billing/types/ListProductPricesParams.js +5 -0
- package/dist/api/resources/billing/types/ListProductPricesRequestPriceUsageType.d.ts +8 -0
- package/dist/api/resources/billing/types/ListProductPricesRequestPriceUsageType.js +10 -0
- package/dist/api/resources/billing/types/ListProductPricesResponse.d.ts +10 -0
- package/dist/api/resources/billing/types/ListProductPricesResponse.js +5 -0
- package/dist/api/resources/billing/types/ListProductPricesResponseParamsPriceUsageType.d.ts +8 -0
- package/dist/api/resources/billing/types/ListProductPricesResponseParamsPriceUsageType.js +10 -0
- package/dist/api/resources/billing/types/SearchBillingPricesParams.d.ts +19 -0
- package/dist/api/resources/billing/types/SearchBillingPricesParams.js +5 -0
- package/dist/api/resources/billing/types/SearchBillingPricesRequestTiersMode.d.ts +8 -0
- package/dist/api/resources/billing/types/SearchBillingPricesRequestTiersMode.js +10 -0
- package/dist/api/resources/billing/types/SearchBillingPricesRequestUsageType.d.ts +8 -0
- package/dist/api/resources/billing/types/SearchBillingPricesRequestUsageType.js +10 -0
- package/dist/api/resources/billing/types/SearchBillingPricesResponse.d.ts +10 -0
- package/dist/api/resources/billing/types/SearchBillingPricesResponse.js +5 -0
- package/dist/api/resources/billing/types/SearchBillingPricesResponseParamsTiersMode.d.ts +8 -0
- package/dist/api/resources/billing/types/SearchBillingPricesResponseParamsTiersMode.js +10 -0
- package/dist/api/resources/billing/types/SearchBillingPricesResponseParamsUsageType.d.ts +8 -0
- package/dist/api/resources/billing/types/SearchBillingPricesResponseParamsUsageType.js +10 -0
- package/dist/api/resources/billing/types/UpsertBillingCouponResponse.js +5 -0
- package/dist/api/resources/billing/types/UpsertBillingCustomerResponse.js +5 -0
- package/dist/api/resources/billing/types/UpsertBillingMeterResponse.js +5 -0
- package/dist/api/resources/billing/types/UpsertBillingPriceResponse.js +5 -0
- package/dist/api/resources/billing/types/UpsertBillingProductResponse.js +5 -0
- package/dist/api/resources/billing/types/UpsertBillingSubscriptionResponse.js +5 -0
- package/dist/api/resources/billing/types/UpsertInvoiceResponse.js +5 -0
- package/dist/api/resources/billing/types/UpsertPaymentMethodResponse.js +5 -0
- package/dist/api/resources/billing/types/index.js +60 -0
- package/dist/api/resources/checkout/client/Client.js +546 -0
- package/dist/api/resources/checkout/client/index.js +17 -0
- package/dist/api/resources/checkout/client/requests/CheckoutDataRequestBody.js +5 -0
- package/dist/api/resources/checkout/client/requests/UpdateTrialEndRequestBody.js +5 -0
- package/dist/api/resources/checkout/client/requests/index.js +2 -0
- package/dist/api/resources/checkout/index.js +18 -0
- package/dist/api/resources/checkout/types/CheckoutInternalResponse.js +5 -0
- package/dist/api/resources/checkout/types/GetCheckoutDataResponse.js +5 -0
- package/dist/api/resources/checkout/types/PreviewCheckoutInternalResponse.js +5 -0
- package/dist/api/resources/checkout/types/UpdateCustomerSubscriptionTrialEndResponse.js +5 -0
- package/dist/api/resources/checkout/types/index.js +20 -0
- package/dist/api/resources/companies/client/Client.js +4102 -0
- package/dist/api/resources/companies/client/index.js +17 -0
- package/dist/api/resources/companies/client/requests/CountCompaniesForAdvancedFilterRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/CountCompaniesRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/CountEntityKeyDefinitionsRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/CountEntityTraitDefinitionsRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/CountUsersRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/CreateEntityTraitDefinitionRequestBody.js +5 -0
- package/dist/api/resources/companies/client/requests/GetActiveCompanySubscriptionRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/GetActiveDealsRequest.d.ts +22 -0
- package/dist/api/resources/companies/client/requests/GetActiveDealsRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/GetEntityTraitValuesRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/GetOrCreateCompanyMembershipRequestBody.js +5 -0
- package/dist/api/resources/companies/client/requests/ListCompaniesForAdvancedFilterRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/ListCompaniesRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/ListCompanyMembershipsRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/ListEntityKeyDefinitionsRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/ListEntityTraitDefinitionsRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/ListUsersRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/LookupCompanyRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/LookupUserRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/UpdateEntityTraitDefinitionRequestBody.js +5 -0
- package/dist/api/resources/companies/client/requests/index.js +2 -0
- package/dist/api/resources/companies/index.js +18 -0
- package/dist/api/resources/companies/types/CountCompaniesForAdvancedFilterParams.js +5 -0
- package/dist/api/resources/companies/types/CountCompaniesForAdvancedFilterRequestSortOrderDirection.d.ts +11 -0
- package/dist/api/resources/companies/types/CountCompaniesForAdvancedFilterRequestSortOrderDirection.js +10 -0
- package/dist/api/resources/companies/types/CountCompaniesForAdvancedFilterResponse.js +5 -0
- package/dist/api/resources/companies/types/CountCompaniesForAdvancedFilterResponseParamsSortOrderDirection.d.ts +11 -0
- package/dist/api/resources/companies/types/CountCompaniesForAdvancedFilterResponseParamsSortOrderDirection.js +10 -0
- package/dist/api/resources/companies/types/CountCompaniesParams.js +5 -0
- package/dist/api/resources/companies/types/CountCompaniesResponse.js +5 -0
- package/dist/api/resources/companies/types/CountEntityKeyDefinitionsParams.js +5 -0
- package/dist/api/resources/companies/types/CountEntityKeyDefinitionsRequestEntityType.d.ts +8 -0
- package/dist/api/resources/companies/types/CountEntityKeyDefinitionsRequestEntityType.js +10 -0
- package/dist/api/resources/companies/types/CountEntityKeyDefinitionsResponse.js +5 -0
- package/dist/api/resources/companies/types/CountEntityKeyDefinitionsResponseParamsEntityType.d.ts +8 -0
- package/dist/api/resources/companies/types/CountEntityKeyDefinitionsResponseParamsEntityType.js +10 -0
- package/dist/api/resources/companies/types/CountEntityTraitDefinitionsParams.js +5 -0
- package/dist/api/resources/companies/types/CountEntityTraitDefinitionsRequestEntityType.d.ts +8 -0
- package/dist/api/resources/companies/types/CountEntityTraitDefinitionsRequestEntityType.js +10 -0
- package/dist/api/resources/companies/types/CountEntityTraitDefinitionsRequestTraitType.d.ts +12 -0
- package/dist/api/resources/companies/types/CountEntityTraitDefinitionsRequestTraitType.js +14 -0
- package/dist/api/resources/companies/types/CountEntityTraitDefinitionsResponse.js +5 -0
- package/dist/api/resources/companies/types/CountEntityTraitDefinitionsResponseParamsEntityType.d.ts +8 -0
- package/dist/api/resources/companies/types/CountEntityTraitDefinitionsResponseParamsEntityType.js +10 -0
- package/dist/api/resources/companies/types/CountEntityTraitDefinitionsResponseParamsTraitType.d.ts +12 -0
- package/dist/api/resources/companies/types/CountEntityTraitDefinitionsResponseParamsTraitType.js +14 -0
- package/dist/api/resources/companies/types/CountUsersParams.js +5 -0
- package/dist/api/resources/companies/types/CountUsersResponse.js +5 -0
- package/dist/api/resources/companies/types/CreateCompanyResponse.js +5 -0
- package/dist/api/resources/companies/types/CreateEntityTraitDefinitionRequestBodyEntityType.d.ts +8 -0
- package/dist/api/resources/companies/types/CreateEntityTraitDefinitionRequestBodyEntityType.js +10 -0
- package/dist/api/resources/companies/types/CreateEntityTraitDefinitionRequestBodyTraitType.d.ts +12 -0
- package/dist/api/resources/companies/types/CreateEntityTraitDefinitionRequestBodyTraitType.js +14 -0
- package/dist/api/resources/companies/types/CreateUserResponse.js +5 -0
- package/dist/api/resources/companies/types/DeleteCompanyByKeysResponse.js +5 -0
- package/dist/api/resources/companies/types/DeleteCompanyMembershipResponse.js +5 -0
- package/dist/api/resources/companies/types/DeleteCompanyResponse.js +5 -0
- package/dist/api/resources/companies/types/DeleteUserByKeysResponse.js +5 -0
- package/dist/api/resources/companies/types/DeleteUserResponse.js +5 -0
- package/dist/api/resources/companies/types/GetActiveCompanySubscriptionParams.js +5 -0
- package/dist/api/resources/companies/types/GetActiveCompanySubscriptionResponse.js +5 -0
- package/dist/api/resources/companies/types/GetActiveDealsParams.d.ts +14 -0
- package/dist/api/resources/companies/types/GetActiveDealsParams.js +5 -0
- package/dist/api/resources/companies/types/GetActiveDealsResponse.d.ts +10 -0
- package/dist/api/resources/companies/types/GetActiveDealsResponse.js +5 -0
- package/dist/api/resources/companies/types/GetCompanyResponse.js +5 -0
- package/dist/api/resources/companies/types/GetEntityTraitDefinitionResponse.js +5 -0
- package/dist/api/resources/companies/types/GetEntityTraitValuesParams.js +5 -0
- package/dist/api/resources/companies/types/GetEntityTraitValuesResponse.js +5 -0
- package/dist/api/resources/companies/types/GetOrCreateCompanyMembershipResponse.js +5 -0
- package/dist/api/resources/companies/types/GetOrCreateEntityTraitDefinitionResponse.js +5 -0
- package/dist/api/resources/companies/types/GetUserResponse.js +5 -0
- package/dist/api/resources/companies/types/ListCompaniesForAdvancedFilterParams.js +5 -0
- package/dist/api/resources/companies/types/ListCompaniesForAdvancedFilterRequestSortOrderDirection.d.ts +11 -0
- package/dist/api/resources/companies/types/ListCompaniesForAdvancedFilterRequestSortOrderDirection.js +10 -0
- package/dist/api/resources/companies/types/ListCompaniesForAdvancedFilterResponse.js +5 -0
- package/dist/api/resources/companies/types/ListCompaniesForAdvancedFilterResponseParamsSortOrderDirection.d.ts +11 -0
- package/dist/api/resources/companies/types/ListCompaniesForAdvancedFilterResponseParamsSortOrderDirection.js +10 -0
- package/dist/api/resources/companies/types/ListCompaniesParams.js +5 -0
- package/dist/api/resources/companies/types/ListCompaniesResponse.js +5 -0
- package/dist/api/resources/companies/types/ListCompanyMembershipsParams.js +5 -0
- package/dist/api/resources/companies/types/ListCompanyMembershipsResponse.js +5 -0
- package/dist/api/resources/companies/types/ListEntityKeyDefinitionsParams.js +5 -0
- package/dist/api/resources/companies/types/ListEntityKeyDefinitionsRequestEntityType.d.ts +8 -0
- package/dist/api/resources/companies/types/ListEntityKeyDefinitionsRequestEntityType.js +10 -0
- package/dist/api/resources/companies/types/ListEntityKeyDefinitionsResponse.js +5 -0
- package/dist/api/resources/companies/types/ListEntityKeyDefinitionsResponseParamsEntityType.d.ts +8 -0
- package/dist/api/resources/companies/types/ListEntityKeyDefinitionsResponseParamsEntityType.js +10 -0
- package/dist/api/resources/companies/types/ListEntityTraitDefinitionsParams.js +5 -0
- package/dist/api/resources/companies/types/ListEntityTraitDefinitionsRequestEntityType.d.ts +8 -0
- package/dist/api/resources/companies/types/ListEntityTraitDefinitionsRequestEntityType.js +10 -0
- package/dist/api/resources/companies/types/ListEntityTraitDefinitionsRequestTraitType.d.ts +12 -0
- package/dist/api/resources/companies/types/ListEntityTraitDefinitionsRequestTraitType.js +14 -0
- package/dist/api/resources/companies/types/ListEntityTraitDefinitionsResponse.js +5 -0
- package/dist/api/resources/companies/types/ListEntityTraitDefinitionsResponseParamsEntityType.d.ts +8 -0
- package/dist/api/resources/companies/types/ListEntityTraitDefinitionsResponseParamsEntityType.js +10 -0
- package/dist/api/resources/companies/types/ListEntityTraitDefinitionsResponseParamsTraitType.d.ts +12 -0
- package/dist/api/resources/companies/types/ListEntityTraitDefinitionsResponseParamsTraitType.js +14 -0
- package/dist/api/resources/companies/types/ListUsersParams.js +5 -0
- package/dist/api/resources/companies/types/ListUsersResponse.js +5 -0
- package/dist/api/resources/companies/types/LookupCompanyParams.js +5 -0
- package/dist/api/resources/companies/types/LookupCompanyResponse.js +5 -0
- package/dist/api/resources/companies/types/LookupUserParams.js +5 -0
- package/dist/api/resources/companies/types/LookupUserResponse.js +5 -0
- package/dist/api/resources/companies/types/UpdateEntityTraitDefinitionRequestBodyTraitType.d.ts +12 -0
- package/dist/api/resources/companies/types/UpdateEntityTraitDefinitionRequestBodyTraitType.js +14 -0
- package/dist/api/resources/companies/types/UpdateEntityTraitDefinitionResponse.js +5 -0
- package/dist/api/resources/companies/types/UpsertCompanyResponse.js +5 -0
- package/dist/api/resources/companies/types/UpsertCompanyTraitResponse.js +5 -0
- package/dist/api/resources/companies/types/UpsertUserResponse.js +5 -0
- package/dist/api/resources/companies/types/UpsertUserTraitResponse.js +5 -0
- package/dist/api/resources/companies/types/index.js +84 -0
- package/dist/api/resources/components/client/Client.js +846 -0
- package/dist/api/resources/components/client/index.js +17 -0
- package/dist/api/resources/components/client/requests/CountComponentsRequest.js +5 -0
- package/dist/api/resources/components/client/requests/CreateComponentRequestBody.js +5 -0
- package/dist/api/resources/components/client/requests/ListComponentsRequest.js +5 -0
- package/dist/api/resources/components/client/requests/PreviewComponentDataRequest.js +5 -0
- package/dist/api/resources/components/client/requests/UpdateComponentRequestBody.js +5 -0
- package/dist/api/resources/components/client/requests/index.js +2 -0
- package/dist/api/resources/components/index.js +18 -0
- package/dist/api/resources/components/types/CountComponentsParams.js +5 -0
- package/dist/api/resources/components/types/CountComponentsResponse.js +5 -0
- package/dist/api/resources/components/types/CreateComponentRequestBodyEntityType.d.ts +8 -0
- package/dist/api/resources/components/types/CreateComponentRequestBodyEntityType.js +10 -0
- package/dist/api/resources/components/types/CreateComponentResponse.js +5 -0
- package/dist/api/resources/components/types/DeleteComponentResponse.js +5 -0
- package/dist/api/resources/components/types/GetComponentResponse.js +5 -0
- package/dist/api/resources/components/types/ListComponentsParams.js +5 -0
- package/dist/api/resources/components/types/ListComponentsResponse.js +5 -0
- package/dist/api/resources/components/types/PreviewComponentDataParams.js +5 -0
- package/dist/api/resources/components/types/PreviewComponentDataResponse.js +5 -0
- package/dist/api/resources/components/types/UpdateComponentRequestBodyEntityType.d.ts +8 -0
- package/dist/api/resources/components/types/UpdateComponentRequestBodyEntityType.js +10 -0
- package/dist/api/resources/components/types/UpdateComponentRequestBodyState.d.ts +8 -0
- package/dist/api/resources/components/types/UpdateComponentRequestBodyState.js +10 -0
- package/dist/api/resources/components/types/UpdateComponentResponse.js +5 -0
- package/dist/api/resources/components/types/index.js +29 -0
- package/dist/api/resources/credits/client/Client.js +2338 -0
- package/dist/api/resources/credits/client/index.js +17 -0
- package/dist/api/resources/credits/client/requests/CountBillingCreditsGrantsRequest.js +5 -0
- package/dist/api/resources/credits/client/requests/CountBillingCreditsRequest.js +5 -0
- package/dist/api/resources/credits/client/requests/CountBillingPlanCreditGrantsRequest.js +5 -0
- package/dist/api/resources/credits/client/requests/CountCreditBundlesRequest.js +5 -0
- package/dist/api/resources/credits/client/requests/CreateBillingCreditRequestBody.js +5 -0
- package/dist/api/resources/credits/client/requests/CreateBillingPlanCreditGrantRequestBody.d.ts +21 -0
- package/dist/api/resources/credits/client/requests/CreateBillingPlanCreditGrantRequestBody.js +5 -0
- package/dist/api/resources/credits/client/requests/CreateCreditBundleRequestBody.js +5 -0
- package/dist/api/resources/credits/client/requests/ListBillingCreditsRequest.js +5 -0
- package/dist/api/resources/credits/client/requests/ListBillingPlanCreditGrantsRequest.js +5 -0
- package/dist/api/resources/credits/client/requests/ListCompanyGrantsRequest.js +5 -0
- package/dist/api/resources/credits/client/requests/ListCreditBundlesRequest.js +5 -0
- package/dist/api/resources/credits/client/requests/ListGrantsForCreditRequest.js +5 -0
- package/dist/api/resources/credits/client/requests/UpdateBillingCreditRequestBody.js +5 -0
- package/dist/api/resources/credits/client/requests/ZeroOutGrantRequestBody.js +5 -0
- package/dist/api/resources/credits/client/requests/index.js +2 -0
- package/dist/api/resources/credits/index.js +18 -0
- package/dist/api/resources/credits/types/CountBillingCreditsGrantsParams.js +5 -0
- package/dist/api/resources/credits/types/CountBillingCreditsGrantsResponse.js +5 -0
- package/dist/api/resources/credits/types/CountBillingCreditsParams.js +5 -0
- package/dist/api/resources/credits/types/CountBillingCreditsResponse.js +5 -0
- package/dist/api/resources/credits/types/CountBillingPlanCreditGrantsParams.js +5 -0
- package/dist/api/resources/credits/types/CountBillingPlanCreditGrantsResponse.js +5 -0
- package/dist/api/resources/credits/types/CountCreditBundlesParams.js +5 -0
- package/dist/api/resources/credits/types/CountCreditBundlesRequestStatus.d.ts +8 -0
- package/dist/api/resources/credits/types/CountCreditBundlesRequestStatus.js +10 -0
- package/dist/api/resources/credits/types/CountCreditBundlesResponse.js +5 -0
- package/dist/api/resources/credits/types/CountCreditBundlesResponseParamsStatus.d.ts +8 -0
- package/dist/api/resources/credits/types/CountCreditBundlesResponseParamsStatus.js +10 -0
- package/dist/api/resources/credits/types/CreateBillingCreditRequestBodyBurnStrategy.d.ts +10 -0
- package/dist/api/resources/credits/types/CreateBillingCreditRequestBodyBurnStrategy.js +12 -0
- package/dist/api/resources/credits/types/CreateBillingCreditRequestBodyDefaultRolloverPolicy.d.ts +9 -0
- package/dist/api/resources/credits/types/CreateBillingCreditRequestBodyDefaultRolloverPolicy.js +11 -0
- package/dist/api/resources/credits/types/CreateBillingCreditResponse.js +5 -0
- package/dist/api/resources/credits/types/CreateBillingPlanCreditGrantRequestBodyResetCadence.d.ts +10 -0
- package/dist/api/resources/credits/types/CreateBillingPlanCreditGrantRequestBodyResetCadence.js +12 -0
- package/dist/api/resources/credits/types/CreateBillingPlanCreditGrantRequestBodyResetStart.d.ts +8 -0
- package/dist/api/resources/credits/types/CreateBillingPlanCreditGrantRequestBodyResetStart.js +10 -0
- package/dist/api/resources/credits/types/CreateBillingPlanCreditGrantResponse.js +5 -0
- package/dist/api/resources/credits/types/CreateCreditBundleRequestBodyExpiryType.d.ts +8 -0
- package/dist/api/resources/credits/types/CreateCreditBundleRequestBodyExpiryType.js +10 -0
- package/dist/api/resources/credits/types/CreateCreditBundleRequestBodyStatus.d.ts +8 -0
- package/dist/api/resources/credits/types/CreateCreditBundleRequestBodyStatus.js +10 -0
- package/dist/api/resources/credits/types/CreateCreditBundleResponse.js +5 -0
- package/dist/api/resources/credits/types/DeleteBillingPlanCreditGrantResponse.js +5 -0
- package/dist/api/resources/credits/types/DeleteCreditBundleResponse.js +5 -0
- package/dist/api/resources/credits/types/GetCreditBundleResponse.js +5 -0
- package/dist/api/resources/credits/types/GetSingleBillingCreditResponse.js +5 -0
- package/dist/api/resources/credits/types/ListBillingCreditsParams.js +5 -0
- package/dist/api/resources/credits/types/ListBillingCreditsResponse.js +5 -0
- package/dist/api/resources/credits/types/ListBillingPlanCreditGrantsParams.js +5 -0
- package/dist/api/resources/credits/types/ListBillingPlanCreditGrantsResponse.js +5 -0
- package/dist/api/resources/credits/types/ListCompanyGrantsParams.js +5 -0
- package/dist/api/resources/credits/types/ListCompanyGrantsRequestDir.d.ts +8 -0
- package/dist/api/resources/credits/types/ListCompanyGrantsRequestDir.js +10 -0
- package/dist/api/resources/credits/types/ListCompanyGrantsRequestOrder.d.ts +10 -0
- package/dist/api/resources/credits/types/ListCompanyGrantsRequestOrder.js +12 -0
- package/dist/api/resources/credits/types/ListCompanyGrantsResponse.js +5 -0
- package/dist/api/resources/credits/types/ListCompanyGrantsResponseParamsDir.d.ts +8 -0
- package/dist/api/resources/credits/types/ListCompanyGrantsResponseParamsDir.js +10 -0
- package/dist/api/resources/credits/types/ListCompanyGrantsResponseParamsOrder.d.ts +10 -0
- package/dist/api/resources/credits/types/ListCompanyGrantsResponseParamsOrder.js +12 -0
- package/dist/api/resources/credits/types/ListCreditBundlesParams.js +5 -0
- package/dist/api/resources/credits/types/ListCreditBundlesRequestStatus.d.ts +8 -0
- package/dist/api/resources/credits/types/ListCreditBundlesRequestStatus.js +10 -0
- package/dist/api/resources/credits/types/ListCreditBundlesResponse.js +5 -0
- package/dist/api/resources/credits/types/ListCreditBundlesResponseParamsStatus.d.ts +8 -0
- package/dist/api/resources/credits/types/ListCreditBundlesResponseParamsStatus.js +10 -0
- package/dist/api/resources/credits/types/ListGrantsForCreditParams.js +5 -0
- package/dist/api/resources/credits/types/ListGrantsForCreditResponse.js +5 -0
- package/dist/api/resources/credits/types/UpdateBillingCreditRequestBodyBurnStrategy.d.ts +10 -0
- package/dist/api/resources/credits/types/UpdateBillingCreditRequestBodyBurnStrategy.js +12 -0
- package/dist/api/resources/credits/types/UpdateBillingCreditRequestBodyDefaultRolloverPolicy.d.ts +9 -0
- package/dist/api/resources/credits/types/UpdateBillingCreditRequestBodyDefaultRolloverPolicy.js +11 -0
- package/dist/api/resources/credits/types/UpdateBillingCreditResponse.js +5 -0
- package/dist/api/resources/credits/types/UpdateCreditBundleResponse.d.ts +9 -0
- package/dist/api/resources/credits/types/UpdateCreditBundleResponse.js +5 -0
- package/dist/api/resources/credits/types/ZeroOutGrantRequestBodyReason.d.ts +8 -0
- package/dist/api/resources/credits/types/ZeroOutGrantRequestBodyReason.js +10 -0
- package/dist/api/resources/credits/types/ZeroOutGrantResponse.js +5 -0
- package/dist/api/resources/credits/types/index.js +61 -0
- package/dist/api/resources/crm/client/Client.d.ts +129 -0
- package/dist/api/resources/crm/client/Client.js +657 -0
- package/dist/api/resources/crm/client/index.d.ts +1 -0
- package/dist/api/resources/crm/client/index.js +17 -0
- package/dist/api/resources/crm/client/requests/CreateCrmDealLineItemAssociationRequestBody.d.ts +14 -0
- package/dist/api/resources/crm/client/requests/CreateCrmDealLineItemAssociationRequestBody.js +5 -0
- package/dist/api/resources/crm/client/requests/CreateCrmDealRequestBody.d.ts +22 -0
- package/dist/api/resources/crm/client/requests/CreateCrmDealRequestBody.js +5 -0
- package/dist/api/resources/crm/client/requests/CreateCrmLineItemRequestBody.d.ts +23 -0
- package/dist/api/resources/crm/client/requests/CreateCrmLineItemRequestBody.js +5 -0
- package/dist/api/resources/crm/client/requests/CreateCrmProductRequestBody.d.ts +26 -0
- package/dist/api/resources/crm/client/requests/CreateCrmProductRequestBody.js +5 -0
- package/dist/api/resources/crm/client/requests/ListCrmProductsRequest.d.ts +19 -0
- package/dist/api/resources/crm/client/requests/ListCrmProductsRequest.js +5 -0
- package/dist/api/resources/crm/client/requests/index.d.ts +5 -0
- package/dist/api/resources/crm/client/requests/index.js +2 -0
- package/dist/api/resources/crm/index.d.ts +2 -0
- package/dist/api/resources/crm/index.js +18 -0
- package/dist/api/resources/crm/types/ListCrmProductsParams.d.ts +14 -0
- package/dist/api/resources/crm/types/ListCrmProductsParams.js +5 -0
- package/dist/api/resources/crm/types/ListCrmProductsResponse.d.ts +10 -0
- package/dist/api/resources/crm/types/ListCrmProductsResponse.js +5 -0
- package/dist/api/resources/crm/types/UpsertCrmDealResponse.d.ts +9 -0
- package/dist/api/resources/crm/types/UpsertCrmDealResponse.js +5 -0
- package/dist/api/resources/crm/types/UpsertCrmProductResponse.d.ts +9 -0
- package/dist/api/resources/crm/types/UpsertCrmProductResponse.js +5 -0
- package/dist/api/resources/crm/types/UpsertDealLineItemAssociationResponse.d.ts +9 -0
- package/dist/api/resources/crm/types/UpsertDealLineItemAssociationResponse.js +5 -0
- package/dist/api/resources/crm/types/UpsertLineItemResponse.d.ts +9 -0
- package/dist/api/resources/crm/types/UpsertLineItemResponse.js +5 -0
- package/dist/api/resources/crm/types/index.d.ts +6 -0
- package/dist/api/resources/crm/types/index.js +22 -0
- package/dist/api/resources/dataexports/client/Client.js +265 -0
- package/dist/api/resources/dataexports/client/index.js +17 -0
- package/dist/api/resources/dataexports/client/requests/CreateDataExportRequestBody.js +5 -0
- package/dist/api/resources/dataexports/client/requests/index.js +2 -0
- package/dist/api/resources/dataexports/index.js +18 -0
- package/dist/api/resources/dataexports/types/CreateDataExportResponse.js +5 -0
- package/dist/api/resources/dataexports/types/index.js +17 -0
- package/dist/api/resources/entitlements/client/Client.js +2431 -0
- package/dist/api/resources/entitlements/client/index.js +17 -0
- package/dist/api/resources/entitlements/client/requests/CountCompanyOverridesRequest.js +5 -0
- package/dist/api/resources/entitlements/client/requests/CountFeatureCompaniesRequest.js +5 -0
- package/dist/api/resources/entitlements/client/requests/CountFeatureUsageRequest.js +5 -0
- package/dist/api/resources/entitlements/client/requests/CountFeatureUsersRequest.js +5 -0
- package/dist/api/resources/entitlements/client/requests/CountPlanEntitlementsRequest.js +5 -0
- package/dist/api/resources/entitlements/client/requests/CreateCompanyOverrideRequestBody.js +5 -0
- package/dist/api/resources/entitlements/client/requests/CreatePlanEntitlementRequestBody.js +5 -0
- package/dist/api/resources/entitlements/client/requests/GetFeatureUsageByCompanyRequest.js +5 -0
- package/dist/api/resources/entitlements/client/requests/ListCompanyOverridesRequest.js +5 -0
- package/dist/api/resources/entitlements/client/requests/ListFeatureCompaniesRequest.js +5 -0
- package/dist/api/resources/entitlements/client/requests/ListFeatureUsageRequest.js +5 -0
- package/dist/api/resources/entitlements/client/requests/ListFeatureUsersRequest.js +5 -0
- package/dist/api/resources/entitlements/client/requests/ListPlanEntitlementsRequest.js +5 -0
- package/dist/api/resources/entitlements/client/requests/UpdateCompanyOverrideRequestBody.js +5 -0
- package/dist/api/resources/entitlements/client/requests/UpdatePlanEntitlementRequestBody.js +5 -0
- package/dist/api/resources/entitlements/client/requests/index.js +2 -0
- package/dist/api/resources/entitlements/index.js +18 -0
- package/dist/api/resources/entitlements/types/CountCompanyOverridesParams.js +5 -0
- package/dist/api/resources/entitlements/types/CountCompanyOverridesResponse.js +5 -0
- package/dist/api/resources/entitlements/types/CountFeatureCompaniesParams.js +5 -0
- package/dist/api/resources/entitlements/types/CountFeatureCompaniesResponse.js +5 -0
- package/dist/api/resources/entitlements/types/CountFeatureUsageParams.js +5 -0
- package/dist/api/resources/entitlements/types/CountFeatureUsageResponse.js +5 -0
- package/dist/api/resources/entitlements/types/CountFeatureUsersParams.js +5 -0
- package/dist/api/resources/entitlements/types/CountFeatureUsersResponse.js +5 -0
- package/dist/api/resources/entitlements/types/CountPlanEntitlementsParams.js +5 -0
- package/dist/api/resources/entitlements/types/CountPlanEntitlementsResponse.js +5 -0
- package/dist/api/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriod.js +12 -0
- package/dist/api/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriodMonthReset.js +10 -0
- package/dist/api/resources/entitlements/types/CreateCompanyOverrideRequestBodyValueType.d.ts +11 -0
- package/dist/api/resources/entitlements/types/CreateCompanyOverrideRequestBodyValueType.js +13 -0
- package/dist/api/resources/entitlements/types/CreateCompanyOverrideResponse.js +5 -0
- package/dist/api/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriod.js +12 -0
- package/dist/api/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriodMonthReset.js +10 -0
- package/dist/api/resources/entitlements/types/CreatePlanEntitlementRequestBodyPriceBehavior.d.ts +11 -0
- package/dist/api/resources/entitlements/types/CreatePlanEntitlementRequestBodyPriceBehavior.js +13 -0
- package/dist/api/resources/entitlements/types/CreatePlanEntitlementRequestBodyValueType.d.ts +11 -0
- package/dist/api/resources/entitlements/types/CreatePlanEntitlementRequestBodyValueType.js +13 -0
- package/dist/api/resources/entitlements/types/CreatePlanEntitlementResponse.js +5 -0
- package/dist/api/resources/entitlements/types/DeleteCompanyOverrideResponse.js +5 -0
- package/dist/api/resources/entitlements/types/DeletePlanEntitlementResponse.js +5 -0
- package/dist/api/resources/entitlements/types/GetCompanyOverrideResponse.js +5 -0
- package/dist/api/resources/entitlements/types/GetFeatureUsageByCompanyParams.js +5 -0
- package/dist/api/resources/entitlements/types/GetFeatureUsageByCompanyResponse.js +5 -0
- package/dist/api/resources/entitlements/types/GetPlanEntitlementResponse.js +5 -0
- package/dist/api/resources/entitlements/types/ListCompanyOverridesParams.js +5 -0
- package/dist/api/resources/entitlements/types/ListCompanyOverridesResponse.js +5 -0
- package/dist/api/resources/entitlements/types/ListFeatureCompaniesParams.js +5 -0
- package/dist/api/resources/entitlements/types/ListFeatureCompaniesResponse.js +5 -0
- package/dist/api/resources/entitlements/types/ListFeatureUsageParams.js +5 -0
- package/dist/api/resources/entitlements/types/ListFeatureUsageResponse.js +5 -0
- package/dist/api/resources/entitlements/types/ListFeatureUsersParams.js +5 -0
- package/dist/api/resources/entitlements/types/ListFeatureUsersResponse.js +5 -0
- package/dist/api/resources/entitlements/types/ListPlanEntitlementsParams.js +5 -0
- package/dist/api/resources/entitlements/types/ListPlanEntitlementsResponse.js +5 -0
- package/dist/api/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriod.js +12 -0
- package/dist/api/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset.js +10 -0
- package/dist/api/resources/entitlements/types/UpdateCompanyOverrideRequestBodyValueType.d.ts +11 -0
- package/dist/api/resources/entitlements/types/UpdateCompanyOverrideRequestBodyValueType.js +13 -0
- package/dist/api/resources/entitlements/types/UpdateCompanyOverrideResponse.js +5 -0
- package/dist/api/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriod.js +12 -0
- package/dist/api/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset.js +10 -0
- package/dist/api/resources/entitlements/types/UpdatePlanEntitlementRequestBodyPriceBehavior.d.ts +11 -0
- package/dist/api/resources/entitlements/types/UpdatePlanEntitlementRequestBodyPriceBehavior.js +13 -0
- package/dist/api/resources/entitlements/types/UpdatePlanEntitlementRequestBodyValueType.d.ts +11 -0
- package/dist/api/resources/entitlements/types/UpdatePlanEntitlementRequestBodyValueType.js +13 -0
- package/dist/api/resources/entitlements/types/UpdatePlanEntitlementResponse.js +5 -0
- package/dist/api/resources/entitlements/types/index.js +60 -0
- package/dist/api/resources/events/client/Client.js +757 -0
- package/dist/api/resources/events/client/index.js +17 -0
- package/dist/api/resources/events/client/requests/CreateEventBatchRequestBody.js +5 -0
- package/dist/api/resources/events/client/requests/GetEventSummariesRequest.js +5 -0
- package/dist/api/resources/events/client/requests/ListEventsRequest.js +5 -0
- package/dist/api/resources/events/client/requests/index.js +2 -0
- package/dist/api/resources/events/index.js +18 -0
- package/dist/api/resources/events/types/CreateEventBatchResponse.js +5 -0
- package/dist/api/resources/events/types/CreateEventResponse.js +5 -0
- package/dist/api/resources/events/types/GetEventResponse.js +5 -0
- package/dist/api/resources/events/types/GetEventSummariesParams.js +5 -0
- package/dist/api/resources/events/types/GetEventSummariesResponse.js +5 -0
- package/dist/api/resources/events/types/GetSegmentIntegrationStatusResponse.js +5 -0
- package/dist/api/resources/events/types/ListEventsParams.js +5 -0
- package/dist/api/resources/events/types/ListEventsRequestEventTypesItem.d.ts +9 -0
- package/dist/api/resources/events/types/ListEventsRequestEventTypesItem.js +11 -0
- package/dist/api/resources/events/types/ListEventsResponse.js +5 -0
- package/dist/api/resources/events/types/ListEventsResponseParamsEventTypesItem.d.ts +9 -0
- package/dist/api/resources/events/types/ListEventsResponseParamsEventTypesItem.js +11 -0
- package/dist/api/resources/events/types/index.js +26 -0
- package/dist/api/resources/features/client/Client.js +2324 -0
- package/dist/api/resources/features/client/index.js +17 -0
- package/dist/api/resources/features/client/requests/CountFeaturesRequest.js +5 -0
- package/dist/api/resources/features/client/requests/CountFlagsRequest.js +5 -0
- package/dist/api/resources/features/client/requests/CreateFeatureRequestBody.js +5 -0
- package/dist/api/resources/features/client/requests/ListFeaturesRequest.js +5 -0
- package/dist/api/resources/features/client/requests/ListFlagsRequest.js +5 -0
- package/dist/api/resources/features/client/requests/UpdateFeatureRequestBody.js +5 -0
- package/dist/api/resources/features/client/requests/UpdateFlagRulesRequestBody.js +5 -0
- package/dist/api/resources/features/client/requests/index.js +2 -0
- package/dist/api/resources/features/index.js +18 -0
- package/dist/api/resources/features/types/CheckFlagResponse.js +5 -0
- package/dist/api/resources/features/types/CheckFlagsResponse.js +5 -0
- package/dist/api/resources/features/types/CountAudienceCompaniesResponse.d.ts +9 -0
- package/dist/api/resources/features/types/CountAudienceCompaniesResponse.js +5 -0
- package/dist/api/resources/features/types/CountAudienceUsersResponse.d.ts +9 -0
- package/dist/api/resources/features/types/CountAudienceUsersResponse.js +5 -0
- package/dist/api/resources/features/types/CountFeaturesParams.js +5 -0
- package/dist/api/resources/features/types/CountFeaturesResponse.js +5 -0
- package/dist/api/resources/features/types/CountFlagsParams.js +5 -0
- package/dist/api/resources/features/types/CountFlagsResponse.js +5 -0
- package/dist/api/resources/features/types/CreateFeatureRequestBodyFeatureType.d.ts +9 -0
- package/dist/api/resources/features/types/CreateFeatureRequestBodyFeatureType.js +11 -0
- package/dist/api/resources/features/types/CreateFeatureRequestBodyLifecyclePhase.d.ts +15 -0
- package/dist/api/resources/features/types/CreateFeatureRequestBodyLifecyclePhase.js +17 -0
- package/dist/api/resources/features/types/CreateFeatureResponse.js +5 -0
- package/dist/api/resources/features/types/CreateFlagResponse.js +5 -0
- package/dist/api/resources/features/types/DeleteFeatureResponse.js +5 -0
- package/dist/api/resources/features/types/DeleteFlagResponse.js +5 -0
- package/dist/api/resources/features/types/GetFeatureResponse.js +5 -0
- package/dist/api/resources/features/types/GetFlagResponse.js +5 -0
- package/dist/api/resources/features/types/ListAudienceCompaniesResponse.d.ts +10 -0
- package/dist/api/resources/features/types/ListAudienceCompaniesResponse.js +5 -0
- package/dist/api/resources/features/types/ListAudienceUsersResponse.d.ts +10 -0
- package/dist/api/resources/features/types/ListAudienceUsersResponse.js +5 -0
- package/dist/api/resources/features/types/ListFeaturesParams.js +5 -0
- package/dist/api/resources/features/types/ListFeaturesResponse.js +5 -0
- package/dist/api/resources/features/types/ListFlagsParams.js +5 -0
- package/dist/api/resources/features/types/ListFlagsResponse.js +5 -0
- package/dist/api/resources/features/types/UpdateFeatureRequestBodyFeatureType.d.ts +9 -0
- package/dist/api/resources/features/types/UpdateFeatureRequestBodyFeatureType.js +11 -0
- package/dist/api/resources/features/types/UpdateFeatureRequestBodyLifecyclePhase.d.ts +15 -0
- package/dist/api/resources/features/types/UpdateFeatureRequestBodyLifecyclePhase.js +17 -0
- package/dist/api/resources/features/types/UpdateFeatureResponse.js +5 -0
- package/dist/api/resources/features/types/UpdateFlagResponse.js +5 -0
- package/dist/api/resources/features/types/UpdateFlagRulesResponse.js +5 -0
- package/dist/api/resources/features/types/index.js +43 -0
- package/dist/api/resources/index.js +84 -0
- package/dist/api/resources/plangroups/client/Client.js +396 -0
- package/dist/api/resources/plangroups/client/index.js +17 -0
- package/dist/api/resources/plangroups/client/requests/CreatePlanGroupRequestBody.js +5 -0
- package/dist/api/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.js +5 -0
- package/dist/api/resources/plangroups/client/requests/index.js +2 -0
- package/dist/api/resources/plangroups/index.js +18 -0
- package/dist/api/resources/plangroups/types/CreatePlanGroupResponse.js +5 -0
- package/dist/api/resources/plangroups/types/GetPlanGroupResponse.js +5 -0
- package/dist/api/resources/plangroups/types/UpdatePlanGroupResponse.js +5 -0
- package/dist/api/resources/plangroups/types/index.js +19 -0
- package/dist/api/resources/plans/client/Client.js +2047 -0
- package/dist/api/resources/plans/client/index.js +17 -0
- package/dist/api/resources/plans/client/requests/CountPlanTraitsRequest.d.ts +20 -0
- package/dist/api/resources/plans/client/requests/CountPlanTraitsRequest.js +5 -0
- package/dist/api/resources/plans/client/requests/CountPlansRequest.js +5 -0
- package/dist/api/resources/plans/client/requests/CreatePlanRequestBody.d.ts +18 -0
- package/dist/api/resources/plans/client/requests/CreatePlanRequestBody.js +5 -0
- package/dist/api/resources/plans/client/requests/CreatePlanTraitRequestBody.d.ts +16 -0
- package/dist/api/resources/plans/client/requests/CreatePlanTraitRequestBody.js +5 -0
- package/dist/api/resources/plans/client/requests/ListPlanTraitsRequest.d.ts +20 -0
- package/dist/api/resources/plans/client/requests/ListPlanTraitsRequest.js +5 -0
- package/dist/api/resources/plans/client/requests/ListPlansRequest.js +5 -0
- package/dist/api/resources/plans/client/requests/UpdateAudienceRequestBody.d.ts +25 -0
- package/dist/api/resources/plans/client/requests/UpdateAudienceRequestBody.js +5 -0
- package/dist/api/resources/plans/client/requests/UpdateCompanyPlansRequestBody.js +5 -0
- package/dist/api/resources/plans/client/requests/UpdatePlanRequestBody.d.ts +14 -0
- package/dist/api/resources/plans/client/requests/UpdatePlanRequestBody.js +5 -0
- package/dist/api/resources/plans/client/requests/UpdatePlanTraitRequestBody.d.ts +14 -0
- package/dist/api/resources/plans/client/requests/UpdatePlanTraitRequestBody.js +5 -0
- package/dist/api/resources/plans/client/requests/UpsertBillingProductRequestBody.d.ts +24 -0
- package/dist/api/resources/plans/client/requests/UpsertBillingProductRequestBody.js +5 -0
- package/dist/api/resources/plans/client/requests/index.js +2 -0
- package/dist/api/resources/plans/index.js +18 -0
- package/dist/api/resources/plans/types/CountPlanTraitsParams.d.ts +15 -0
- package/dist/api/resources/plans/types/CountPlanTraitsParams.js +5 -0
- package/dist/api/resources/plans/types/CountPlanTraitsResponse.d.ts +9 -0
- package/dist/api/resources/plans/types/CountPlanTraitsResponse.js +5 -0
- package/dist/api/resources/plans/types/CountPlansParams.js +5 -0
- package/dist/api/resources/plans/types/CountPlansRequestPlanType.d.ts +11 -0
- package/dist/api/resources/plans/types/CountPlansRequestPlanType.js +10 -0
- package/dist/api/resources/plans/types/CountPlansResponse.js +5 -0
- package/dist/api/resources/plans/types/CountPlansResponseParamsPlanType.d.ts +11 -0
- package/dist/api/resources/plans/types/CountPlansResponseParamsPlanType.js +10 -0
- package/dist/api/resources/plans/types/CreatePlanRequestBodyPlanType.d.ts +8 -0
- package/dist/api/resources/plans/types/CreatePlanRequestBodyPlanType.js +10 -0
- package/dist/api/resources/plans/types/CreatePlanResponse.js +5 -0
- package/dist/api/resources/plans/types/CreatePlanTraitResponse.d.ts +9 -0
- package/dist/api/resources/plans/types/CreatePlanTraitResponse.js +5 -0
- package/dist/api/resources/plans/types/DeleteAudienceResponse.d.ts +9 -0
- package/dist/api/resources/plans/types/DeleteAudienceResponse.js +5 -0
- package/dist/api/resources/plans/types/DeletePlanResponse.js +5 -0
- package/dist/api/resources/plans/types/DeletePlanTraitResponse.d.ts +9 -0
- package/dist/api/resources/plans/types/DeletePlanTraitResponse.js +5 -0
- package/dist/api/resources/plans/types/GetAudienceResponse.d.ts +9 -0
- package/dist/api/resources/plans/types/GetAudienceResponse.js +5 -0
- package/dist/api/resources/plans/types/GetPlanResponse.js +5 -0
- package/dist/api/resources/plans/types/GetPlanTraitResponse.d.ts +9 -0
- package/dist/api/resources/plans/types/GetPlanTraitResponse.js +5 -0
- package/dist/api/resources/plans/types/ListPlanTraitsParams.d.ts +15 -0
- package/dist/api/resources/plans/types/ListPlanTraitsParams.js +5 -0
- package/dist/api/resources/plans/types/ListPlanTraitsResponse.d.ts +10 -0
- package/dist/api/resources/plans/types/ListPlanTraitsResponse.js +5 -0
- package/dist/api/resources/plans/types/ListPlansParams.js +5 -0
- package/dist/api/resources/plans/types/ListPlansRequestPlanType.d.ts +11 -0
- package/dist/api/resources/plans/types/ListPlansRequestPlanType.js +10 -0
- package/dist/api/resources/plans/types/ListPlansResponse.js +5 -0
- package/dist/api/resources/plans/types/ListPlansResponseParamsPlanType.d.ts +11 -0
- package/dist/api/resources/plans/types/ListPlansResponseParamsPlanType.js +10 -0
- package/dist/api/resources/plans/types/UpdateAudienceResponse.d.ts +9 -0
- package/dist/api/resources/plans/types/UpdateAudienceResponse.js +5 -0
- package/dist/api/resources/plans/types/UpdateCompanyPlansResponse.js +5 -0
- package/dist/api/resources/plans/types/UpdatePlanResponse.js +5 -0
- package/dist/api/resources/plans/types/UpdatePlanTraitResponse.d.ts +9 -0
- package/dist/api/resources/plans/types/UpdatePlanTraitResponse.js +5 -0
- package/dist/api/resources/plans/types/UpsertBillingProductPlanResponse.js +5 -0
- package/dist/api/resources/plans/types/UpsertBillingProductRequestBodyChargeType.d.ts +9 -0
- package/dist/api/resources/plans/types/UpsertBillingProductRequestBodyChargeType.js +11 -0
- package/dist/api/resources/plans/types/index.js +43 -0
- package/dist/api/resources/webhooks/client/Client.js +1100 -0
- package/dist/api/resources/webhooks/client/index.js +17 -0
- package/dist/api/resources/webhooks/client/requests/CountWebhookEventsRequest.js +5 -0
- package/dist/api/resources/webhooks/client/requests/CountWebhooksRequest.js +5 -0
- package/dist/api/resources/webhooks/client/requests/CreateWebhookRequestBody.js +5 -0
- package/dist/api/resources/webhooks/client/requests/ListWebhookEventsRequest.js +5 -0
- package/dist/api/resources/webhooks/client/requests/ListWebhooksRequest.js +5 -0
- package/dist/api/resources/webhooks/client/requests/UpdateWebhookRequestBody.js +5 -0
- package/dist/api/resources/webhooks/client/requests/index.js +2 -0
- package/dist/api/resources/webhooks/index.js +18 -0
- package/dist/api/resources/webhooks/types/CountWebhookEventsParams.js +5 -0
- package/dist/api/resources/webhooks/types/CountWebhookEventsResponse.js +5 -0
- package/dist/api/resources/webhooks/types/CountWebhooksParams.js +5 -0
- package/dist/api/resources/webhooks/types/CountWebhooksResponse.js +5 -0
- package/dist/api/resources/webhooks/types/CreateWebhookRequestBodyRequestTypesItem.d.ts +34 -0
- package/dist/api/resources/webhooks/types/CreateWebhookRequestBodyRequestTypesItem.js +36 -0
- package/dist/api/resources/webhooks/types/CreateWebhookResponse.js +5 -0
- package/dist/api/resources/webhooks/types/DeleteWebhookResponse.js +5 -0
- package/dist/api/resources/webhooks/types/GetWebhookEventResponse.js +5 -0
- package/dist/api/resources/webhooks/types/GetWebhookResponse.js +5 -0
- package/dist/api/resources/webhooks/types/ListWebhookEventsParams.js +5 -0
- package/dist/api/resources/webhooks/types/ListWebhookEventsResponse.js +5 -0
- package/dist/api/resources/webhooks/types/ListWebhooksParams.js +5 -0
- package/dist/api/resources/webhooks/types/ListWebhooksResponse.js +5 -0
- package/dist/api/resources/webhooks/types/UpdateWebhookRequestBodyRequestTypesItem.d.ts +34 -0
- package/dist/api/resources/webhooks/types/UpdateWebhookRequestBodyRequestTypesItem.js +36 -0
- package/dist/api/resources/webhooks/types/UpdateWebhookRequestBodyStatus.d.ts +8 -0
- package/dist/api/resources/webhooks/types/UpdateWebhookRequestBodyStatus.js +10 -0
- package/dist/api/resources/webhooks/types/UpdateWebhookResponse.js +5 -0
- package/dist/api/resources/webhooks/types/index.js +32 -0
- package/dist/api/types/ApiError.js +5 -0
- package/dist/api/types/ApiKeyCreateResponseData.js +5 -0
- package/dist/api/types/ApiKeyRequestListResponseData.js +5 -0
- package/dist/api/types/ApiKeyRequestResponseData.js +5 -0
- package/dist/api/types/ApiKeyResponseData.js +5 -0
- package/dist/api/types/AudienceRequestBody.d.ts +13 -0
- package/dist/api/types/AudienceRequestBody.js +5 -0
- package/dist/api/types/BillingCouponResponseData.js +5 -0
- package/dist/api/types/BillingCreditBundleResponseData.js +5 -0
- package/dist/api/types/BillingCreditGrantResponseData.js +5 -0
- package/dist/api/types/BillingCreditResponseData.js +5 -0
- package/dist/api/types/BillingCustomerResponseData.js +5 -0
- package/dist/api/types/BillingCustomerSubscription.js +5 -0
- package/dist/api/types/BillingCustomerWithSubscriptionsResponseData.js +5 -0
- package/dist/api/types/BillingMeterResponseData.js +5 -0
- package/dist/api/types/BillingPlanCreditGrantResponseData.js +5 -0
- package/dist/api/types/BillingPriceResponseData.js +5 -0
- package/dist/api/types/BillingPriceView.js +5 -0
- package/dist/api/types/BillingProductDetailResponseData.js +5 -0
- package/dist/api/types/BillingProductForSubscriptionResponseData.js +5 -0
- package/dist/api/types/BillingProductPlanResponseData.js +5 -0
- package/dist/api/types/BillingProductPriceResponseData.js +5 -0
- package/dist/api/types/BillingProductPriceTierResponseData.js +5 -0
- package/dist/api/types/BillingProductPricing.js +5 -0
- package/dist/api/types/BillingProductPricingUsageType.d.ts +8 -0
- package/dist/api/types/BillingProductPricingUsageType.js +10 -0
- package/dist/api/types/BillingProductResponseData.js +5 -0
- package/dist/api/types/BillingSubscriptionDiscount.js +5 -0
- package/dist/api/types/BillingSubscriptionDiscountView.js +5 -0
- package/dist/api/types/BillingSubscriptionResponseData.js +5 -0
- package/dist/api/types/BillingSubscriptionView.js +5 -0
- package/dist/api/types/ChangeSubscriptionInternalRequestBody.js +5 -0
- package/dist/api/types/ChangeSubscriptionRequestBody.js +5 -0
- package/dist/api/types/CheckFlagRequestBody.js +5 -0
- package/dist/api/types/CheckFlagResponseData.js +5 -0
- package/dist/api/types/CheckFlagsResponseData.js +5 -0
- package/dist/api/types/CheckoutDataResponseData.js +5 -0
- package/dist/api/types/CompanyCrmDealsResponseData.d.ts +11 -0
- package/dist/api/types/CompanyCrmDealsResponseData.js +5 -0
- package/dist/api/types/CompanyDetailResponseData.js +5 -0
- package/dist/api/types/CompanyEventPeriodMetricsResponseData.js +5 -0
- package/dist/api/types/CompanyMembershipDetailResponseData.js +5 -0
- package/dist/api/types/CompanyMembershipResponseData.js +5 -0
- package/dist/api/types/CompanyOverrideResponseData.js +5 -0
- package/dist/api/types/CompanyPlanDetailResponseData.js +5 -0
- package/dist/api/types/CompanyPlanWithBillingSubView.js +5 -0
- package/dist/api/types/CompanyResponseData.js +5 -0
- package/dist/api/types/CompanySubscriptionResponseData.js +5 -0
- package/dist/api/types/CompanyViewWithFeatureUsageResponseData.js +5 -0
- package/dist/api/types/CompatiblePlans.js +5 -0
- package/dist/api/types/CompatiblePlansResponseData.js +5 -0
- package/dist/api/types/ComponentCapabilities.js +5 -0
- package/dist/api/types/ComponentHydrateResponseData.js +5 -0
- package/dist/api/types/ComponentPreviewResponseData.js +5 -0
- package/dist/api/types/ComponentResponseData.js +5 -0
- package/dist/api/types/CountResponse.js +5 -0
- package/dist/api/types/CouponRequestBody.js +5 -0
- package/dist/api/types/CreateBillingPriceTierRequestBody.js +5 -0
- package/dist/api/types/CreateEntitlementReqCommon.js +5 -0
- package/dist/api/types/CreateEntitlementReqCommonMetricPeriod.js +12 -0
- package/dist/api/types/CreateEntitlementReqCommonMetricPeriodMonthReset.js +10 -0
- package/dist/api/types/CreateEntitlementReqCommonValueType.d.ts +11 -0
- package/dist/api/types/CreateEntitlementReqCommonValueType.js +13 -0
- package/dist/api/types/CreateEventRequestBody.js +5 -0
- package/dist/api/types/CreateEventRequestBodyEventType.d.ts +12 -0
- package/dist/api/types/CreateEventRequestBodyEventType.js +11 -0
- package/dist/api/types/CreateFlagRequestBody.js +5 -0
- package/dist/api/types/CreateOrUpdateConditionGroupRequestBody.js +5 -0
- package/dist/api/types/CreateOrUpdateConditionRequestBody.js +5 -0
- package/dist/api/types/CreateOrUpdateConditionRequestBodyConditionType.js +16 -0
- package/dist/api/types/CreateOrUpdateConditionRequestBodyMetricPeriod.js +12 -0
- package/dist/api/types/CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset.js +10 -0
- package/dist/api/types/CreateOrUpdateConditionRequestBodyOperator.js +16 -0
- package/dist/api/types/CreateOrUpdateFlagRequestBody.js +5 -0
- package/dist/api/types/CreateOrUpdateRuleRequestBody.js +5 -0
- package/dist/api/types/CreateOrUpdateRuleRequestBodyRuleType.js +14 -0
- package/dist/api/types/CreatePriceTierRequestBody.js +5 -0
- package/dist/api/types/CreditBundlePurchaseResponseData.js +5 -0
- package/dist/api/types/CrmDealLineItem.d.ts +18 -0
- package/dist/api/types/CrmDealLineItem.js +5 -0
- package/dist/api/types/CrmDealResponseData.d.ts +19 -0
- package/dist/api/types/CrmDealResponseData.js +5 -0
- package/dist/api/types/CrmLineItemResponseData.d.ts +14 -0
- package/dist/api/types/CrmLineItemResponseData.js +5 -0
- package/dist/api/types/CrmProductResponseData.d.ts +18 -0
- package/dist/api/types/CrmProductResponseData.js +5 -0
- package/dist/api/types/CustomPlanConfig.js +5 -0
- package/dist/api/types/CustomPlanViewConfigResponseData.js +5 -0
- package/dist/api/types/DataExportResponseData.js +5 -0
- package/dist/api/types/Decimal.d.ts +4 -0
- package/dist/api/types/Decimal.js +5 -0
- package/dist/api/types/DeleteResponse.js +5 -0
- package/dist/api/types/EntitlementTriggerConfig.js +5 -0
- package/dist/api/types/EntitlementsInPlan.js +5 -0
- package/dist/api/types/EntityKeyDefinitionResponseData.js +5 -0
- package/dist/api/types/EntityKeyDetailResponseData.js +5 -0
- package/dist/api/types/EntityKeyResponseData.js +5 -0
- package/dist/api/types/EntityTraitDefinitionResponseData.js +5 -0
- package/dist/api/types/EntityTraitDetailResponseData.js +5 -0
- package/dist/api/types/EntityTraitResponseData.js +5 -0
- package/dist/api/types/EntityTraitValue.js +5 -0
- package/dist/api/types/EnvironmentDetailResponseData.js +5 -0
- package/dist/api/types/EnvironmentResponseData.js +5 -0
- package/dist/api/types/EventBody.js +5 -0
- package/dist/api/types/EventBodyFlagCheck.js +5 -0
- package/dist/api/types/EventBodyIdentify.js +5 -0
- package/dist/api/types/EventBodyIdentifyCompany.js +5 -0
- package/dist/api/types/EventBodyTrack.js +5 -0
- package/dist/api/types/EventDetailResponseData.js +5 -0
- package/dist/api/types/EventResponseData.js +5 -0
- package/dist/api/types/EventSummaryResponseData.js +5 -0
- package/dist/api/types/FeatureCompanyResponseData.js +5 -0
- package/dist/api/types/FeatureCompanyResponseDataAllocationType.d.ts +13 -0
- package/dist/api/types/FeatureCompanyResponseDataAllocationType.js +12 -0
- package/dist/api/types/FeatureCompanyUserResponseData.js +5 -0
- package/dist/api/types/FeatureCompanyUserResponseDataAllocationType.d.ts +13 -0
- package/dist/api/types/FeatureCompanyUserResponseDataAllocationType.js +12 -0
- package/dist/api/types/FeatureDetailResponseData.js +5 -0
- package/dist/api/types/FeatureResponseData.js +5 -0
- package/dist/api/types/FeatureUsageDataResponseData.js +5 -0
- package/dist/api/types/FeatureUsageDetailResponseData.js +5 -0
- package/dist/api/types/FeatureUsageResponseData.js +5 -0
- package/dist/api/types/FeatureUsageResponseDataAllocationType.d.ts +13 -0
- package/dist/api/types/FeatureUsageResponseDataAllocationType.js +12 -0
- package/dist/api/types/FlagDetailResponseData.js +5 -0
- package/dist/api/types/FlagResponseData.js +5 -0
- package/dist/api/types/GenericPreviewObject.js +5 -0
- package/dist/api/types/InvoiceRequestBody.js +5 -0
- package/dist/api/types/InvoiceResponseData.js +5 -0
- package/dist/api/types/IssueTemporaryAccessTokenResponseData.js +5 -0
- package/dist/api/types/KeysRequestBody.js +5 -0
- package/dist/api/types/MeterRequestBody.js +5 -0
- package/dist/api/types/OrderedPlansInGroup.js +5 -0
- package/dist/api/types/PaginationFilter.d.ts +9 -0
- package/dist/api/types/PaginationFilter.js +5 -0
- package/dist/api/types/PaymentMethodRequestBody.js +5 -0
- package/dist/api/types/PaymentMethodResponseData.js +5 -0
- package/dist/api/types/PlanAudienceDetailResponseData.d.ts +21 -0
- package/dist/api/types/PlanAudienceDetailResponseData.js +5 -0
- package/dist/api/types/PlanAudienceResponseData.d.ts +15 -0
- package/dist/api/types/PlanAudienceResponseData.js +5 -0
- package/dist/api/types/PlanDetailResponseData.js +5 -0
- package/dist/api/types/PlanEntitlementResponseData.js +5 -0
- package/dist/api/types/PlanEntitlementsOrder.js +5 -0
- package/dist/api/types/PlanGroupDetailResponseData.js +5 -0
- package/dist/api/types/PlanGroupPlanDetailResponseData.js +5 -0
- package/dist/api/types/PlanGroupPlanEntitlementsOrder.js +5 -0
- package/dist/api/types/PlanGroupResponseData.js +5 -0
- package/dist/api/types/PlanResponseData.js +5 -0
- package/dist/api/types/PlanTraitResponseData.js +5 -0
- package/dist/api/types/PreviewObject.js +5 -0
- package/dist/api/types/PreviewObjectResponseData.js +5 -0
- package/dist/api/types/PreviewSubscriptionChangeResponseData.js +5 -0
- package/dist/api/types/PreviewSubscriptionFinanceResponseData.js +5 -0
- package/dist/api/types/PreviewSubscriptionUpcomingInvoiceLineItems.js +5 -0
- package/dist/api/types/QuickstartResp.js +5 -0
- package/dist/api/types/RawEventBatchResponseData.js +5 -0
- package/dist/api/types/RawEventResponseData.js +5 -0
- package/dist/api/types/RuleConditionDetailResponseData.js +5 -0
- package/dist/api/types/RuleConditionGroupDetailResponseData.js +5 -0
- package/dist/api/types/RuleConditionGroupResponseData.js +5 -0
- package/dist/api/types/RuleConditionResponseData.js +5 -0
- package/dist/api/types/RuleDetailResponseData.js +5 -0
- package/dist/api/types/RuleResponseData.js +5 -0
- package/dist/api/types/RulesDetailResponseData.js +5 -0
- package/dist/api/types/SegmentStatusResp.js +5 -0
- package/dist/api/types/StripeEmbedInfo.js +5 -0
- package/dist/api/types/TemporaryAccessTokenResponseData.js +5 -0
- package/dist/api/types/UpdateAddOnRequestBody.js +5 -0
- package/dist/api/types/UpdateCreditBundleRequestBody.js +5 -0
- package/dist/api/types/UpdateEntitlementReqCommon.js +5 -0
- package/dist/api/types/UpdateEntitlementReqCommonMetricPeriod.js +12 -0
- package/dist/api/types/UpdateEntitlementReqCommonMetricPeriodMonthReset.js +10 -0
- package/dist/api/types/UpdateEntitlementReqCommonValueType.d.ts +11 -0
- package/dist/api/types/UpdateEntitlementReqCommonValueType.js +13 -0
- package/dist/api/types/UpdatePayInAdvanceRequestBody.js +5 -0
- package/dist/api/types/UpdateRuleRequestBody.js +5 -0
- package/dist/api/types/UpsertCompanyRequestBody.js +5 -0
- package/dist/api/types/UpsertTraitRequestBody.js +5 -0
- package/dist/api/types/UpsertUserRequestBody.js +5 -0
- package/dist/api/types/UpsertUserSubRequestBody.js +5 -0
- package/dist/api/types/UsageBasedEntitlementRequestBody.js +5 -0
- package/dist/api/types/UsageBasedEntitlementRequestBodyPriceBehavior.d.ts +11 -0
- package/dist/api/types/UsageBasedEntitlementRequestBodyPriceBehavior.js +13 -0
- package/dist/api/types/UsageBasedEntitlementResponseData.js +5 -0
- package/dist/api/types/UserDetailResponseData.js +5 -0
- package/dist/api/types/UserResponseData.js +5 -0
- package/dist/api/types/WebhookEventDetailResponseData.js +5 -0
- package/dist/api/types/WebhookEventResponseData.js +5 -0
- package/dist/api/types/WebhookResponseData.js +5 -0
- package/dist/api/types/index.js +188 -0
- package/dist/cache.js +102 -0
- package/dist/core/fetcher/APIResponse.js +2 -0
- package/dist/core/fetcher/Fetcher.js +107 -0
- package/dist/core/fetcher/Headers.js +84 -0
- package/dist/core/fetcher/HttpResponsePromise.js +103 -0
- package/dist/core/fetcher/RawResponse.js +44 -0
- package/dist/core/fetcher/Supplier.js +22 -0
- package/dist/core/fetcher/createRequestUrl.js +12 -0
- package/dist/core/fetcher/custom.js +132 -0
- package/dist/core/fetcher/getFetchFn.js +68 -0
- package/dist/core/fetcher/getHeader.js +11 -0
- package/dist/core/fetcher/getRequestBody.js +23 -0
- package/dist/core/fetcher/getResponseBody.js +54 -0
- package/dist/core/fetcher/index.js +15 -0
- package/dist/core/fetcher/makeRequest.js +42 -0
- package/dist/core/fetcher/requestWithRetries.js +40 -0
- package/dist/core/fetcher/signals.js +36 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +126 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +59 -0
- package/dist/core/index.js +42 -0
- package/dist/core/json.js +24 -0
- package/dist/core/runtime/index.js +5 -0
- package/dist/core/runtime/runtime.js +103 -0
- package/dist/core/schemas/Schema.js +24 -0
- package/dist/core/schemas/builders/bigint/bigint.js +53 -0
- package/dist/core/schemas/builders/bigint/index.js +5 -0
- package/dist/core/schemas/builders/date/date.js +62 -0
- package/dist/core/schemas/builders/date/index.js +5 -0
- package/dist/core/schemas/builders/enum/enum.js +38 -0
- package/dist/core/schemas/builders/enum/index.js +5 -0
- package/dist/core/schemas/builders/index.js +30 -0
- package/dist/core/schemas/builders/lazy/index.js +7 -0
- package/dist/core/schemas/builders/lazy/lazy.js +24 -0
- package/dist/core/schemas/builders/lazy/lazyObject.js +11 -0
- package/dist/core/schemas/builders/list/index.js +5 -0
- package/dist/core/schemas/builders/list/list.js +54 -0
- package/dist/core/schemas/builders/literals/booleanLiteral.js +28 -0
- package/dist/core/schemas/builders/literals/index.js +7 -0
- package/dist/core/schemas/builders/literals/stringLiteral.js +28 -0
- package/dist/core/schemas/builders/object/index.js +11 -0
- package/dist/core/schemas/builders/object/object.js +261 -0
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.js +7 -0
- package/dist/core/schemas/builders/object/property.js +15 -0
- package/dist/core/schemas/builders/object/types.js +2 -0
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +53 -0
- package/dist/core/schemas/builders/object-like/index.js +6 -0
- package/dist/core/schemas/builders/object-like/types.js +2 -0
- package/dist/core/schemas/builders/primitives/any.js +6 -0
- package/dist/core/schemas/builders/primitives/boolean.js +25 -0
- package/dist/core/schemas/builders/primitives/index.js +13 -0
- package/dist/core/schemas/builders/primitives/number.js +25 -0
- package/dist/core/schemas/builders/primitives/string.js +25 -0
- package/dist/core/schemas/builders/primitives/unknown.js +6 -0
- package/dist/core/schemas/builders/record/index.js +5 -0
- package/dist/core/schemas/builders/record/record.js +93 -0
- package/dist/core/schemas/builders/record/types.js +2 -0
- package/dist/core/schemas/builders/schema-utils/JsonError.js +12 -0
- package/dist/core/schemas/builders/schema-utils/ParseError.js +12 -0
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +145 -0
- package/dist/core/schemas/builders/schema-utils/index.js +11 -0
- package/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.js +9 -0
- package/dist/core/schemas/builders/set/index.js +5 -0
- package/dist/core/schemas/builders/set/set.js +43 -0
- package/dist/core/schemas/builders/undiscriminated-union/index.js +5 -0
- package/dist/core/schemas/builders/undiscriminated-union/types.js +2 -0
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +39 -0
- package/dist/core/schemas/builders/union/discriminant.js +9 -0
- package/dist/core/schemas/builders/union/index.js +7 -0
- package/dist/core/schemas/builders/union/types.js +2 -0
- package/dist/core/schemas/builders/union/union.js +129 -0
- package/dist/core/schemas/index.js +17 -0
- package/dist/core/schemas/utils/MaybePromise.js +2 -0
- package/dist/core/schemas/utils/addQuestionMarksToNullableProperties.js +2 -0
- package/dist/core/schemas/utils/createIdentitySchemaCreator.js +15 -0
- package/dist/core/schemas/utils/entries.js +6 -0
- package/dist/core/schemas/utils/filterObject.js +13 -0
- package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +27 -0
- package/dist/core/schemas/utils/isPlainObject.js +17 -0
- package/dist/core/schemas/utils/keys.js +6 -0
- package/dist/core/schemas/utils/maybeSkipValidation.js +27 -0
- package/dist/core/schemas/utils/partition.js +15 -0
- package/dist/environments.js +9 -0
- package/dist/errors/SchematicError.js +30 -0
- package/dist/errors/SchematicTimeoutError.js +13 -0
- package/dist/errors/index.js +7 -0
- package/dist/events.js +118 -0
- package/dist/index.js +1 -1
- package/dist/logger.js +19 -0
- package/dist/main.js +1 -0
- package/dist/serialization/index.js +18 -0
- package/dist/serialization/resources/accesstokens/client/index.js +17 -0
- package/dist/serialization/resources/accesstokens/client/requests/IssueTemporaryAccessTokenRequestBody.js +44 -0
- package/dist/serialization/resources/accesstokens/client/requests/index.js +5 -0
- package/dist/serialization/resources/accesstokens/index.js +18 -0
- package/dist/serialization/resources/accesstokens/types/IssueTemporaryAccessTokenResponse.js +45 -0
- package/dist/serialization/resources/accesstokens/types/index.js +17 -0
- package/dist/serialization/resources/accounts/client/index.js +17 -0
- package/dist/serialization/resources/accounts/client/requests/CreateApiKeyRequestBody.js +45 -0
- package/dist/serialization/resources/accounts/client/requests/CreateEnvironmentRequestBody.js +45 -0
- package/dist/serialization/resources/accounts/client/requests/UpdateApiKeyRequestBody.js +44 -0
- package/dist/serialization/resources/accounts/client/requests/UpdateEnvironmentRequestBody.js +45 -0
- package/dist/serialization/resources/accounts/client/requests/index.js +11 -0
- package/dist/serialization/resources/accounts/index.js +18 -0
- package/dist/serialization/resources/accounts/types/CountApiKeysParams.js +46 -0
- package/dist/serialization/resources/accounts/types/CountApiKeysResponse.js +46 -0
- package/dist/serialization/resources/accounts/types/CountApiRequestsParams.js +47 -0
- package/dist/serialization/resources/accounts/types/CountApiRequestsResponse.js +46 -0
- package/dist/serialization/resources/accounts/types/CreateApiKeyResponse.js +45 -0
- package/dist/serialization/resources/accounts/types/CreateEnvironmentRequestBodyEnvironmentType.d.ts +10 -0
- package/dist/serialization/resources/accounts/types/CreateEnvironmentRequestBodyEnvironmentType.js +41 -0
- package/dist/serialization/resources/accounts/types/CreateEnvironmentResponse.js +45 -0
- package/dist/serialization/resources/accounts/types/DeleteApiKeyResponse.js +45 -0
- package/dist/serialization/resources/accounts/types/DeleteEnvironmentResponse.js +45 -0
- package/dist/serialization/resources/accounts/types/GetApiKeyResponse.js +45 -0
- package/dist/serialization/resources/accounts/types/GetApiRequestResponse.js +45 -0
- package/dist/serialization/resources/accounts/types/GetEnvironmentResponse.js +45 -0
- package/dist/serialization/resources/accounts/types/ListApiKeysParams.js +46 -0
- package/dist/serialization/resources/accounts/types/ListApiKeysResponse.js +46 -0
- package/dist/serialization/resources/accounts/types/ListApiRequestsParams.js +47 -0
- package/dist/serialization/resources/accounts/types/ListApiRequestsResponse.js +46 -0
- package/dist/serialization/resources/accounts/types/ListEnvironmentsParams.js +45 -0
- package/dist/serialization/resources/accounts/types/ListEnvironmentsResponse.js +46 -0
- package/dist/serialization/resources/accounts/types/QuickstartResponse.js +45 -0
- package/dist/serialization/resources/accounts/types/UpdateApiKeyResponse.js +45 -0
- package/dist/serialization/resources/accounts/types/UpdateEnvironmentRequestBodyEnvironmentType.d.ts +10 -0
- package/dist/serialization/resources/accounts/types/UpdateEnvironmentRequestBodyEnvironmentType.js +41 -0
- package/dist/serialization/resources/accounts/types/UpdateEnvironmentResponse.js +45 -0
- package/dist/serialization/resources/accounts/types/index.js +38 -0
- package/dist/serialization/resources/billing/client/index.js +17 -0
- package/dist/serialization/resources/billing/client/requests/CreateBillingCustomerRequestBody.js +49 -0
- package/dist/serialization/resources/billing/client/requests/CreateBillingPriceRequestBody.js +60 -0
- package/dist/serialization/resources/billing/client/requests/CreateBillingProductRequestBody.js +46 -0
- package/dist/serialization/resources/billing/client/requests/CreateBillingSubscriptionsRequestBody.d.ts +31 -0
- package/dist/serialization/resources/billing/client/requests/CreateBillingSubscriptionsRequestBody.js +62 -0
- package/dist/serialization/resources/billing/client/requests/CreateCouponRequestBody.js +51 -0
- package/dist/serialization/resources/billing/client/requests/CreateInvoiceRequestBody.js +54 -0
- package/dist/serialization/resources/billing/client/requests/CreateMeterRequestBody.js +46 -0
- package/dist/serialization/resources/billing/client/requests/CreatePaymentMethodRequestBody.js +54 -0
- package/dist/serialization/resources/billing/client/requests/index.js +19 -0
- package/dist/serialization/resources/billing/index.js +18 -0
- package/dist/serialization/resources/billing/types/CountBillingProductsParams.js +54 -0
- package/dist/serialization/resources/billing/types/CountBillingProductsRequestPriceUsageType.d.ts +10 -0
- package/dist/serialization/resources/billing/types/CountBillingProductsRequestPriceUsageType.js +41 -0
- package/dist/serialization/resources/billing/types/CountBillingProductsResponse.js +46 -0
- package/dist/serialization/resources/billing/types/CountBillingProductsResponseParamsPriceUsageType.d.ts +10 -0
- package/dist/serialization/resources/billing/types/CountBillingProductsResponseParamsPriceUsageType.js +41 -0
- package/dist/serialization/resources/billing/types/CountCustomersParams.js +48 -0
- package/dist/serialization/resources/billing/types/CountCustomersResponse.js +46 -0
- package/dist/serialization/resources/billing/types/CreateBillingPriceRequestBodyBillingScheme.d.ts +10 -0
- package/dist/serialization/resources/billing/types/CreateBillingPriceRequestBodyBillingScheme.js +41 -0
- package/dist/serialization/resources/billing/types/CreateBillingPriceRequestBodyTiersMode.d.ts +10 -0
- package/dist/serialization/resources/billing/types/CreateBillingPriceRequestBodyTiersMode.js +41 -0
- package/dist/serialization/resources/billing/types/CreateBillingPriceRequestBodyUsageType.d.ts +10 -0
- package/dist/serialization/resources/billing/types/CreateBillingPriceRequestBodyUsageType.js +41 -0
- package/dist/serialization/resources/billing/types/CreateBillingSubscriptionsRequestBodyTrialEndSetting.d.ts +10 -0
- package/dist/serialization/resources/billing/types/CreateBillingSubscriptionsRequestBodyTrialEndSetting.js +41 -0
- package/dist/serialization/resources/billing/types/DeleteBillingProductResponse.js +45 -0
- package/dist/serialization/resources/billing/types/DeleteProductPriceResponse.js +45 -0
- package/dist/serialization/resources/billing/types/ListBillingProductsParams.js +54 -0
- package/dist/serialization/resources/billing/types/ListBillingProductsRequestPriceUsageType.d.ts +10 -0
- package/dist/serialization/resources/billing/types/ListBillingProductsRequestPriceUsageType.js +41 -0
- package/dist/serialization/resources/billing/types/ListBillingProductsResponse.js +46 -0
- package/dist/serialization/resources/billing/types/ListBillingProductsResponseParamsPriceUsageType.d.ts +10 -0
- package/dist/serialization/resources/billing/types/ListBillingProductsResponseParamsPriceUsageType.js +41 -0
- package/dist/serialization/resources/billing/types/ListCouponsParams.js +46 -0
- package/dist/serialization/resources/billing/types/ListCouponsResponse.js +46 -0
- package/dist/serialization/resources/billing/types/ListCustomersWithSubscriptionsParams.js +48 -0
- package/dist/serialization/resources/billing/types/ListCustomersWithSubscriptionsResponse.js +46 -0
- package/dist/serialization/resources/billing/types/ListInvoicesParams.js +47 -0
- package/dist/serialization/resources/billing/types/ListInvoicesResponse.js +46 -0
- package/dist/serialization/resources/billing/types/ListMetersParams.js +45 -0
- package/dist/serialization/resources/billing/types/ListMetersResponse.js +46 -0
- package/dist/serialization/resources/billing/types/ListPaymentMethodsParams.js +46 -0
- package/dist/serialization/resources/billing/types/ListPaymentMethodsResponse.js +46 -0
- package/dist/serialization/resources/billing/types/ListProductPricesParams.d.ts +23 -0
- package/dist/serialization/resources/billing/types/ListProductPricesParams.js +54 -0
- package/dist/serialization/resources/billing/types/ListProductPricesRequestPriceUsageType.d.ts +10 -0
- package/dist/serialization/resources/billing/types/ListProductPricesRequestPriceUsageType.js +41 -0
- package/dist/serialization/resources/billing/types/ListProductPricesResponse.d.ts +15 -0
- package/dist/serialization/resources/billing/types/ListProductPricesResponse.js +46 -0
- package/dist/serialization/resources/billing/types/ListProductPricesResponseParamsPriceUsageType.d.ts +10 -0
- package/dist/serialization/resources/billing/types/ListProductPricesResponseParamsPriceUsageType.js +41 -0
- package/dist/serialization/resources/billing/types/SearchBillingPricesParams.d.ts +21 -0
- package/dist/serialization/resources/billing/types/SearchBillingPricesParams.js +52 -0
- package/dist/serialization/resources/billing/types/SearchBillingPricesRequestTiersMode.d.ts +10 -0
- package/dist/serialization/resources/billing/types/SearchBillingPricesRequestTiersMode.js +41 -0
- package/dist/serialization/resources/billing/types/SearchBillingPricesRequestUsageType.d.ts +10 -0
- package/dist/serialization/resources/billing/types/SearchBillingPricesRequestUsageType.js +41 -0
- package/dist/serialization/resources/billing/types/SearchBillingPricesResponse.d.ts +15 -0
- package/dist/serialization/resources/billing/types/SearchBillingPricesResponse.js +46 -0
- package/dist/serialization/resources/billing/types/SearchBillingPricesResponseParamsTiersMode.d.ts +10 -0
- package/dist/serialization/resources/billing/types/SearchBillingPricesResponseParamsTiersMode.js +41 -0
- package/dist/serialization/resources/billing/types/SearchBillingPricesResponseParamsUsageType.d.ts +10 -0
- package/dist/serialization/resources/billing/types/SearchBillingPricesResponseParamsUsageType.js +41 -0
- package/dist/serialization/resources/billing/types/UpsertBillingCouponResponse.js +45 -0
- package/dist/serialization/resources/billing/types/UpsertBillingCustomerResponse.js +45 -0
- package/dist/serialization/resources/billing/types/UpsertBillingMeterResponse.js +45 -0
- package/dist/serialization/resources/billing/types/UpsertBillingPriceResponse.js +45 -0
- package/dist/serialization/resources/billing/types/UpsertBillingProductResponse.js +45 -0
- package/dist/serialization/resources/billing/types/UpsertBillingSubscriptionResponse.js +45 -0
- package/dist/serialization/resources/billing/types/UpsertInvoiceResponse.js +45 -0
- package/dist/serialization/resources/billing/types/UpsertPaymentMethodResponse.js +45 -0
- package/dist/serialization/resources/billing/types/index.js +60 -0
- package/dist/serialization/resources/checkout/client/index.js +17 -0
- package/dist/serialization/resources/checkout/client/requests/CheckoutDataRequestBody.js +44 -0
- package/dist/serialization/resources/checkout/client/requests/UpdateTrialEndRequestBody.js +43 -0
- package/dist/serialization/resources/checkout/client/requests/index.js +7 -0
- package/dist/serialization/resources/checkout/index.js +18 -0
- package/dist/serialization/resources/checkout/types/CheckoutInternalResponse.js +45 -0
- package/dist/serialization/resources/checkout/types/GetCheckoutDataResponse.js +45 -0
- package/dist/serialization/resources/checkout/types/PreviewCheckoutInternalResponse.js +45 -0
- package/dist/serialization/resources/checkout/types/UpdateCustomerSubscriptionTrialEndResponse.js +45 -0
- package/dist/serialization/resources/checkout/types/index.js +20 -0
- package/dist/serialization/resources/companies/client/index.js +17 -0
- package/dist/serialization/resources/companies/client/requests/CreateEntityTraitDefinitionRequestBody.js +48 -0
- package/dist/serialization/resources/companies/client/requests/GetOrCreateCompanyMembershipRequestBody.js +44 -0
- package/dist/serialization/resources/companies/client/requests/UpdateEntityTraitDefinitionRequestBody.js +45 -0
- package/dist/serialization/resources/companies/client/requests/index.js +9 -0
- package/dist/serialization/resources/companies/index.js +18 -0
- package/dist/serialization/resources/companies/types/CountCompaniesForAdvancedFilterParams.js +57 -0
- package/dist/serialization/resources/companies/types/CountCompaniesForAdvancedFilterRequestSortOrderDirection.d.ts +10 -0
- package/dist/serialization/resources/companies/types/CountCompaniesForAdvancedFilterRequestSortOrderDirection.js +41 -0
- package/dist/serialization/resources/companies/types/CountCompaniesForAdvancedFilterResponse.js +46 -0
- package/dist/serialization/resources/companies/types/CountCompaniesForAdvancedFilterResponseParamsSortOrderDirection.d.ts +10 -0
- package/dist/serialization/resources/companies/types/CountCompaniesForAdvancedFilterResponseParamsSortOrderDirection.js +41 -0
- package/dist/serialization/resources/companies/types/CountCompaniesParams.js +50 -0
- package/dist/serialization/resources/companies/types/CountCompaniesResponse.js +46 -0
- package/dist/serialization/resources/companies/types/CountEntityKeyDefinitionsParams.js +48 -0
- package/dist/serialization/resources/companies/types/CountEntityKeyDefinitionsRequestEntityType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/CountEntityKeyDefinitionsRequestEntityType.js +41 -0
- package/dist/serialization/resources/companies/types/CountEntityKeyDefinitionsResponse.js +46 -0
- package/dist/serialization/resources/companies/types/CountEntityKeyDefinitionsResponseParamsEntityType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/CountEntityKeyDefinitionsResponseParamsEntityType.js +41 -0
- package/dist/serialization/resources/companies/types/CountEntityTraitDefinitionsParams.js +50 -0
- package/dist/serialization/resources/companies/types/CountEntityTraitDefinitionsRequestEntityType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/CountEntityTraitDefinitionsRequestEntityType.js +41 -0
- package/dist/serialization/resources/companies/types/CountEntityTraitDefinitionsRequestTraitType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/CountEntityTraitDefinitionsRequestTraitType.js +41 -0
- package/dist/serialization/resources/companies/types/CountEntityTraitDefinitionsResponse.js +46 -0
- package/dist/serialization/resources/companies/types/CountEntityTraitDefinitionsResponseParamsEntityType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/CountEntityTraitDefinitionsResponseParamsEntityType.js +41 -0
- package/dist/serialization/resources/companies/types/CountEntityTraitDefinitionsResponseParamsTraitType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/CountEntityTraitDefinitionsResponseParamsTraitType.js +41 -0
- package/dist/serialization/resources/companies/types/CountUsersParams.js +48 -0
- package/dist/serialization/resources/companies/types/CountUsersResponse.js +46 -0
- package/dist/serialization/resources/companies/types/CreateCompanyResponse.js +45 -0
- package/dist/serialization/resources/companies/types/CreateEntityTraitDefinitionRequestBodyEntityType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/CreateEntityTraitDefinitionRequestBodyEntityType.js +41 -0
- package/dist/serialization/resources/companies/types/CreateEntityTraitDefinitionRequestBodyTraitType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/CreateEntityTraitDefinitionRequestBodyTraitType.js +41 -0
- package/dist/serialization/resources/companies/types/CreateUserResponse.js +45 -0
- package/dist/serialization/resources/companies/types/DeleteCompanyByKeysResponse.js +45 -0
- package/dist/serialization/resources/companies/types/DeleteCompanyMembershipResponse.js +45 -0
- package/dist/serialization/resources/companies/types/DeleteCompanyResponse.js +45 -0
- package/dist/serialization/resources/companies/types/DeleteUserByKeysResponse.js +45 -0
- package/dist/serialization/resources/companies/types/DeleteUserResponse.js +45 -0
- package/dist/serialization/resources/companies/types/GetActiveCompanySubscriptionParams.js +46 -0
- package/dist/serialization/resources/companies/types/GetActiveCompanySubscriptionResponse.js +46 -0
- package/dist/serialization/resources/companies/types/GetActiveDealsParams.d.ts +15 -0
- package/dist/serialization/resources/companies/types/GetActiveDealsParams.js +46 -0
- package/dist/serialization/resources/companies/types/GetActiveDealsResponse.d.ts +15 -0
- package/dist/serialization/resources/companies/types/GetActiveDealsResponse.js +46 -0
- package/dist/serialization/resources/companies/types/GetCompanyResponse.js +45 -0
- package/dist/serialization/resources/companies/types/GetEntityTraitDefinitionResponse.js +45 -0
- package/dist/serialization/resources/companies/types/GetEntityTraitValuesParams.js +46 -0
- package/dist/serialization/resources/companies/types/GetEntityTraitValuesResponse.js +46 -0
- package/dist/serialization/resources/companies/types/GetOrCreateCompanyMembershipResponse.js +45 -0
- package/dist/serialization/resources/companies/types/GetOrCreateEntityTraitDefinitionResponse.js +45 -0
- package/dist/serialization/resources/companies/types/GetUserResponse.js +45 -0
- package/dist/serialization/resources/companies/types/ListCompaniesForAdvancedFilterParams.js +57 -0
- package/dist/serialization/resources/companies/types/ListCompaniesForAdvancedFilterRequestSortOrderDirection.d.ts +10 -0
- package/dist/serialization/resources/companies/types/ListCompaniesForAdvancedFilterRequestSortOrderDirection.js +41 -0
- package/dist/serialization/resources/companies/types/ListCompaniesForAdvancedFilterResponse.js +46 -0
- package/dist/serialization/resources/companies/types/ListCompaniesForAdvancedFilterResponseParamsSortOrderDirection.d.ts +10 -0
- package/dist/serialization/resources/companies/types/ListCompaniesForAdvancedFilterResponseParamsSortOrderDirection.js +41 -0
- package/dist/serialization/resources/companies/types/ListCompaniesParams.js +50 -0
- package/dist/serialization/resources/companies/types/ListCompaniesResponse.js +46 -0
- package/dist/serialization/resources/companies/types/ListCompanyMembershipsParams.js +46 -0
- package/dist/serialization/resources/companies/types/ListCompanyMembershipsResponse.js +46 -0
- package/dist/serialization/resources/companies/types/ListEntityKeyDefinitionsParams.js +48 -0
- package/dist/serialization/resources/companies/types/ListEntityKeyDefinitionsRequestEntityType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/ListEntityKeyDefinitionsRequestEntityType.js +41 -0
- package/dist/serialization/resources/companies/types/ListEntityKeyDefinitionsResponse.js +46 -0
- package/dist/serialization/resources/companies/types/ListEntityKeyDefinitionsResponseParamsEntityType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/ListEntityKeyDefinitionsResponseParamsEntityType.js +41 -0
- package/dist/serialization/resources/companies/types/ListEntityTraitDefinitionsParams.js +50 -0
- package/dist/serialization/resources/companies/types/ListEntityTraitDefinitionsRequestEntityType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/ListEntityTraitDefinitionsRequestEntityType.js +41 -0
- package/dist/serialization/resources/companies/types/ListEntityTraitDefinitionsRequestTraitType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/ListEntityTraitDefinitionsRequestTraitType.js +41 -0
- package/dist/serialization/resources/companies/types/ListEntityTraitDefinitionsResponse.js +46 -0
- package/dist/serialization/resources/companies/types/ListEntityTraitDefinitionsResponseParamsEntityType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/ListEntityTraitDefinitionsResponseParamsEntityType.js +41 -0
- package/dist/serialization/resources/companies/types/ListEntityTraitDefinitionsResponseParamsTraitType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/ListEntityTraitDefinitionsResponseParamsTraitType.js +41 -0
- package/dist/serialization/resources/companies/types/ListUsersParams.js +48 -0
- package/dist/serialization/resources/companies/types/ListUsersResponse.js +46 -0
- package/dist/serialization/resources/companies/types/LookupCompanyParams.js +43 -0
- package/dist/serialization/resources/companies/types/LookupCompanyResponse.js +46 -0
- package/dist/serialization/resources/companies/types/LookupUserParams.js +43 -0
- package/dist/serialization/resources/companies/types/LookupUserResponse.js +46 -0
- package/dist/serialization/resources/companies/types/UpdateEntityTraitDefinitionRequestBodyTraitType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/UpdateEntityTraitDefinitionRequestBodyTraitType.js +41 -0
- package/dist/serialization/resources/companies/types/UpdateEntityTraitDefinitionResponse.js +45 -0
- package/dist/serialization/resources/companies/types/UpsertCompanyResponse.js +45 -0
- package/dist/serialization/resources/companies/types/UpsertCompanyTraitResponse.js +45 -0
- package/dist/serialization/resources/companies/types/UpsertUserResponse.js +45 -0
- package/dist/serialization/resources/companies/types/UpsertUserTraitResponse.js +45 -0
- package/dist/serialization/resources/companies/types/index.js +84 -0
- package/dist/serialization/resources/components/client/index.js +17 -0
- package/dist/serialization/resources/components/client/requests/CreateComponentRequestBody.js +46 -0
- package/dist/serialization/resources/components/client/requests/UpdateComponentRequestBody.js +48 -0
- package/dist/serialization/resources/components/client/requests/index.js +7 -0
- package/dist/serialization/resources/components/index.js +18 -0
- package/dist/serialization/resources/components/types/CountComponentsParams.js +45 -0
- package/dist/serialization/resources/components/types/CountComponentsResponse.js +46 -0
- package/dist/serialization/resources/components/types/CreateComponentRequestBodyEntityType.d.ts +10 -0
- package/dist/serialization/resources/components/types/CreateComponentRequestBodyEntityType.js +41 -0
- package/dist/serialization/resources/components/types/CreateComponentResponse.js +45 -0
- package/dist/serialization/resources/components/types/DeleteComponentResponse.js +45 -0
- package/dist/serialization/resources/components/types/GetComponentResponse.js +45 -0
- package/dist/serialization/resources/components/types/ListComponentsParams.js +45 -0
- package/dist/serialization/resources/components/types/ListComponentsResponse.js +46 -0
- package/dist/serialization/resources/components/types/PreviewComponentDataParams.js +44 -0
- package/dist/serialization/resources/components/types/PreviewComponentDataResponse.js +46 -0
- package/dist/serialization/resources/components/types/UpdateComponentRequestBodyEntityType.d.ts +10 -0
- package/dist/serialization/resources/components/types/UpdateComponentRequestBodyEntityType.js +41 -0
- package/dist/serialization/resources/components/types/UpdateComponentRequestBodyState.d.ts +10 -0
- package/dist/serialization/resources/components/types/UpdateComponentRequestBodyState.js +41 -0
- package/dist/serialization/resources/components/types/UpdateComponentResponse.js +45 -0
- package/dist/serialization/resources/components/types/index.js +29 -0
- package/dist/serialization/resources/credits/client/index.js +17 -0
- package/dist/serialization/resources/credits/client/requests/CreateBillingCreditRequestBody.js +56 -0
- package/dist/serialization/resources/credits/client/requests/CreateBillingPlanCreditGrantRequestBody.d.ts +18 -0
- package/dist/serialization/resources/credits/client/requests/CreateBillingPlanCreditGrantRequestBody.js +49 -0
- package/dist/serialization/resources/credits/client/requests/CreateCreditBundleRequestBody.js +54 -0
- package/dist/serialization/resources/credits/client/requests/UpdateBillingCreditRequestBody.js +55 -0
- package/dist/serialization/resources/credits/client/requests/ZeroOutGrantRequestBody.js +44 -0
- package/dist/serialization/resources/credits/client/requests/index.js +13 -0
- package/dist/serialization/resources/credits/index.js +18 -0
- package/dist/serialization/resources/credits/types/CountBillingCreditsGrantsParams.js +46 -0
- package/dist/serialization/resources/credits/types/CountBillingCreditsGrantsResponse.js +46 -0
- package/dist/serialization/resources/credits/types/CountBillingCreditsParams.js +46 -0
- package/dist/serialization/resources/credits/types/CountBillingCreditsResponse.js +46 -0
- package/dist/serialization/resources/credits/types/CountBillingPlanCreditGrantsParams.js +47 -0
- package/dist/serialization/resources/credits/types/CountBillingPlanCreditGrantsResponse.js +46 -0
- package/dist/serialization/resources/credits/types/CountCreditBundlesParams.js +49 -0
- package/dist/serialization/resources/credits/types/CountCreditBundlesRequestStatus.d.ts +10 -0
- package/dist/serialization/resources/credits/types/CountCreditBundlesRequestStatus.js +41 -0
- package/dist/serialization/resources/credits/types/CountCreditBundlesResponse.js +46 -0
- package/dist/serialization/resources/credits/types/CountCreditBundlesResponseParamsStatus.d.ts +10 -0
- package/dist/serialization/resources/credits/types/CountCreditBundlesResponseParamsStatus.js +41 -0
- package/dist/serialization/resources/credits/types/CreateBillingCreditRequestBodyBurnStrategy.d.ts +10 -0
- package/dist/serialization/resources/credits/types/CreateBillingCreditRequestBodyBurnStrategy.js +46 -0
- package/dist/serialization/resources/credits/types/CreateBillingCreditRequestBodyDefaultRolloverPolicy.d.ts +10 -0
- package/dist/serialization/resources/credits/types/CreateBillingCreditRequestBodyDefaultRolloverPolicy.js +41 -0
- package/dist/serialization/resources/credits/types/CreateBillingCreditResponse.js +45 -0
- package/dist/serialization/resources/credits/types/CreateBillingPlanCreditGrantRequestBodyResetCadence.d.ts +10 -0
- package/dist/serialization/resources/credits/types/CreateBillingPlanCreditGrantRequestBodyResetCadence.js +41 -0
- package/dist/serialization/resources/credits/types/CreateBillingPlanCreditGrantRequestBodyResetStart.d.ts +10 -0
- package/dist/serialization/resources/credits/types/CreateBillingPlanCreditGrantRequestBodyResetStart.js +41 -0
- package/dist/serialization/resources/credits/types/CreateBillingPlanCreditGrantResponse.js +45 -0
- package/dist/serialization/resources/credits/types/CreateCreditBundleRequestBodyExpiryType.d.ts +10 -0
- package/dist/serialization/resources/credits/types/CreateCreditBundleRequestBodyExpiryType.js +41 -0
- package/dist/serialization/resources/credits/types/CreateCreditBundleRequestBodyStatus.d.ts +10 -0
- package/dist/serialization/resources/credits/types/CreateCreditBundleRequestBodyStatus.js +41 -0
- package/dist/serialization/resources/credits/types/CreateCreditBundleResponse.js +45 -0
- package/dist/serialization/resources/credits/types/DeleteBillingPlanCreditGrantResponse.js +45 -0
- package/dist/serialization/resources/credits/types/DeleteCreditBundleResponse.js +45 -0
- package/dist/serialization/resources/credits/types/GetCreditBundleResponse.js +45 -0
- package/dist/serialization/resources/credits/types/GetSingleBillingCreditResponse.js +45 -0
- package/dist/serialization/resources/credits/types/ListBillingCreditsParams.js +46 -0
- package/dist/serialization/resources/credits/types/ListBillingCreditsResponse.js +46 -0
- package/dist/serialization/resources/credits/types/ListBillingPlanCreditGrantsParams.js +47 -0
- package/dist/serialization/resources/credits/types/ListBillingPlanCreditGrantsResponse.js +46 -0
- package/dist/serialization/resources/credits/types/ListCompanyGrantsParams.js +49 -0
- package/dist/serialization/resources/credits/types/ListCompanyGrantsRequestDir.d.ts +10 -0
- package/dist/serialization/resources/credits/types/ListCompanyGrantsRequestDir.js +41 -0
- package/dist/serialization/resources/credits/types/ListCompanyGrantsRequestOrder.d.ts +10 -0
- package/dist/serialization/resources/credits/types/ListCompanyGrantsRequestOrder.js +41 -0
- package/dist/serialization/resources/credits/types/ListCompanyGrantsResponse.js +46 -0
- package/dist/serialization/resources/credits/types/ListCompanyGrantsResponseParamsDir.d.ts +10 -0
- package/dist/serialization/resources/credits/types/ListCompanyGrantsResponseParamsDir.js +41 -0
- package/dist/serialization/resources/credits/types/ListCompanyGrantsResponseParamsOrder.d.ts +10 -0
- package/dist/serialization/resources/credits/types/ListCompanyGrantsResponseParamsOrder.js +41 -0
- package/dist/serialization/resources/credits/types/ListCreditBundlesParams.js +49 -0
- package/dist/serialization/resources/credits/types/ListCreditBundlesRequestStatus.d.ts +10 -0
- package/dist/serialization/resources/credits/types/ListCreditBundlesRequestStatus.js +41 -0
- package/dist/serialization/resources/credits/types/ListCreditBundlesResponse.js +46 -0
- package/dist/serialization/resources/credits/types/ListCreditBundlesResponseParamsStatus.d.ts +10 -0
- package/dist/serialization/resources/credits/types/ListCreditBundlesResponseParamsStatus.js +41 -0
- package/dist/serialization/resources/credits/types/ListGrantsForCreditParams.js +46 -0
- package/dist/serialization/resources/credits/types/ListGrantsForCreditResponse.js +46 -0
- package/dist/serialization/resources/credits/types/UpdateBillingCreditRequestBodyBurnStrategy.d.ts +10 -0
- package/dist/serialization/resources/credits/types/UpdateBillingCreditRequestBodyBurnStrategy.js +46 -0
- package/dist/serialization/resources/credits/types/UpdateBillingCreditRequestBodyDefaultRolloverPolicy.d.ts +10 -0
- package/dist/serialization/resources/credits/types/UpdateBillingCreditRequestBodyDefaultRolloverPolicy.js +41 -0
- package/dist/serialization/resources/credits/types/UpdateBillingCreditResponse.js +45 -0
- package/dist/serialization/resources/credits/types/UpdateCreditBundleResponse.d.ts +14 -0
- package/dist/serialization/resources/credits/types/UpdateCreditBundleResponse.js +45 -0
- package/dist/serialization/resources/credits/types/ZeroOutGrantRequestBodyReason.d.ts +10 -0
- package/dist/serialization/resources/credits/types/ZeroOutGrantRequestBodyReason.js +41 -0
- package/dist/serialization/resources/credits/types/ZeroOutGrantResponse.js +45 -0
- package/dist/serialization/resources/credits/types/index.js +61 -0
- package/dist/serialization/resources/crm/client/index.d.ts +1 -0
- package/dist/serialization/resources/crm/client/index.js +17 -0
- package/dist/serialization/resources/crm/client/requests/CreateCrmDealLineItemAssociationRequestBody.d.ts +13 -0
- package/dist/serialization/resources/crm/client/requests/CreateCrmDealLineItemAssociationRequestBody.js +44 -0
- package/dist/serialization/resources/crm/client/requests/CreateCrmDealRequestBody.d.ts +20 -0
- package/dist/serialization/resources/crm/client/requests/CreateCrmDealRequestBody.js +51 -0
- package/dist/serialization/resources/crm/client/requests/CreateCrmLineItemRequestBody.d.ts +19 -0
- package/dist/serialization/resources/crm/client/requests/CreateCrmLineItemRequestBody.js +50 -0
- package/dist/serialization/resources/crm/client/requests/CreateCrmProductRequestBody.d.ts +19 -0
- package/dist/serialization/resources/crm/client/requests/CreateCrmProductRequestBody.js +50 -0
- package/dist/serialization/resources/crm/client/requests/index.d.ts +4 -0
- package/dist/serialization/resources/crm/client/requests/index.js +11 -0
- package/dist/serialization/resources/crm/index.d.ts +2 -0
- package/dist/serialization/resources/crm/index.js +18 -0
- package/dist/serialization/resources/crm/types/ListCrmProductsParams.d.ts +15 -0
- package/dist/serialization/resources/crm/types/ListCrmProductsParams.js +46 -0
- package/dist/serialization/resources/crm/types/ListCrmProductsResponse.d.ts +15 -0
- package/dist/serialization/resources/crm/types/ListCrmProductsResponse.js +46 -0
- package/dist/serialization/resources/crm/types/UpsertCrmDealResponse.d.ts +14 -0
- package/dist/serialization/resources/crm/types/UpsertCrmDealResponse.js +45 -0
- package/dist/serialization/resources/crm/types/UpsertCrmProductResponse.d.ts +14 -0
- package/dist/serialization/resources/crm/types/UpsertCrmProductResponse.js +45 -0
- package/dist/serialization/resources/crm/types/UpsertDealLineItemAssociationResponse.d.ts +14 -0
- package/dist/serialization/resources/crm/types/UpsertDealLineItemAssociationResponse.js +45 -0
- package/dist/serialization/resources/crm/types/UpsertLineItemResponse.d.ts +14 -0
- package/dist/serialization/resources/crm/types/UpsertLineItemResponse.js +45 -0
- package/dist/serialization/resources/crm/types/index.d.ts +6 -0
- package/dist/serialization/resources/crm/types/index.js +22 -0
- package/dist/serialization/resources/dataexports/client/index.js +17 -0
- package/dist/serialization/resources/dataexports/client/requests/CreateDataExportRequestBody.js +43 -0
- package/dist/serialization/resources/dataexports/client/requests/index.js +5 -0
- package/dist/serialization/resources/dataexports/index.js +18 -0
- package/dist/serialization/resources/dataexports/types/CreateDataExportResponse.js +45 -0
- package/dist/serialization/resources/dataexports/types/index.js +17 -0
- package/dist/serialization/resources/entitlements/client/index.js +17 -0
- package/dist/serialization/resources/entitlements/client/requests/CreateCompanyOverrideRequestBody.js +55 -0
- package/dist/serialization/resources/entitlements/client/requests/CreatePlanEntitlementRequestBody.js +69 -0
- package/dist/serialization/resources/entitlements/client/requests/UpdateCompanyOverrideRequestBody.js +53 -0
- package/dist/serialization/resources/entitlements/client/requests/UpdatePlanEntitlementRequestBody.js +67 -0
- package/dist/serialization/resources/entitlements/client/requests/index.js +11 -0
- package/dist/serialization/resources/entitlements/index.js +18 -0
- package/dist/serialization/resources/entitlements/types/CountCompanyOverridesParams.js +51 -0
- package/dist/serialization/resources/entitlements/types/CountCompanyOverridesResponse.js +46 -0
- package/dist/serialization/resources/entitlements/types/CountFeatureCompaniesParams.js +46 -0
- package/dist/serialization/resources/entitlements/types/CountFeatureCompaniesResponse.js +46 -0
- package/dist/serialization/resources/entitlements/types/CountFeatureUsageParams.js +49 -0
- package/dist/serialization/resources/entitlements/types/CountFeatureUsageResponse.js +46 -0
- package/dist/serialization/resources/entitlements/types/CountFeatureUsersParams.js +46 -0
- package/dist/serialization/resources/entitlements/types/CountFeatureUsersResponse.js +46 -0
- package/dist/serialization/resources/entitlements/types/CountPlanEntitlementsParams.js +51 -0
- package/dist/serialization/resources/entitlements/types/CountPlanEntitlementsResponse.js +46 -0
- package/dist/serialization/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriod.js +41 -0
- package/dist/serialization/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriodMonthReset.js +41 -0
- package/dist/serialization/resources/entitlements/types/CreateCompanyOverrideRequestBodyValueType.d.ts +10 -0
- package/dist/serialization/resources/entitlements/types/CreateCompanyOverrideRequestBodyValueType.js +41 -0
- package/dist/serialization/resources/entitlements/types/CreateCompanyOverrideResponse.js +45 -0
- package/dist/serialization/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriod.js +41 -0
- package/dist/serialization/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriodMonthReset.js +41 -0
- package/dist/serialization/resources/entitlements/types/CreatePlanEntitlementRequestBodyPriceBehavior.d.ts +10 -0
- package/dist/serialization/resources/entitlements/types/CreatePlanEntitlementRequestBodyPriceBehavior.js +41 -0
- package/dist/serialization/resources/entitlements/types/CreatePlanEntitlementRequestBodyValueType.d.ts +10 -0
- package/dist/serialization/resources/entitlements/types/CreatePlanEntitlementRequestBodyValueType.js +41 -0
- package/dist/serialization/resources/entitlements/types/CreatePlanEntitlementResponse.js +45 -0
- package/dist/serialization/resources/entitlements/types/DeleteCompanyOverrideResponse.js +45 -0
- package/dist/serialization/resources/entitlements/types/DeletePlanEntitlementResponse.js +45 -0
- package/dist/serialization/resources/entitlements/types/GetCompanyOverrideResponse.js +45 -0
- package/dist/serialization/resources/entitlements/types/GetFeatureUsageByCompanyParams.js +43 -0
- package/dist/serialization/resources/entitlements/types/GetFeatureUsageByCompanyResponse.js +46 -0
- package/dist/serialization/resources/entitlements/types/GetPlanEntitlementResponse.js +45 -0
- package/dist/serialization/resources/entitlements/types/ListCompanyOverridesParams.js +51 -0
- package/dist/serialization/resources/entitlements/types/ListCompanyOverridesResponse.js +46 -0
- package/dist/serialization/resources/entitlements/types/ListFeatureCompaniesParams.js +46 -0
- package/dist/serialization/resources/entitlements/types/ListFeatureCompaniesResponse.js +46 -0
- package/dist/serialization/resources/entitlements/types/ListFeatureUsageParams.js +49 -0
- package/dist/serialization/resources/entitlements/types/ListFeatureUsageResponse.js +46 -0
- package/dist/serialization/resources/entitlements/types/ListFeatureUsersParams.js +46 -0
- package/dist/serialization/resources/entitlements/types/ListFeatureUsersResponse.js +46 -0
- package/dist/serialization/resources/entitlements/types/ListPlanEntitlementsParams.js +51 -0
- package/dist/serialization/resources/entitlements/types/ListPlanEntitlementsResponse.js +46 -0
- package/dist/serialization/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriod.js +41 -0
- package/dist/serialization/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset.js +41 -0
- package/dist/serialization/resources/entitlements/types/UpdateCompanyOverrideRequestBodyValueType.d.ts +10 -0
- package/dist/serialization/resources/entitlements/types/UpdateCompanyOverrideRequestBodyValueType.js +41 -0
- package/dist/serialization/resources/entitlements/types/UpdateCompanyOverrideResponse.js +45 -0
- package/dist/serialization/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriod.js +41 -0
- package/dist/serialization/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset.js +41 -0
- package/dist/serialization/resources/entitlements/types/UpdatePlanEntitlementRequestBodyPriceBehavior.d.ts +10 -0
- package/dist/serialization/resources/entitlements/types/UpdatePlanEntitlementRequestBodyPriceBehavior.js +41 -0
- package/dist/serialization/resources/entitlements/types/UpdatePlanEntitlementRequestBodyValueType.d.ts +10 -0
- package/dist/serialization/resources/entitlements/types/UpdatePlanEntitlementRequestBodyValueType.js +41 -0
- package/dist/serialization/resources/entitlements/types/UpdatePlanEntitlementResponse.js +45 -0
- package/dist/serialization/resources/entitlements/types/index.js +60 -0
- package/dist/serialization/resources/events/client/index.js +17 -0
- package/dist/serialization/resources/events/client/requests/CreateEventBatchRequestBody.js +44 -0
- package/dist/serialization/resources/events/client/requests/index.js +5 -0
- package/dist/serialization/resources/events/index.js +18 -0
- package/dist/serialization/resources/events/types/CreateEventBatchResponse.js +45 -0
- package/dist/serialization/resources/events/types/CreateEventResponse.js +45 -0
- package/dist/serialization/resources/events/types/GetEventResponse.js +45 -0
- package/dist/serialization/resources/events/types/GetEventSummariesParams.js +46 -0
- package/dist/serialization/resources/events/types/GetEventSummariesResponse.js +46 -0
- package/dist/serialization/resources/events/types/GetSegmentIntegrationStatusResponse.js +45 -0
- package/dist/serialization/resources/events/types/ListEventsParams.js +50 -0
- package/dist/serialization/resources/events/types/ListEventsRequestEventTypesItem.d.ts +10 -0
- package/dist/serialization/resources/events/types/ListEventsRequestEventTypesItem.js +41 -0
- package/dist/serialization/resources/events/types/ListEventsResponse.js +46 -0
- package/dist/serialization/resources/events/types/ListEventsResponseParamsEventTypesItem.d.ts +10 -0
- package/dist/serialization/resources/events/types/ListEventsResponseParamsEventTypesItem.js +41 -0
- package/dist/serialization/resources/events/types/index.js +26 -0
- package/dist/serialization/resources/features/client/index.js +17 -0
- package/dist/serialization/resources/features/client/requests/CreateFeatureRequestBody.js +56 -0
- package/dist/serialization/resources/features/client/requests/UpdateFeatureRequestBody.js +56 -0
- package/dist/serialization/resources/features/client/requests/UpdateFlagRulesRequestBody.js +44 -0
- package/dist/serialization/resources/features/client/requests/index.js +9 -0
- package/dist/serialization/resources/features/index.js +18 -0
- package/dist/serialization/resources/features/types/CheckFlagResponse.js +45 -0
- package/dist/serialization/resources/features/types/CheckFlagsResponse.js +45 -0
- package/dist/serialization/resources/features/types/CountAudienceCompaniesResponse.d.ts +14 -0
- package/dist/serialization/resources/features/types/CountAudienceCompaniesResponse.js +45 -0
- package/dist/serialization/resources/features/types/CountAudienceUsersResponse.d.ts +14 -0
- package/dist/serialization/resources/features/types/CountAudienceUsersResponse.js +45 -0
- package/dist/serialization/resources/features/types/CountFeaturesParams.js +50 -0
- package/dist/serialization/resources/features/types/CountFeaturesResponse.js +46 -0
- package/dist/serialization/resources/features/types/CountFlagsParams.js +47 -0
- package/dist/serialization/resources/features/types/CountFlagsResponse.js +46 -0
- package/dist/serialization/resources/features/types/CreateFeatureRequestBodyFeatureType.d.ts +10 -0
- package/dist/serialization/resources/features/types/CreateFeatureRequestBodyFeatureType.js +41 -0
- package/dist/serialization/resources/features/types/CreateFeatureRequestBodyLifecyclePhase.d.ts +10 -0
- package/dist/serialization/resources/features/types/CreateFeatureRequestBodyLifecyclePhase.js +51 -0
- package/dist/serialization/resources/features/types/CreateFeatureResponse.js +45 -0
- package/dist/serialization/resources/features/types/CreateFlagResponse.js +45 -0
- package/dist/serialization/resources/features/types/DeleteFeatureResponse.js +45 -0
- package/dist/serialization/resources/features/types/DeleteFlagResponse.js +45 -0
- package/dist/serialization/resources/features/types/GetFeatureResponse.js +45 -0
- package/dist/serialization/resources/features/types/GetFlagResponse.js +45 -0
- package/dist/serialization/resources/features/types/ListAudienceCompaniesResponse.d.ts +14 -0
- package/dist/serialization/resources/features/types/ListAudienceCompaniesResponse.js +45 -0
- package/dist/serialization/resources/features/types/ListAudienceUsersResponse.d.ts +14 -0
- package/dist/serialization/resources/features/types/ListAudienceUsersResponse.js +45 -0
- package/dist/serialization/resources/features/types/ListFeaturesParams.js +50 -0
- package/dist/serialization/resources/features/types/ListFeaturesResponse.js +46 -0
- package/dist/serialization/resources/features/types/ListFlagsParams.js +47 -0
- package/dist/serialization/resources/features/types/ListFlagsResponse.js +46 -0
- package/dist/serialization/resources/features/types/UpdateFeatureRequestBodyFeatureType.d.ts +10 -0
- package/dist/serialization/resources/features/types/UpdateFeatureRequestBodyFeatureType.js +41 -0
- package/dist/serialization/resources/features/types/UpdateFeatureRequestBodyLifecyclePhase.d.ts +10 -0
- package/dist/serialization/resources/features/types/UpdateFeatureRequestBodyLifecyclePhase.js +51 -0
- package/dist/serialization/resources/features/types/UpdateFeatureResponse.js +45 -0
- package/dist/serialization/resources/features/types/UpdateFlagResponse.js +45 -0
- package/dist/serialization/resources/features/types/UpdateFlagRulesResponse.js +45 -0
- package/dist/serialization/resources/features/types/index.js +43 -0
- package/dist/serialization/resources/index.js +84 -0
- package/dist/serialization/resources/plangroups/client/index.js +17 -0
- package/dist/serialization/resources/plangroups/client/requests/CreatePlanGroupRequestBody.js +53 -0
- package/dist/serialization/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.js +53 -0
- package/dist/serialization/resources/plangroups/client/requests/index.js +7 -0
- package/dist/serialization/resources/plangroups/index.js +18 -0
- package/dist/serialization/resources/plangroups/types/CreatePlanGroupResponse.js +45 -0
- package/dist/serialization/resources/plangroups/types/GetPlanGroupResponse.js +45 -0
- package/dist/serialization/resources/plangroups/types/UpdatePlanGroupResponse.js +45 -0
- package/dist/serialization/resources/plangroups/types/index.js +19 -0
- package/dist/serialization/resources/plans/client/index.js +17 -0
- package/dist/serialization/resources/plans/client/requests/CreatePlanRequestBody.d.ts +16 -0
- package/dist/serialization/resources/plans/client/requests/CreatePlanRequestBody.js +47 -0
- package/dist/serialization/resources/plans/client/requests/CreatePlanTraitRequestBody.d.ts +14 -0
- package/dist/serialization/resources/plans/client/requests/CreatePlanTraitRequestBody.js +45 -0
- package/dist/serialization/resources/plans/client/requests/UpdateAudienceRequestBody.d.ts +15 -0
- package/dist/serialization/resources/plans/client/requests/UpdateAudienceRequestBody.js +46 -0
- package/dist/serialization/resources/plans/client/requests/UpdateCompanyPlansRequestBody.js +44 -0
- package/dist/serialization/resources/plans/client/requests/UpdatePlanRequestBody.d.ts +14 -0
- package/dist/serialization/resources/plans/client/requests/UpdatePlanRequestBody.js +45 -0
- package/dist/serialization/resources/plans/client/requests/UpdatePlanTraitRequestBody.d.ts +13 -0
- package/dist/serialization/resources/plans/client/requests/UpdatePlanTraitRequestBody.js +44 -0
- package/dist/serialization/resources/plans/client/requests/UpsertBillingProductRequestBody.d.ts +23 -0
- package/dist/serialization/resources/plans/client/requests/UpsertBillingProductRequestBody.js +54 -0
- package/dist/serialization/resources/plans/client/requests/index.js +17 -0
- package/dist/serialization/resources/plans/index.js +18 -0
- package/dist/serialization/resources/plans/types/CountPlanTraitsParams.d.ts +16 -0
- package/dist/serialization/resources/plans/types/CountPlanTraitsParams.js +47 -0
- package/dist/serialization/resources/plans/types/CountPlanTraitsResponse.d.ts +15 -0
- package/dist/serialization/resources/plans/types/CountPlanTraitsResponse.js +46 -0
- package/dist/serialization/resources/plans/types/CountPlansParams.js +53 -0
- package/dist/serialization/resources/plans/types/CountPlansRequestPlanType.d.ts +10 -0
- package/dist/serialization/resources/plans/types/CountPlansRequestPlanType.js +41 -0
- package/dist/serialization/resources/plans/types/CountPlansResponse.js +46 -0
- package/dist/serialization/resources/plans/types/CountPlansResponseParamsPlanType.d.ts +10 -0
- package/dist/serialization/resources/plans/types/CountPlansResponseParamsPlanType.js +41 -0
- package/dist/serialization/resources/plans/types/CreatePlanRequestBodyPlanType.d.ts +10 -0
- package/dist/serialization/resources/plans/types/CreatePlanRequestBodyPlanType.js +41 -0
- package/dist/serialization/resources/plans/types/CreatePlanResponse.js +45 -0
- package/dist/serialization/resources/plans/types/CreatePlanTraitResponse.d.ts +14 -0
- package/dist/serialization/resources/plans/types/CreatePlanTraitResponse.js +45 -0
- package/dist/serialization/resources/plans/types/DeleteAudienceResponse.d.ts +14 -0
- package/dist/serialization/resources/plans/types/DeleteAudienceResponse.js +45 -0
- package/dist/serialization/resources/plans/types/DeletePlanResponse.js +45 -0
- package/dist/serialization/resources/plans/types/DeletePlanTraitResponse.d.ts +14 -0
- package/dist/serialization/resources/plans/types/DeletePlanTraitResponse.js +45 -0
- package/dist/serialization/resources/plans/types/GetAudienceResponse.d.ts +14 -0
- package/dist/serialization/resources/plans/types/GetAudienceResponse.js +45 -0
- package/dist/serialization/resources/plans/types/GetPlanResponse.js +45 -0
- package/dist/serialization/resources/plans/types/GetPlanTraitResponse.d.ts +14 -0
- package/dist/serialization/resources/plans/types/GetPlanTraitResponse.js +45 -0
- package/dist/serialization/resources/plans/types/ListPlanTraitsParams.d.ts +16 -0
- package/dist/serialization/resources/plans/types/ListPlanTraitsParams.js +47 -0
- package/dist/serialization/resources/plans/types/ListPlanTraitsResponse.d.ts +15 -0
- package/dist/serialization/resources/plans/types/ListPlanTraitsResponse.js +46 -0
- package/dist/serialization/resources/plans/types/ListPlansParams.js +53 -0
- package/dist/serialization/resources/plans/types/ListPlansRequestPlanType.d.ts +10 -0
- package/dist/serialization/resources/plans/types/ListPlansRequestPlanType.js +41 -0
- package/dist/serialization/resources/plans/types/ListPlansResponse.js +46 -0
- package/dist/serialization/resources/plans/types/ListPlansResponseParamsPlanType.d.ts +10 -0
- package/dist/serialization/resources/plans/types/ListPlansResponseParamsPlanType.js +41 -0
- package/dist/serialization/resources/plans/types/UpdateAudienceResponse.d.ts +14 -0
- package/dist/serialization/resources/plans/types/UpdateAudienceResponse.js +45 -0
- package/dist/serialization/resources/plans/types/UpdateCompanyPlansResponse.js +45 -0
- package/dist/serialization/resources/plans/types/UpdatePlanResponse.js +45 -0
- package/dist/serialization/resources/plans/types/UpdatePlanTraitResponse.d.ts +14 -0
- package/dist/serialization/resources/plans/types/UpdatePlanTraitResponse.js +45 -0
- package/dist/serialization/resources/plans/types/UpsertBillingProductPlanResponse.js +45 -0
- package/dist/serialization/resources/plans/types/UpsertBillingProductRequestBodyChargeType.d.ts +10 -0
- package/dist/serialization/resources/plans/types/UpsertBillingProductRequestBodyChargeType.js +41 -0
- package/dist/serialization/resources/plans/types/index.js +43 -0
- package/dist/serialization/resources/webhooks/client/index.js +17 -0
- package/dist/serialization/resources/webhooks/client/requests/CreateWebhookRequestBody.js +48 -0
- package/dist/serialization/resources/webhooks/client/requests/UpdateWebhookRequestBody.js +50 -0
- package/dist/serialization/resources/webhooks/client/requests/index.js +7 -0
- package/dist/serialization/resources/webhooks/index.js +18 -0
- package/dist/serialization/resources/webhooks/types/CountWebhookEventsParams.js +47 -0
- package/dist/serialization/resources/webhooks/types/CountWebhookEventsResponse.js +46 -0
- package/dist/serialization/resources/webhooks/types/CountWebhooksParams.js +45 -0
- package/dist/serialization/resources/webhooks/types/CountWebhooksResponse.js +46 -0
- package/dist/serialization/resources/webhooks/types/CreateWebhookRequestBodyRequestTypesItem.d.ts +10 -0
- package/dist/serialization/resources/webhooks/types/CreateWebhookRequestBodyRequestTypesItem.js +70 -0
- package/dist/serialization/resources/webhooks/types/CreateWebhookResponse.js +45 -0
- package/dist/serialization/resources/webhooks/types/DeleteWebhookResponse.js +45 -0
- package/dist/serialization/resources/webhooks/types/GetWebhookEventResponse.js +45 -0
- package/dist/serialization/resources/webhooks/types/GetWebhookResponse.js +45 -0
- package/dist/serialization/resources/webhooks/types/ListWebhookEventsParams.js +47 -0
- package/dist/serialization/resources/webhooks/types/ListWebhookEventsResponse.js +46 -0
- package/dist/serialization/resources/webhooks/types/ListWebhooksParams.js +45 -0
- package/dist/serialization/resources/webhooks/types/ListWebhooksResponse.js +46 -0
- package/dist/serialization/resources/webhooks/types/UpdateWebhookRequestBodyRequestTypesItem.d.ts +10 -0
- package/dist/serialization/resources/webhooks/types/UpdateWebhookRequestBodyRequestTypesItem.js +70 -0
- package/dist/serialization/resources/webhooks/types/UpdateWebhookRequestBodyStatus.d.ts +10 -0
- package/dist/serialization/resources/webhooks/types/UpdateWebhookRequestBodyStatus.js +41 -0
- package/dist/serialization/resources/webhooks/types/UpdateWebhookResponse.js +45 -0
- package/dist/serialization/resources/webhooks/types/index.js +32 -0
- package/dist/serialization/types/ApiError.js +43 -0
- package/dist/serialization/types/ApiKeyCreateResponseData.js +51 -0
- package/dist/serialization/types/ApiKeyRequestListResponseData.js +58 -0
- package/dist/serialization/types/ApiKeyRequestResponseData.js +61 -0
- package/dist/serialization/types/ApiKeyResponseData.js +50 -0
- package/dist/serialization/types/AudienceRequestBody.d.ts +18 -0
- package/dist/serialization/types/AudienceRequestBody.js +49 -0
- package/dist/serialization/types/BillingCouponResponseData.js +58 -0
- package/dist/serialization/types/BillingCreditBundleResponseData.js +55 -0
- package/dist/serialization/types/BillingCreditGrantResponseData.js +60 -0
- package/dist/serialization/types/BillingCreditResponseData.js +59 -0
- package/dist/serialization/types/BillingCustomerResponseData.js +50 -0
- package/dist/serialization/types/BillingCustomerSubscription.js +48 -0
- package/dist/serialization/types/BillingCustomerWithSubscriptionsResponseData.js +52 -0
- package/dist/serialization/types/BillingMeterResponseData.js +47 -0
- package/dist/serialization/types/BillingPlanCreditGrantResponseData.js +51 -0
- package/dist/serialization/types/BillingPriceResponseData.js +49 -0
- package/dist/serialization/types/BillingPriceView.js +64 -0
- package/dist/serialization/types/BillingProductDetailResponseData.js +57 -0
- package/dist/serialization/types/BillingProductForSubscriptionResponseData.js +62 -0
- package/dist/serialization/types/BillingProductPlanResponseData.js +53 -0
- package/dist/serialization/types/BillingProductPriceResponseData.js +57 -0
- package/dist/serialization/types/BillingProductPriceTierResponseData.js +46 -0
- package/dist/serialization/types/BillingProductPricing.js +53 -0
- package/dist/serialization/types/BillingProductPricingUsageType.d.ts +10 -0
- package/dist/serialization/types/BillingProductPricingUsageType.js +41 -0
- package/dist/serialization/types/BillingProductResponseData.js +54 -0
- package/dist/serialization/types/BillingSubscriptionDiscount.js +49 -0
- package/dist/serialization/types/BillingSubscriptionDiscountView.js +56 -0
- package/dist/serialization/types/BillingSubscriptionResponseData.js +60 -0
- package/dist/serialization/types/BillingSubscriptionView.js +68 -0
- package/dist/serialization/types/ChangeSubscriptionInternalRequestBody.js +55 -0
- package/dist/serialization/types/ChangeSubscriptionRequestBody.js +54 -0
- package/dist/serialization/types/CheckFlagRequestBody.js +44 -0
- package/dist/serialization/types/CheckFlagResponseData.js +56 -0
- package/dist/serialization/types/CheckFlagsResponseData.js +44 -0
- package/dist/serialization/types/CheckoutDataResponseData.js +59 -0
- package/dist/serialization/types/CompanyCrmDealsResponseData.d.ts +17 -0
- package/dist/serialization/types/CompanyCrmDealsResponseData.js +48 -0
- package/dist/serialization/types/CompanyDetailResponseData.js +68 -0
- package/dist/serialization/types/CompanyEventPeriodMetricsResponseData.js +53 -0
- package/dist/serialization/types/CompanyMembershipDetailResponseData.js +49 -0
- package/dist/serialization/types/CompanyMembershipResponseData.js +47 -0
- package/dist/serialization/types/CompanyOverrideResponseData.js +64 -0
- package/dist/serialization/types/CompanyPlanDetailResponseData.js +75 -0
- package/dist/serialization/types/CompanyPlanWithBillingSubView.js +51 -0
- package/dist/serialization/types/CompanyResponseData.js +49 -0
- package/dist/serialization/types/CompanySubscriptionResponseData.js +60 -0
- package/dist/serialization/types/CompanyViewWithFeatureUsageResponseData.js +70 -0
- package/dist/serialization/types/CompatiblePlans.js +44 -0
- package/dist/serialization/types/CompatiblePlansResponseData.js +44 -0
- package/dist/serialization/types/ComponentCapabilities.js +44 -0
- package/dist/serialization/types/ComponentHydrateResponseData.js +66 -0
- package/dist/serialization/types/ComponentPreviewResponseData.js +67 -0
- package/dist/serialization/types/ComponentResponseData.js +49 -0
- package/dist/serialization/types/CountResponse.js +43 -0
- package/dist/serialization/types/CouponRequestBody.js +50 -0
- package/dist/serialization/types/CreateBillingPriceTierRequestBody.js +47 -0
- package/dist/serialization/types/CreateEntitlementReqCommon.js +53 -0
- package/dist/serialization/types/CreateEntitlementReqCommonMetricPeriod.js +41 -0
- package/dist/serialization/types/CreateEntitlementReqCommonMetricPeriodMonthReset.js +41 -0
- package/dist/serialization/types/CreateEntitlementReqCommonValueType.d.ts +10 -0
- package/dist/serialization/types/CreateEntitlementReqCommonValueType.js +41 -0
- package/dist/serialization/types/CreateEventRequestBody.js +47 -0
- package/dist/serialization/types/CreateEventRequestBodyEventType.d.ts +10 -0
- package/dist/serialization/types/CreateEventRequestBodyEventType.js +41 -0
- package/dist/serialization/types/CreateFlagRequestBody.js +49 -0
- package/dist/serialization/types/CreateOrUpdateConditionGroupRequestBody.js +47 -0
- package/dist/serialization/types/CreateOrUpdateConditionRequestBody.js +57 -0
- package/dist/serialization/types/CreateOrUpdateConditionRequestBodyConditionType.js +50 -0
- package/dist/serialization/types/CreateOrUpdateConditionRequestBodyMetricPeriod.js +41 -0
- package/dist/serialization/types/CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset.js +41 -0
- package/dist/serialization/types/CreateOrUpdateConditionRequestBodyOperator.js +41 -0
- package/dist/serialization/types/CreateOrUpdateFlagRequestBody.js +50 -0
- package/dist/serialization/types/CreateOrUpdateRuleRequestBody.js +52 -0
- package/dist/serialization/types/CreateOrUpdateRuleRequestBodyRuleType.js +48 -0
- package/dist/serialization/types/CreatePriceTierRequestBody.js +46 -0
- package/dist/serialization/types/CreditBundlePurchaseResponseData.js +46 -0
- package/dist/serialization/types/CrmDealLineItem.d.ts +24 -0
- package/dist/serialization/types/CrmDealLineItem.js +55 -0
- package/dist/serialization/types/CrmDealResponseData.d.ts +22 -0
- package/dist/serialization/types/CrmDealResponseData.js +53 -0
- package/dist/serialization/types/CrmLineItemResponseData.d.ts +17 -0
- package/dist/serialization/types/CrmLineItemResponseData.js +48 -0
- package/dist/serialization/types/CrmProductResponseData.d.ts +21 -0
- package/dist/serialization/types/CrmProductResponseData.js +52 -0
- package/dist/serialization/types/CustomPlanConfig.js +45 -0
- package/dist/serialization/types/CustomPlanViewConfigResponseData.js +45 -0
- package/dist/serialization/types/DataExportResponseData.js +51 -0
- package/dist/serialization/types/Decimal.d.ts +10 -0
- package/dist/serialization/types/Decimal.js +41 -0
- package/dist/serialization/types/DeleteResponse.js +43 -0
- package/dist/serialization/types/EntitlementTriggerConfig.js +43 -0
- package/dist/serialization/types/EntitlementsInPlan.js +44 -0
- package/dist/serialization/types/EntityKeyDefinitionResponseData.js +47 -0
- package/dist/serialization/types/EntityKeyDetailResponseData.js +53 -0
- package/dist/serialization/types/EntityKeyResponseData.js +51 -0
- package/dist/serialization/types/EntityTraitDefinitionResponseData.js +49 -0
- package/dist/serialization/types/EntityTraitDetailResponseData.js +50 -0
- package/dist/serialization/types/EntityTraitResponseData.js +48 -0
- package/dist/serialization/types/EntityTraitValue.js +44 -0
- package/dist/serialization/types/EnvironmentDetailResponseData.js +49 -0
- package/dist/serialization/types/EnvironmentResponseData.js +47 -0
- package/dist/serialization/types/EventBody.js +44 -0
- package/dist/serialization/types/EventBodyFlagCheck.js +52 -0
- package/dist/serialization/types/EventBodyIdentify.js +47 -0
- package/dist/serialization/types/EventBodyIdentifyCompany.js +45 -0
- package/dist/serialization/types/EventBodyTrack.js +47 -0
- package/dist/serialization/types/EventDetailResponseData.js +65 -0
- package/dist/serialization/types/EventResponseData.js +61 -0
- package/dist/serialization/types/EventSummaryResponseData.js +48 -0
- package/dist/serialization/types/FeatureCompanyResponseData.js +59 -0
- package/dist/serialization/types/FeatureCompanyResponseDataAllocationType.d.ts +10 -0
- package/dist/serialization/types/FeatureCompanyResponseDataAllocationType.js +41 -0
- package/dist/serialization/types/FeatureCompanyUserResponseData.js +60 -0
- package/dist/serialization/types/FeatureCompanyUserResponseDataAllocationType.d.ts +10 -0
- package/dist/serialization/types/FeatureCompanyUserResponseDataAllocationType.js +41 -0
- package/dist/serialization/types/FeatureDetailResponseData.js +63 -0
- package/dist/serialization/types/FeatureResponseData.js +55 -0
- package/dist/serialization/types/FeatureUsageDataResponseData.js +51 -0
- package/dist/serialization/types/FeatureUsageDetailResponseData.js +44 -0
- package/dist/serialization/types/FeatureUsageResponseData.js +62 -0
- package/dist/serialization/types/FeatureUsageResponseDataAllocationType.d.ts +10 -0
- package/dist/serialization/types/FeatureUsageResponseDataAllocationType.js +41 -0
- package/dist/serialization/types/FlagDetailResponseData.js +57 -0
- package/dist/serialization/types/FlagResponseData.js +52 -0
- package/dist/serialization/types/GenericPreviewObject.js +46 -0
- package/dist/serialization/types/InvoiceRequestBody.js +53 -0
- package/dist/serialization/types/InvoiceResponseData.js +59 -0
- package/dist/serialization/types/IssueTemporaryAccessTokenResponseData.js +50 -0
- package/dist/serialization/types/KeysRequestBody.js +43 -0
- package/dist/serialization/types/MeterRequestBody.js +45 -0
- package/dist/serialization/types/OrderedPlansInGroup.js +45 -0
- package/dist/serialization/types/PaginationFilter.d.ts +13 -0
- package/dist/serialization/types/PaginationFilter.js +44 -0
- package/dist/serialization/types/PaymentMethodRequestBody.js +53 -0
- package/dist/serialization/types/PaymentMethodResponseData.js +59 -0
- package/dist/serialization/types/PlanAudienceDetailResponseData.d.ts +25 -0
- package/dist/serialization/types/PlanAudienceDetailResponseData.js +56 -0
- package/dist/serialization/types/PlanAudienceResponseData.d.ts +21 -0
- package/dist/serialization/types/PlanAudienceResponseData.js +52 -0
- package/dist/serialization/types/PlanDetailResponseData.js +65 -0
- package/dist/serialization/types/PlanEntitlementResponseData.js +72 -0
- package/dist/serialization/types/PlanEntitlementsOrder.js +44 -0
- package/dist/serialization/types/PlanGroupDetailResponseData.js +55 -0
- package/dist/serialization/types/PlanGroupPlanDetailResponseData.js +71 -0
- package/dist/serialization/types/PlanGroupPlanEntitlementsOrder.js +45 -0
- package/dist/serialization/types/PlanGroupResponseData.js +51 -0
- package/dist/serialization/types/PlanResponseData.js +50 -0
- package/dist/serialization/types/PlanTraitResponseData.js +50 -0
- package/dist/serialization/types/PreviewObject.js +46 -0
- package/dist/serialization/types/PreviewObjectResponseData.js +46 -0
- package/dist/serialization/types/PreviewSubscriptionChangeResponseData.js +55 -0
- package/dist/serialization/types/PreviewSubscriptionFinanceResponseData.js +52 -0
- package/dist/serialization/types/PreviewSubscriptionUpcomingInvoiceLineItems.js +47 -0
- package/dist/serialization/types/QuickstartResp.js +43 -0
- package/dist/serialization/types/RawEventBatchResponseData.js +44 -0
- package/dist/serialization/types/RawEventResponseData.js +47 -0
- package/dist/serialization/types/RuleConditionDetailResponseData.js +66 -0
- package/dist/serialization/types/RuleConditionGroupDetailResponseData.js +51 -0
- package/dist/serialization/types/RuleConditionGroupResponseData.js +49 -0
- package/dist/serialization/types/RuleConditionResponseData.js +61 -0
- package/dist/serialization/types/RuleDetailResponseData.js +56 -0
- package/dist/serialization/types/RuleResponseData.js +52 -0
- package/dist/serialization/types/RulesDetailResponseData.js +46 -0
- package/dist/serialization/types/SegmentStatusResp.js +45 -0
- package/dist/serialization/types/StripeEmbedInfo.js +44 -0
- package/dist/serialization/types/TemporaryAccessTokenResponseData.js +49 -0
- package/dist/serialization/types/UpdateAddOnRequestBody.js +44 -0
- package/dist/serialization/types/UpdateCreditBundleRequestBody.js +44 -0
- package/dist/serialization/types/UpdateEntitlementReqCommon.js +52 -0
- package/dist/serialization/types/UpdateEntitlementReqCommonMetricPeriod.js +41 -0
- package/dist/serialization/types/UpdateEntitlementReqCommonMetricPeriodMonthReset.js +41 -0
- package/dist/serialization/types/UpdateEntitlementReqCommonValueType.d.ts +10 -0
- package/dist/serialization/types/UpdateEntitlementReqCommonValueType.js +41 -0
- package/dist/serialization/types/UpdatePayInAdvanceRequestBody.js +44 -0
- package/dist/serialization/types/UpdateRuleRequestBody.js +49 -0
- package/dist/serialization/types/UpsertCompanyRequestBody.js +48 -0
- package/dist/serialization/types/UpsertTraitRequestBody.js +47 -0
- package/dist/serialization/types/UpsertUserRequestBody.js +54 -0
- package/dist/serialization/types/UpsertUserSubRequestBody.js +50 -0
- package/dist/serialization/types/UsageBasedEntitlementRequestBody.js +57 -0
- package/dist/serialization/types/UsageBasedEntitlementRequestBodyPriceBehavior.d.ts +10 -0
- package/dist/serialization/types/UsageBasedEntitlementRequestBodyPriceBehavior.js +41 -0
- package/dist/serialization/types/UsageBasedEntitlementResponseData.js +54 -0
- package/dist/serialization/types/UserDetailResponseData.js +55 -0
- package/dist/serialization/types/UserResponseData.js +48 -0
- package/dist/serialization/types/WebhookEventDetailResponseData.js +53 -0
- package/dist/serialization/types/WebhookEventResponseData.js +51 -0
- package/dist/serialization/types/WebhookResponseData.js +52 -0
- package/dist/serialization/types/index.js +188 -0
- package/dist/webhooks.js +170 -0
- package/dist/wrapper.js +178 -0
- package/package.json +66 -66
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";var om=Object.create;var ci=Object.defineProperty;var tm=Object.getOwnPropertyDescriptor;var am=Object.getOwnPropertyNames;var sm=Object.getPrototypeOf,nm=Object.prototype.hasOwnProperty;var Bo=(p,o)=>()=>(p&&(o=p(p=0)),o);var Ke=(p,o)=>{for(var i in o)ci(p,i,{get:o[i],enumerable:!0})},ra=(p,o,i,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of am(o))!nm.call(p,n)&&n!==i&&ci(p,n,{get:()=>o[n],enumerable:!(a=tm(o,n))||a.enumerable});return p};var Ao=(p,o,i)=>(i=p!=null?om(sm(p)):{},ra(o||!p||!p.__esModule?ci(i,"default",{value:p,enumerable:!0}):i,p)),cm=p=>ra(ci({},"__esModule",{value:!0}),p);var Ua={};Ke(Ua,{Node18UniversalStreamWrapper:()=>Mo});var Mo,Ta=Bo(()=>{"use strict";Mo=class p{constructor(o){this.readableStream=o,this.reader=this.readableStream.getReader(),this.events={data:[],end:[],error:[],readable:[],close:[],pause:[],resume:[]},this.paused=!1,this.resumeCallback=null,this.encoding=null}on(o,i){this.events[o]?.push(i)}off(o,i){this.events[o]=this.events[o]?.filter(a=>a!==i)}pipe(o){return this.on("data",async i=>{if(o instanceof p)o._write(i);else if(o instanceof WritableStream){let a=o.getWriter();a.write(i).then(()=>a.releaseLock())}else o.write(i)}),this.on("end",async()=>{o instanceof p?o._end():o instanceof WritableStream?o.getWriter().close():o.end()}),this.on("error",async i=>{o instanceof p?o._error(i):o instanceof WritableStream?o.getWriter().abort(i):o.destroy(i)}),this._startReading(),o}pipeTo(o){return this.pipe(o)}unpipe(o){this.off("data",async i=>{if(o instanceof p)o._write(i);else if(o instanceof WritableStream){let a=o.getWriter();a.write(i).then(()=>a.releaseLock())}else o.write(i)}),this.off("end",async()=>{o instanceof p?o._end():o instanceof WritableStream?o.getWriter().close():o.end()}),this.off("error",async i=>{o instanceof p?o._error(i):o instanceof WritableStream?o.getWriter().abort(i):o.destroy(i)})}destroy(o){this.reader.cancel(o).then(()=>{this._emit("close")}).catch(i=>{this._emit("error",i)})}pause(){this.paused=!0,this._emit("pause")}resume(){this.paused&&(this.paused=!1,this._emit("resume"),this.resumeCallback&&(this.resumeCallback(),this.resumeCallback=null))}get isPaused(){return this.paused}async read(){this.paused&&await new Promise(a=>{this.resumeCallback=a});let{done:o,value:i}=await this.reader.read();if(!o)return i}setEncoding(o){this.encoding=o}async text(){let o=[];for(;;){let{done:a,value:n}=await this.reader.read();if(a)break;n&&o.push(n)}return new TextDecoder(this.encoding||"utf-8").decode(await new Blob(o).arrayBuffer())}async json(){let o=await this.text();return JSON.parse(o)}_write(o){this._emit("data",o)}_end(){this._emit("end")}_error(o){this._emit("error",o)}_emit(o,i){if(this.events[o])for(let a of this.events[o]||[])a(i)}async _startReading(){try{for(this._emit("readable");;){this.paused&&await new Promise(a=>{this.resumeCallback=a});let{done:o,value:i}=await this.reader.read();if(o){this._emit("end"),this._emit("close");break}i&&this._emit("data",i)}}catch(o){this._emit("error",o)}}[Symbol.asyncIterator](){return{next:async()=>{this.paused&&await new Promise(a=>{this.resumeCallback=a});let{done:o,value:i}=await this.reader.read();return o?{done:!0,value:void 0}:{done:!1,value:i}},[Symbol.asyncIterator](){return this}}}}});var va={};Ke(va,{UndiciStreamWrapper:()=>Fo});var Fo,Oa=Bo(()=>{"use strict";Fo=class p{constructor(o){this.readableStream=o,this.reader=this.readableStream.getReader(),this.events={data:[],end:[],error:[],readable:[],close:[],pause:[],resume:[]},this.paused=!1,this.resumeCallback=null,this.encoding=null}on(o,i){this.events[o]?.push(i)}off(o,i){this.events[o]=this.events[o]?.filter(a=>a!==i)}pipe(o){return this.on("data",i=>{if(o instanceof p)o._write(i);else{let a=o.getWriter();a.write(i).then(()=>a.releaseLock())}}),this.on("end",()=>{o instanceof p?o._end():o.getWriter().close()}),this.on("error",i=>{o instanceof p?o._error(i):o.getWriter().abort(i)}),this._startReading(),o}pipeTo(o){return this.pipe(o)}unpipe(o){this.off("data",i=>{if(o instanceof p)o._write(i);else{let a=o.getWriter();a.write(i).then(()=>a.releaseLock())}}),this.off("end",()=>{o instanceof p?o._end():o.getWriter().close()}),this.off("error",i=>{o instanceof p?o._error(i):o.getWriter().abort(i)})}destroy(o){this.reader.cancel(o).then(()=>{this._emit("close")}).catch(i=>{this._emit("error",i)})}pause(){this.paused=!0,this._emit("pause")}resume(){this.paused&&(this.paused=!1,this._emit("resume"),this.resumeCallback&&(this.resumeCallback(),this.resumeCallback=null))}get isPaused(){return this.paused}async read(){this.paused&&await new Promise(a=>{this.resumeCallback=a});let{done:o,value:i}=await this.reader.read();if(!o)return i}setEncoding(o){this.encoding=o}async text(){let o=[];for(;;){let{done:a,value:n}=await this.reader.read();if(a)break;n&&o.push(n)}return new TextDecoder(this.encoding||"utf-8").decode(await new Blob(o).arrayBuffer())}async json(){let o=await this.text();return JSON.parse(o)}_write(o){this._emit("data",o)}_end(){this._emit("end")}_error(o){this._emit("error",o)}_emit(o,i){if(this.events[o])for(let a of this.events[o]||[])a(i)}async _startReading(){try{for(this._emit("readable");;){this.paused&&await new Promise(a=>{this.resumeCallback=a});let{done:o,value:i}=await this.reader.read();if(o){this._emit("end"),this._emit("close");break}i&&this._emit("data",i)}}catch(o){this._emit("error",o)}}[Symbol.asyncIterator](){return{next:async()=>{this.paused&&await new Promise(a=>{this.resumeCallback=a});let{done:o,value:i}=await this.reader.read();return o?{done:!0,value:void 0}:{done:!1,value:i}},[Symbol.asyncIterator](){return this}}}}});var ja={};Ke(ja,{NodePre18StreamWrapper:()=>Io});var Io,ka=Bo(()=>{"use strict";Io=class{constructor(o){this.readableStream=o}on(o,i){this.readableStream.on(o,i)}off(o,i){this.readableStream.off(o,i)}pipe(o){return this.readableStream.pipe(o),o}pipeTo(o){return this.pipe(o)}unpipe(o){o?this.readableStream.unpipe(o):this.readableStream.unpipe()}destroy(o){this.readableStream.destroy(o)}pause(){this.readableStream.pause()}resume(){this.readableStream.resume()}get isPaused(){return this.readableStream.isPaused()}async read(){return new Promise((o,i)=>{let a=this.readableStream.read();a?o(a):(this.readableStream.once("readable",()=>{let n=this.readableStream.read();o(n)}),this.readableStream.once("error",i))})}setEncoding(o){this.readableStream.setEncoding(o),this.encoding=o}async text(){let o=[],i=new TextEncoder;this.readableStream.setEncoding(this.encoding||"utf-8");for await(let n of this.readableStream)o.push(i.encode(n));return new TextDecoder(this.encoding||"utf-8").decode(Buffer.concat(o))}async json(){let o=await this.text();return JSON.parse(o)}[Symbol.asyncIterator](){let i=this.readableStream[Symbol.asyncIterator]();return{async next(){let{value:a,done:n}=await i.next();return{value:a,done:n}},[Symbol.asyncIterator](){return this}}}}});var og={};Ke(og,{LocalCache:()=>hr,Schematic:()=>se,SchematicClient:()=>Oo,SchematicEnvironment:()=>_,SchematicError:()=>z,SchematicTimeoutError:()=>cr,WEBHOOK_SIGNATURE_HEADER:()=>Yt,WEBHOOK_TIMESTAMP_HEADER:()=>Xt,WebhookSignatureError:()=>Ie,computeHexSignature:()=>rm,computeSignature:()=>ko,verifySignature:()=>ea,verifyWebhookSignature:()=>im});module.exports=cm(og);var se={};Ke(se,{ApiKeyScope:()=>pm,BadRequestError:()=>v,BillingCreditBundleStatus:()=>um,BillingCreditBurnStrategy:()=>dm,BillingCreditExpiryType:()=>mm,BillingCreditExpiryUnit:()=>hm,BillingCreditGrantReason:()=>gm,BillingCreditGrantZeroedOutReason:()=>ym,BillingCreditRolloverPolicy:()=>wm,BillingPlanCreditGrantResetCadence:()=>bm,BillingPlanCreditGrantResetStart:()=>zm,BillingPlanCreditGrantResetType:()=>Rm,BillingPriceScheme:()=>fm,BillingPriceUsageType:()=>_m,BillingProductPriceInterval:()=>Sm,BillingProviderType:()=>Pm,BillingSubscriptionTrialEndSetting:()=>xm,BillingTiersMode:()=>Em,ChargeType:()=>Cm,CompanyPlanInvalidReason:()=>Um,ComponentEntityType:()=>Tm,ComponentState:()=>vm,ConditionConditionType:()=>Om,ConditionMetricPeriod:()=>jm,ConditionMetricPeriodMonthReset:()=>km,ConditionOperator:()=>Bm,CreateCompanyOverrideRequestBodyMetricPeriod:()=>pa,CreateCompanyOverrideRequestBodyMetricPeriodMonthReset:()=>ua,CreateEntitlementInBundleRequestBodyMetricPeriod:()=>Am,CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset:()=>Vm,CreateEntitlementReqCommonMetricPeriod:()=>qm,CreateEntitlementReqCommonMetricPeriodMonthReset:()=>Dm,CreateOrUpdateConditionRequestBodyConditionType:()=>Mm,CreateOrUpdateConditionRequestBodyMetricPeriod:()=>Fm,CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset:()=>Im,CreateOrUpdateConditionRequestBodyOperator:()=>Km,CreateOrUpdateRuleRequestBodyRuleType:()=>Gm,CreatePlanEntitlementRequestBodyMetricPeriod:()=>da,CreatePlanEntitlementRequestBodyMetricPeriodMonthReset:()=>ma,CreditGrantSortOrder:()=>Lm,CreditLedgerPeriod:()=>Wm,DataExportStatus:()=>Nm,EntitlementPriceBehavior:()=>Hm,EntitlementType:()=>$m,EntitlementValueType:()=>Zm,EntityType:()=>Jm,EnvironmentType:()=>Qm,EventStatus:()=>Ym,EventType:()=>Xm,FeatureLifecyclePhase:()=>eh,FeatureType:()=>rh,ForbiddenError:()=>P,InternalServerError:()=>x,NotFoundError:()=>E,PlanBundleAction:()=>ih,PlanChangeAction:()=>oh,PlanChangeActorType:()=>th,PlanChangeBasePlanAction:()=>ah,PlanChangeSubscriptionAction:()=>sh,PlanControlledByType:()=>nh,PlanType:()=>ch,PlanVersionStatus:()=>lh,ProrationBehavior:()=>ph,RuleRuleType:()=>uh,RulesEngineSchemaVersion:()=>dh,RulesengineCheckFlagResultFeatureUsagePeriod:()=>mh,RulesengineCheckFlagResultRuleType:()=>hh,RulesengineCompanyMetricMonthReset:()=>gh,RulesengineCompanyMetricPeriod:()=>yh,RulesengineConditionConditionType:()=>wh,RulesengineConditionMetricPeriod:()=>bh,RulesengineConditionMetricPeriodMonthReset:()=>zh,RulesengineConditionOperator:()=>Rh,RulesengineEntityType:()=>fh,RulesengineRuleRuleType:()=>_h,RulesengineTraitDefinitionComparableType:()=>Sh,SortDirection:()=>Ph,SubscriptionStatus:()=>xh,SubscriptionType:()=>Eh,TraitDefinitionComparableType:()=>Ch,TraitType:()=>Uh,UnauthorizedError:()=>C,UpdateCompanyOverrideRequestBodyMetricPeriod:()=>ha,UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset:()=>ga,UpdateEntitlementReqCommonMetricPeriod:()=>Th,UpdateEntitlementReqCommonMetricPeriodMonthReset:()=>vh,UpdatePlanEntitlementRequestBodyMetricPeriod:()=>ya,UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset:()=>wa,WebhookEventStatus:()=>Oh,WebhookRequestType:()=>jh,WebhookStatus:()=>kh,accesstokens:()=>ia,accounts:()=>oa,billing:()=>ta,checkout:()=>aa,companies:()=>sa,components:()=>na,credits:()=>ca,dataexports:()=>la,entitlements:()=>Vo,events:()=>ba,features:()=>za,planbundle:()=>Ra,plangroups:()=>fa,plans:()=>_a,webhooks:()=>Sa});var me=(p,o,i)=>JSON.stringify(p,o,i);function Jr(p,o){return JSON.parse(p,o)}var z=class extends Error{constructor({message:o,statusCode:i,body:a,rawResponse:n}){super(lm({message:o,statusCode:i,body:a})),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.statusCode=i,this.body=a,this.rawResponse=n}};function lm({message:p,statusCode:o,body:i}){let a=[];return p!=null&&a.push(p),o!=null&&a.push(`Status code: ${o.toString()}`),i!=null&&a.push(`Body: ${me(i,void 0,2)}`),a.join(`
|
|
2
2
|
`)}var cr=class extends Error{constructor(o){super(o),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var v=class extends z{constructor(o,i){super({message:"BadRequestError",statusCode:400,body:o,rawResponse:i}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var P=class extends z{constructor(o,i){super({message:"ForbiddenError",statusCode:403,body:o,rawResponse:i}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var x=class extends z{constructor(o,i){super({message:"InternalServerError",statusCode:500,body:o,rawResponse:i}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var E=class extends z{constructor(o,i){super({message:"NotFoundError",statusCode:404,body:o,rawResponse:i}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var C=class extends z{constructor(o,i){super({message:"UnauthorizedError",statusCode:401,body:o,rawResponse:i}),Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var ia={};var oa={};var ta={};var aa={};var sa={};var na={};var ca={};var la={};var Vo={};Ke(Vo,{CreateCompanyOverrideRequestBodyMetricPeriod:()=>pa,CreateCompanyOverrideRequestBodyMetricPeriodMonthReset:()=>ua,CreatePlanEntitlementRequestBodyMetricPeriod:()=>da,CreatePlanEntitlementRequestBodyMetricPeriodMonthReset:()=>ma,UpdateCompanyOverrideRequestBodyMetricPeriod:()=>ha,UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset:()=>ga,UpdatePlanEntitlementRequestBodyMetricPeriod:()=>ya,UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset:()=>wa});var pa={AllTime:"all_time",CurrentMonth:"current_month",CurrentWeek:"current_week",CurrentDay:"current_day"};var ua={FirstOfMonth:"first_of_month",BillingCycle:"billing_cycle"};var da={AllTime:"all_time",CurrentMonth:"current_month",CurrentWeek:"current_week",CurrentDay:"current_day"};var ma={FirstOfMonth:"first_of_month",BillingCycle:"billing_cycle"};var ha={AllTime:"all_time",CurrentMonth:"current_month",CurrentWeek:"current_week",CurrentDay:"current_day"};var ga={FirstOfMonth:"first_of_month",BillingCycle:"billing_cycle"};var ya={AllTime:"all_time",CurrentMonth:"current_month",CurrentWeek:"current_week",CurrentDay:"current_day"};var wa={FirstOfMonth:"first_of_month",BillingCycle:"billing_cycle"};var ba={};var za={};var Ra={};var fa={};var _a={};var Sa={};var pm={Admin:"admin",Capture:"capture",Read:"read",Write:"write"};var um={Active:"active",Inactive:"inactive"};var dm={ExpirationPriority:"expiration_priority",FirstInFirstOut:"first_in_first_out",LastInFirstOut:"last_in_first_out",PlanFirstThenCreditBundlesFirstInFirstOut:"plan_first_then_credit_bundles_first_in_first_out"};var mm={Duration:"duration",EndOfBillingPeriod:"end_of_billing_period",EndOfNextBillingPeriod:"end_of_next_billing_period",EndOfTrial:"end_of_trial",NoExpiry:"no_expiry"};var hm={BillingPeriods:"billing_periods",Days:"days"};var gm={BillingCreditAutoTopup:"billing_credit_auto_topup",Free:"free",Plan:"plan",Purchased:"purchased"};var ym={Expired:"expired",Manual:"manual",PlanChange:"plan_change",PlanPeriodReset:"plan_period_reset"};var wm={Expire:"expire",None:"none",Rollover:"rollover"};var bm={Daily:"daily",Monthly:"monthly",Weekly:"weekly",Yearly:"yearly"};var zm={BillingPeriod:"billing_period",FirstOfMonth:"first_of_month"};var Rm={NoReset:"no_reset",PlanPeriod:"plan_period"};var fm={PerUnit:"per_unit",Tiered:"tiered"};var _m={Licensed:"licensed",Metered:"metered"};var Sm={Day:"day",Month:"month",OneTime:"one-time",Year:"year"};var Pm={Schematic:"schematic",Stripe:"stripe"};var xm={Cancel:"cancel",Subscribe:"subscribe"};var Em={Graduated:"graduated",Volume:"volume"};var Cm={Free:"free",OneTime:"one_time",Recurring:"recurring"};var Um={DowngradeNotPermitted:"downgrade_not_permitted",FeatureUsageExceeded:"feature_usage_exceeded"};var Tm={Billing:"billing",Entitlement:"entitlement"};var vm={Draft:"draft",Live:"live"};var Om={BasePlan:"base_plan",BillingProduct:"billing_product",Company:"company",Credit:"credit",CrmProduct:"crm_product",Metric:"metric",Plan:"plan",Trait:"trait",User:"user"};var jm={AllTime:"all_time",CurrentDay:"current_day",CurrentMonth:"current_month",CurrentWeek:"current_week"};var km={FirstOfMonth:"first_of_month",BillingCycle:"billing_cycle"};var Bm={Eq:"eq",Ne:"ne",Gt:"gt",Lt:"lt",Gte:"gte",Lte:"lte",IsEmpty:"is_empty",NotEmpty:"not_empty"};var Am={AllTime:"all_time",CurrentMonth:"current_month",CurrentWeek:"current_week",CurrentDay:"current_day"};var Vm={FirstOfMonth:"first_of_month",BillingCycle:"billing_cycle"};var qm={AllTime:"all_time",CurrentMonth:"current_month",CurrentWeek:"current_week",CurrentDay:"current_day"};var Dm={FirstOfMonth:"first_of_month",BillingCycle:"billing_cycle"};var Mm={Company:"company",Metric:"metric",Trait:"trait",User:"user",Plan:"plan",BillingProduct:"billing_product",BasePlan:"base_plan"};var Fm={AllTime:"all_time",CurrentMonth:"current_month",CurrentWeek:"current_week",CurrentDay:"current_day"};var Im={FirstOfMonth:"first_of_month",BillingCycle:"billing_cycle"};var Km={Eq:"eq",Ne:"ne",Gt:"gt",Gte:"gte",Lt:"lt",Lte:"lte",IsEmpty:"is_empty",NotEmpty:"not_empty"};var Gm={GlobalOverride:"global_override",CompanyOverride:"company_override",PlanEntitlement:"plan_entitlement",Standard:"standard",Default:"default"};var Lm={CreatedAt:"created_at",ExpiresAt:"expires_at",Quantity:"quantity",QuantityRemaining:"quantity_remaining"};var Wm={Daily:"daily",Monthly:"monthly",Raw:"raw",Weekly:"weekly"};var Nm={Failure:"failure",Pending:"pending",Success:"success"};var Hm={CreditBurndown:"credit_burndown",Overage:"overage",PayAsYouGo:"pay_as_you_go",PayInAdvance:"pay_in_advance",Tier:"tier"};var $m={CompanyOverride:"company_override",PlanEntitlement:"plan_entitlement",Unknown:"unknown"};var Zm={Boolean:"boolean",Credit:"credit",Numeric:"numeric",Trait:"trait",Unknown:"unknown",Unlimited:"unlimited"};var Jm={Company:"company",User:"user"};var Qm={Development:"development",Production:"production",Staging:"staging"};var Ym={Enriched:"enriched",Failed:"failed",Pending:"pending",Processed:"processed",Unknown:"unknown"};var Xm={FlagCheck:"flag_check",Identify:"identify",Track:"track"};var eh={AddOn:"add_on",Alpha:"alpha",Beta:"beta",Deprecated:"deprecated",Ga:"ga",Inactive:"inactive",InPlan:"in_plan",InternalTesting:"internal_testing",Legacy:"legacy"};var rh={Boolean:"boolean",Event:"event",Trait:"trait"};var ih={Create:"create",Update:"update",Delete:"delete"};var oh={Checkout:"checkout",CompanyUpsert:"company_upsert",FallbackPlan:"fallback_plan",ManagePlan:"manage_plan",Migration:"migration",PlanBillingProductChanged:"plan_billing_product_changed",PlanDeleted:"plan_deleted",PlanTraitChange:"plan_trait_change",Quickstart:"quickstart",SubscriptionChange:"subscription_change"};var th={ApiKey:"api_key",AppUser:"app_user",System:"system",TemporaryAccessToken:"temporary_access_token"};var ah={Fallback:"fallback",Initial:"initial",Trait:"trait",TrialExpiry:"trial_expiry"};var sh={Adjustment:"adjustment",Downgrade:"downgrade",Invalid:"invalid",Subscribe:"subscribe",Unsubscribe:"unsubscribe",Upgrade:"upgrade",UpgradeTrial:"upgrade_trial"};var nh={Schematic:"schematic",Stripe:"stripe"};var ch={Plan:"plan",AddOn:"add_on"};var lh={Published:"published",Draft:"draft",Archived:"archived"};var ph={CreateProrations:"create_prorations",InvoiceImmediately:"invoice_immediately"};var uh={Default:"default",GlobalOverride:"global_override",CompanyOverride:"company_override",CompanyOverrideUsageExceeded:"company_override_usage_exceeded",PlanEntitlement:"plan_entitlement",PlanEntitlementUsageExceeded:"plan_entitlement_usage_exceeded",Standard:"standard"};var dh={FiveHundredFortyNineE6Fea:"549e6fea",PlaceholderForFernCompatibility:"placeholder-for-fern-compatibility"};var mh={AllTime:"all_time",CurrentDay:"current_day",CurrentMonth:"current_month",CurrentWeek:"current_week"};var hh={Default:"default",GlobalOverride:"global_override",CompanyOverride:"company_override",CompanyOverrideUsageExceeded:"company_override_usage_exceeded",PlanEntitlement:"plan_entitlement",PlanEntitlementUsageExceeded:"plan_entitlement_usage_exceeded",Standard:"standard"};var gh={FirstOfMonth:"first_of_month",BillingCycle:"billing_cycle"};var yh={AllTime:"all_time",CurrentDay:"current_day",CurrentMonth:"current_month",CurrentWeek:"current_week"};var wh={BasePlan:"base_plan",BillingProduct:"billing_product",Company:"company",Credit:"credit",CrmProduct:"crm_product",Metric:"metric",Plan:"plan",Trait:"trait",User:"user"};var bh={AllTime:"all_time",CurrentDay:"current_day",CurrentMonth:"current_month",CurrentWeek:"current_week"};var zh={FirstOfMonth:"first_of_month",BillingCycle:"billing_cycle"};var Rh={Eq:"eq",Ne:"ne",Gt:"gt",Lt:"lt",Gte:"gte",Lte:"lte",IsEmpty:"is_empty",NotEmpty:"not_empty"};var fh={Company:"company",User:"user"};var _h={Default:"default",GlobalOverride:"global_override",CompanyOverride:"company_override",CompanyOverrideUsageExceeded:"company_override_usage_exceeded",PlanEntitlement:"plan_entitlement",PlanEntitlementUsageExceeded:"plan_entitlement_usage_exceeded",Standard:"standard"};var Sh={Bool:"bool",Date:"date",Int:"int",String:"string"};var Ph={Asc:"asc",Desc:"desc"};var xh={Active:"active",Canceled:"canceled",Expired:"expired",Incomplete:"incomplete",IncompleteExpired:"incomplete_expired",PastDue:"past_due",Paused:"paused",Trialing:"trialing",Unpaid:"unpaid"};var Eh={Free:"free",OneTime:"one_time",Paid:"paid",Trial:"trial"};var Ch={Bool:"bool",Date:"date",Int:"int",String:"string"};var Uh={Boolean:"boolean",Currency:"currency",Date:"date",Number:"number",String:"string",Url:"url"};var Th={AllTime:"all_time",CurrentMonth:"current_month",CurrentWeek:"current_week",CurrentDay:"current_day"};var vh={FirstOfMonth:"first_of_month",BillingCycle:"billing_cycle"};var Oh={Failure:"failure",Pending:"pending",Success:"success"};var jh={SubscriptionTrialEnded:"subscription.trial.ended",CompanyCreated:"company.created",CompanyDeleted:"company.deleted",CompanyOverrideCreated:"company.override.created",CompanyOverrideDeleted:"company.override.deleted",CompanyOverrideExpired:"company.override.expired",CompanyOverrideUpdated:"company.override.updated",CompanyPlanChanged:"company.plan_changed",CompanyUpdated:"company.updated",CreditLimitReached:"credit.limit.reached",CreditLimitWarning:"credit.limit.warning",EntitlementLimitReached:"entitlement.limit.reached",EntitlementLimitWarning:"entitlement.limit.warning",EntitlementSoftLimitReached:"entitlement.soft_limit.reached",EntitlementSoftLimitWarning:"entitlement.soft_limit.warning",EntitlementTierLimitReached:"entitlement.tier_limit.reached",EntitlementTierLimitWarning:"entitlement.tier_limit.warning",FeatureCreated:"feature.created",FeatureDeleted:"feature.deleted",FeatureUpdated:"feature.updated",FlagCreated:"flag.created",FlagDeleted:"flag.deleted",FlagRulesUpdated:"flag_rules.updated",FlagUpdated:"flag.updated",PlanCreated:"plan.created",PlanDeleted:"plan.deleted",PlanEntitlementCreated:"plan.entitlement.created",PlanEntitlementDeleted:"plan.entitlement.deleted",PlanEntitlementUpdated:"plan.entitlement.updated",PlanUpdated:"plan.updated",RuleDeleted:"rule.deleted",TestSend:"test.send",UserCreated:"user.created",UserDeleted:"user.deleted",UserUpdated:"user.updated",AutoTopupHardFailure:"auto.topup.hard.failure",AutoTopupRetryExceeded:"auto.topup.retry.exceeded"};var kh={Active:"active",Inactive:"inactive"};var Qr=require("timers"),hr=class{constructor({maxItems:o=1e3,ttl:i=5e3}={}){this.accessCounter=0;this.cache=new Map,this.maxItems=o,this.defaultTTL=i}async get(o){let i=this.cache.get(o);if(i){if(i.expiration<=Date.now()){this.evictItem(o,i);return}return this.accessCounter++,i.accessCounter=this.accessCounter,this.cache.set(o,i),i.value}}async set(o,i,a){if(this.maxItems===0)return;let n=a??this.defaultTTL,r=this.cache.get(o);r&&this.evictItem(o,r),this.evictExpiredItems(),this.evictLRUItems(),this.accessCounter++;let s={value:i,accessCounter:this.accessCounter,expiration:Date.now()+n,timeoutId:(0,Qr.setTimeout)(()=>this.evictItem(o,s),n)};this.cache.set(o,s)}resetCache(){this.cache.forEach(o=>{o.timeoutId&&(0,Qr.clearTimeout)(o.timeoutId)}),this.cache.clear(),this.accessCounter=0}evictItem(o,i){i.timeoutId&&(0,Qr.clearTimeout)(i.timeoutId),this.cache.delete(o)}evictExpiredItems(){this.cache.forEach((o,i)=>{o.expiration<=Date.now()&&this.evictItem(i,o)})}evictLRUItems(){for(;this.cache.size>=this.maxItems;){let o,i=Number.MAX_SAFE_INTEGER;this.cache.forEach((a,n)=>{a.accessCounter<i&&(o=n,i=a.accessCounter)}),o&&this.evictItem(o,this.cache.get(o))}}};var Yr=class{getAuthRequest(){return Promise.resolve({headers:{}})}};var Pa={get:async(p,o)=>typeof p=="function"?p(o):p};var Te={Debug:"debug",Info:"info",Warn:"warn",Error:"error"},xa={[Te.Debug]:1,[Te.Info]:2,[Te.Warn]:3,[Te.Error]:4},Xr=class{debug(o,...i){console.debug(o,...i)}info(o,...i){console.info(o,...i)}warn(o,...i){console.warn(o,...i)}error(o,...i){console.error(o,...i)}},gr=class{constructor(o){this.level=xa[o.level],this.logger=o.logger,this.silent=o.silent}shouldLog(o){return!this.silent&&this.level<=xa[o]}isDebug(){return this.shouldLog(Te.Debug)}debug(o,...i){this.isDebug()&&this.logger.debug(o,...i)}isInfo(){return this.shouldLog(Te.Info)}info(o,...i){this.isInfo()&&this.logger.info(o,...i)}isWarn(){return this.shouldLog(Te.Warn)}warn(o,...i){this.isWarn()&&this.logger.warn(o,...i)}isError(){return this.shouldLog(Te.Error)}error(o,...i){this.isError()&&this.logger.error(o,...i)}};function qo(p){return p==null?Bh:p instanceof gr?p:(p=p??{},p.level??=Te.Info,p.logger??=new Xr,p.silent??=!0,new gr(p))}var Bh=new gr({level:Te.Info,logger:new Xr,silent:!0});var Ah={arrayFormat:"indices",encode:!0};function Ea(p,o){if(p===void 0||p===null)return"";let i=String(p);return o?encodeURIComponent(i):i}function Do(p,o="",i){let a=[];for(let[n,r]of Object.entries(p)){let s=o?`${o}[${n}]`:n;if(r!==void 0)if(Array.isArray(r)){if(r.length===0)continue;for(let u=0;u<r.length;u++){let g=r[u];if(g!==void 0)if(typeof g=="object"&&!Array.isArray(g)&&g!==null){let d=i.arrayFormat==="indices"?`${s}[${u}]`:s;a.push(...Do(g,d,i))}else{let d=i.arrayFormat==="indices"?`${s}[${u}]`:s,l=i.encode?encodeURIComponent(d):d;a.push(`${l}=${Ea(g,i.encode)}`)}}}else if(typeof r=="object"&&r!==null){if(Object.keys(r).length===0)continue;a.push(...Do(r,s,i))}else{let u=i.encode?encodeURIComponent(s):s;a.push(`${u}=${Ea(r,i.encode)}`)}}return a}function yr(p,o){return p==null||typeof p!="object"?"":Do(p,"",{...Ah,...o}).join("&")}function li(p,o){let i=yr(o,{arrayFormat:"repeat"});return i?`${p}?${i}`:p}function Ca(p){let o={get bodyUsed(){return p.bodyUsed},stream:()=>p.body,arrayBuffer:p.arrayBuffer.bind(p),blob:p.blob.bind(p)};return"bytes"in p&&typeof p.bytes=="function"&&(o.bytes=p.bytes.bind(p)),o}var he=Vh();function Vh(){return typeof window<"u"&&typeof window.document<"u"?{type:"browser",version:window.navigator.userAgent}:typeof globalThis<"u"&&globalThis?.navigator?.userAgent==="Cloudflare-Workers"?{type:"workerd"}:typeof EdgeRuntime=="string"?{type:"edge-runtime"}:typeof self=="object"&&typeof self?.importScripts=="function"&&(self.constructor?.name==="DedicatedWorkerGlobalScope"||self.constructor?.name==="ServiceWorkerGlobalScope"||self.constructor?.name==="SharedWorkerGlobalScope")?{type:"web-worker"}:typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u"?{type:"deno",version:Deno.version.deno}:typeof Bun<"u"&&typeof Bun.version<"u"?{type:"bun",version:Bun.version}:typeof navigator<"u"&&navigator?.product==="ReactNative"?{type:"react-native"}:typeof process<"u"&&"version"in process&&!!process.version&&"versions"in process&&!!process.versions?.node?{type:"node",version:process.versions.node,parsedVersion:Number(process.versions.node.split(".")[0])}:{type:"unknown"}}async function Ba(p){return he.type==="node"&&he.parsedVersion!=null&&he.parsedVersion>=18?new(await Promise.resolve().then(()=>(Ta(),Ua))).Node18UniversalStreamWrapper(p):he.type!=="node"&&typeof fetch=="function"?new(await Promise.resolve().then(()=>(Oa(),va))).UndiciStreamWrapper(p):new(await Promise.resolve().then(()=>(ka(),ja))).NodePre18StreamWrapper(p)}async function wr(p,o){switch(o){case"binary-response":return Ca(p);case"blob":return await p.blob();case"arrayBuffer":return await p.arrayBuffer();case"sse":return p.body==null?{ok:!1,error:{reason:"body-is-null",statusCode:p.status}}:p.body;case"streaming":return p.body==null?{ok:!1,error:{reason:"body-is-null",statusCode:p.status}}:Ba(p.body);case"text":return await p.text()}let i=await p.text();if(i.length>0)try{return Jr(i)}catch{return{ok:!1,error:{reason:"non-json",statusCode:p.status,rawBody:i}}}}async function Aa(p){let o=p.headers.get("Content-Type")?.toLowerCase();if(o==null||o.length===0)return wr(p);switch(o.indexOf(";")!==-1&&(o=o.split(";")[0]?.trim()??""),o){case"application/hal+json":case"application/json":case"application/ld+json":case"application/problem+json":case"application/vnd.api+json":case"text/json":{let i=await p.text();return i.length>0?Jr(i):void 0}default:if(o.startsWith("application/vnd.")&&o.endsWith("+json")){let i=await p.text();return i.length>0?Jr(i):void 0}return await p.text()}}async function pi(){return he.type==="node"&&he.parsedVersion!=null&&he.parsedVersion>=18?fetch:he.type==="node"?(await import("node-fetch")).default:typeof fetch=="function"?fetch:(await import("node-fetch")).default}async function ui({body:p,type:o}){return o==="form"?yr(p,{arrayFormat:"repeat",encode:!0}):o.includes("json")?me(p):p}var je;typeof globalThis.Headers<"u"?je=globalThis.Headers:je=class Va{constructor(o){if(this.headers=new Map,o)if(o instanceof Va)o.forEach((i,a)=>this.append(a,i));else if(Array.isArray(o))for(let[i,a]of o)if(typeof i=="string"&&typeof a=="string")this.append(i,a);else throw new TypeError("Each header entry must be a [string, string] tuple");else for(let[i,a]of Object.entries(o))if(typeof a=="string")this.append(i,a);else throw new TypeError("Header values must be strings")}append(o,i){let a=o.toLowerCase(),n=this.headers.get(a)||[];this.headers.set(a,[...n,i])}delete(o){let i=o.toLowerCase();this.headers.delete(i)}get(o){let i=o.toLowerCase(),a=this.headers.get(i);return a?a.join(", "):null}has(o){let i=o.toLowerCase();return this.headers.has(i)}set(o,i){let a=o.toLowerCase();this.headers.set(a,[i])}forEach(o,i){let a=i?o.bind(i):o;this.headers.forEach((n,r)=>a(n.join(", "),r,this))}getSetCookie(){return this.headers.get("set-cookie")||[]}*entries(){for(let[o,i]of this.headers.entries())yield[o,i.join(", ")]}*keys(){yield*this.headers.keys()}*values(){for(let o of this.headers.values())yield o.join(", ")}[Symbol.iterator](){return this.entries()}};var qh="timeout";function qa(p){let o=new AbortController,i=setTimeout(()=>o.abort(qh),p);return{signal:o.signal,abortId:i}}function Da(...p){let o=p.length===1&&Array.isArray(p[0])?p[0]:p,i=new AbortController;for(let a of o){if(a.aborted){i.abort(a?.reason);break}a.addEventListener("abort",()=>i.abort(a?.reason),{signal:i.signal})}return i.signal}var di=async(p,o,i,a,n,r,s,u,g)=>{let d=[],l;if(r!=null){let{signal:j,abortId:b}=qa(r);l=b,d.push(j)}s!=null&&d.push(s);let m=Da(d),y=await p(o,{method:i,headers:a,body:n,signal:m,credentials:u?"include":void 0,duplex:g});return l!=null&&clearTimeout(l),y};var br={headers:new je,redirected:!1,status:499,statusText:"Client Closed Request",type:"error",url:""},zr={headers:new je,redirected:!1,status:0,statusText:"Unknown Error",type:"error",url:""};function ei(p){return{headers:p.headers,redirected:p.redirected,status:p.status,statusText:p.statusText,type:p.type,url:p.url}}function Dh(p){let o=1+Math.random()*.2;return p*o}function Mh(p){let o=1+(Math.random()-.5)*.2;return p*o}function Fh(p,o){let i=p.headers.get("Retry-After");if(i){let n=parseInt(i,10);if(!Number.isNaN(n)&&n>0)return Math.min(n*1e3,6e4);let r=new Date(i);if(!Number.isNaN(r.getTime())){let s=r.getTime()-Date.now();if(s>0)return Math.min(Math.max(s,0),6e4)}}let a=p.headers.get("X-RateLimit-Reset");if(a){let n=parseInt(a,10);if(!Number.isNaN(n)){let r=n*1e3-Date.now();if(r>0)return Dh(Math.min(r,6e4))}}return Mh(Math.min(1e3*2**o,6e4))}async function mi(p,o=2){let i=await p();for(let a=0;a<o&&([408,429].includes(i.status)||i.status>=500);++a){let n=Fh(i,a);await new Promise(r=>setTimeout(r,n)),i=await p()}return i}var Ih=new Set(["authorization","www-authenticate","x-api-key","api-key","apikey","x-api-token","x-auth-token","auth-token","cookie","set-cookie","proxy-authorization","proxy-authenticate","x-csrf-token","x-xsrf-token","x-session-token","x-access-token"]);function Ko(p){let o={};for(let[i,a]of p instanceof je?p.entries():Object.entries(p))Ih.has(i.toLowerCase())?o[i]="[REDACTED]":o[i]=a;return o}var Go=new Set(["api_key","api-key","apikey","token","access_token","access-token","auth_token","auth-token","password","passwd","secret","api_secret","api-secret","apisecret","key","session","session_id","session-id"]);function Kh(p){if(p==null)return p;let o={};for(let[i,a]of Object.entries(p))Go.has(i.toLowerCase())?o[i]="[REDACTED]":o[i]=a;return o}function lr(p){let o=p.indexOf("://");if(o===-1)return p;let i=o+3,a=p.indexOf("/",i),n=p.indexOf("?",i),r=p.indexOf("#",i),s=Math.min(a===-1?p.length:a,n===-1?p.length:n,r===-1?p.length:r),u=-1;for(let b=i;b<s;b++)p[b]==="@"&&(u=b);if(u!==-1&&(p=`${p.slice(0,i)}[REDACTED]@${p.slice(u+1)}`),n=p.indexOf("?"),n===-1)return p;r=p.indexOf("#",n);let g=r!==-1?r:p.length,d=p.slice(n+1,g);if(d.length===0)return p;let l=d.toLowerCase();if(!(l.includes("token")||l.includes("key")||l.includes("password")||l.includes("passwd")||l.includes("secret")||l.includes("session")||l.includes("auth")))return p;let y=[],j=d.split("&");for(let b of j){let T=b.indexOf("=");if(T===-1){y.push(b);continue}let V=b.slice(0,T),H=Go.has(V.toLowerCase());if(!H&&V.includes("%"))try{let O=decodeURIComponent(V);H=Go.has(O.toLowerCase())}catch{}y.push(H?`${V}=[REDACTED]`:b)}return p.slice(0,n+1)+y.join("&")+p.slice(g)}async function Gh(p){let o=new je;if(o.set("Accept",p.responseType==="json"?"application/json":p.responseType==="text"?"text/plain":"*/*"),p.body!==void 0&&p.contentType!=null&&o.set("Content-Type",p.contentType),p.headers==null)return o;for(let[i,a]of Object.entries(p.headers)){let n=await Pa.get(a,{endpointMetadata:p.endpointMetadata??{}});if(typeof n=="string"){o.set(i,n);continue}n!=null&&o.set(i,`${n}`)}return o}async function Lh(p){let o=li(p.url,p.queryParameters),i=await ui({body:p.body,type:p.requestType??"other"}),a=p.fetchFn??await pi(),n=await Gh(p),r=qo(p.logging);if(r.isDebug()){let s={method:p.method,url:lr(o),headers:Ko(n),queryParameters:Kh(p.queryParameters),hasBody:i!=null};r.debug("Making HTTP request",s)}try{let s=await mi(async()=>di(a,o,p.method,n,i,p.timeoutMs,p.abortSignal,p.withCredentials,p.duplex),p.maxRetries);if(s.status>=200&&s.status<400){if(r.isDebug()){let g={method:p.method,url:lr(o),statusCode:s.status,responseHeaders:Ko(s.headers)};r.debug("HTTP request succeeded",g)}return{ok:!0,body:await wr(s,p.responseType),headers:s.headers,rawResponse:ei(s)}}else{if(r.isError()){let u={method:p.method,url:lr(o),statusCode:s.status,responseHeaders:Ko(Object.fromEntries(s.headers.entries()))};r.error("HTTP request failed with error status",u)}return{ok:!1,error:{reason:"status-code",statusCode:s.status,body:await Aa(s)},rawResponse:ei(s)}}}catch(s){if(p.abortSignal?.aborted){if(r.isError()){let u={method:p.method,url:lr(o)};r.error("HTTP request was aborted",u)}return{ok:!1,error:{reason:"unknown",errorMessage:"The user aborted a request"},rawResponse:br}}else if(s instanceof Error&&s.name==="AbortError"){if(r.isError()){let u={method:p.method,url:lr(o),timeoutMs:p.timeoutMs};r.error("HTTP request timed out",u)}return{ok:!1,error:{reason:"timeout"},rawResponse:br}}else if(s instanceof Error){if(r.isError()){let u={method:p.method,url:lr(o),errorMessage:s.message};r.error("HTTP request failed with error",u)}return{ok:!1,error:{reason:"unknown",errorMessage:s.message},rawResponse:zr}}if(r.isError()){let u={method:p.method,url:lr(o),error:me(s)};r.error("HTTP request failed with unknown error",u)}return{ok:!1,error:{reason:"unknown",errorMessage:me(s)},rawResponse:zr}}}var S=Lh;var R=class p extends Promise{constructor(o){super(i=>{i(void 0)}),this.innerPromise=o}static fromFunction(o,...i){return new p(o(...i))}static interceptFunction(o){return(...i)=>p.fromPromise(o(...i))}static fromPromise(o){return new p(o)}static fromExecutor(o){let i=new Promise(o);return new p(i)}static fromResult(o){let i=Promise.resolve(o);return new p(i)}unwrap(){return this.unwrappedPromise||(this.unwrappedPromise=this.innerPromise.then(({data:o})=>o)),this.unwrappedPromise}then(o,i){return this.unwrap().then(o,i)}catch(o){return this.unwrap().catch(o)}finally(o){return this.unwrap().finally(o)}async withRawResponse(){return await this.innerPromise}};var h={get:async p=>typeof p=="function"?p():p};var hi={};Ke(hi,{ConsoleLogger:()=>Xr,LogLevel:()=>Te,Logger:()=>gr,createLogger:()=>qo});var e={};Ke(e,{JsonError:()=>Rr,ParseError:()=>fr,any:()=>Xa,bigint:()=>Fa,boolean:()=>es,booleanLiteral:()=>Qa,date:()=>Ia,discriminant:()=>ps,enum_:()=>yi,getObjectLikeUtils:()=>ve,getObjectUtils:()=>pr,getSchemaUtils:()=>I,isProperty:()=>$e,lazy:()=>Ka,lazyObject:()=>Za,list:()=>bi,never:()=>rs,number:()=>is,object:()=>wi,objectWithoutOptionalProperties:()=>$a,optional:()=>Lo,property:()=>La,record:()=>ss,set:()=>ns,string:()=>os,stringLiteral:()=>Ya,transform:()=>Wo,undiscriminatedUnion:()=>ls,union:()=>ds,unknown:()=>ts,withParsedProperties:()=>Ho});var q={BIGINT:"bigint",DATE:"date",ENUM:"enum",LIST:"list",STRING_LITERAL:"stringLiteral",BOOLEAN_LITERAL:"booleanLiteral",OBJECT:"object",ANY:"any",BOOLEAN:"boolean",NUMBER:"number",STRING:"string",UNKNOWN:"unknown",NEVER:"never",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",NULLABLE:"nullable",OPTIONAL:"optional",OPTIONAL_NULLABLE:"optionalNullable"};function F(p,o){return`Expected ${o}. Received ${Wh(p)}.`}function Wh(p){if(Array.isArray(p))return"list";if(p===null)return"null";if(p instanceof BigInt)return"BigInt";switch(typeof p){case"string":return`"${p}"`;case"bigint":case"number":case"boolean":case"undefined":return`${p}`}return typeof p}function ne(p){return{...p,json:Ma(p.json),parse:Ma(p.parse)}}function Ma(p){return(o,i)=>{let a=p(o,i),{skipValidation:n=!1}=i??{};return!a.ok&&n?(console.warn(["Failed to validate.",...a.errors.map(r=>" - "+(r.path.length>0?`${r.path.join(".")}: ${r.message}`:r.message))].join(`
|
|
3
|
-
`)),{ok:!0,value:o}):a}}function gi(p){return p.path.length===0?p.message:`${p.path.join(" -> ")}: ${p.message}`}var Rr=class p extends Error{constructor(i){super(i.map(gi).join("; "));this.errors=i;Object.setPrototypeOf(this,p.prototype)}};var fr=class p extends Error{constructor(i){super(i.map(gi).join("; "));this.errors=i;Object.setPrototypeOf(this,p.prototype)}};function I(p){return{nullable:()=>Nh(p),optional:()=>Lo(p),optionalNullable:()=>Hh(p),transform:o=>Wo(p,o),parseOrThrow:(o,i)=>{let a=p.parse(o,i);if(a.ok)return a.value;throw new fr(a.errors)},jsonOrThrow:(o,i)=>{let a=p.json(o,i);if(a.ok)return a.value;throw new Rr(a.errors)}}}function Nh(p){let o={parse:(i,a)=>i==null?{ok:!0,value:null}:p.parse(i,a),json:(i,a)=>i==null?{ok:!0,value:null}:p.json(i,a),getType:()=>q.NULLABLE};return{...o,...I(o)}}function Lo(p){let o={parse:(i,a)=>i==null?{ok:!0,value:void 0}:p.parse(i,a),json:(i,a)=>a?.omitUndefined&&i===void 0?{ok:!0,value:void 0}:i==null?{ok:!0,value:null}:p.json(i,a),getType:()=>q.OPTIONAL};return{...o,...I(o)}}function Hh(p){let o={parse:(i,a)=>i===void 0?{ok:!0,value:void 0}:i===null?{ok:!0,value:null}:p.parse(i,a),json:(i,a)=>i===void 0?{ok:!0,value:void 0}:i===null?{ok:!0,value:null}:p.json(i,a),getType:()=>q.OPTIONAL_NULLABLE};return{...o,...I(o)}}function Wo(p,o){let i={parse:(a,n)=>{let r=p.parse(a,n);return r.ok?{ok:!0,value:o.transform(r.value)}:r},json:(a,n)=>{let r=o.untransform(a);return p.json(r,n)},getType:()=>p.getType()};return{...i,...I(i)}}function Fa(){let p={parse:(o,{breadcrumbsPrefix:i=[]}={})=>typeof o=="bigint"?{ok:!0,value:o}:typeof o=="number"?{ok:!0,value:BigInt(o)}:{ok:!1,errors:[{path:i,message:F(o,"bigint | number")}]},json:(o,{breadcrumbsPrefix:i=[]}={})=>typeof o!="bigint"?{ok:!1,errors:[{path:i,message:F(o,"bigint")}]}:{ok:!0,value:o},getType:()=>q.BIGINT};return{...ne(p),...I(p)}}var $h=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;function Ia(){let p={parse:(o,{breadcrumbsPrefix:i=[]}={})=>typeof o!="string"?{ok:!1,errors:[{path:i,message:F(o,"string")}]}:$h.test(o)?{ok:!0,value:new Date(o)}:{ok:!1,errors:[{path:i,message:F(o,"ISO 8601 date string")}]},json:(o,{breadcrumbsPrefix:i=[]}={})=>o instanceof Date?{ok:!0,value:o.toISOString()}:{ok:!1,errors:[{path:i,message:F(o,"Date object")}]},getType:()=>q.DATE};return{...ne(p),...I(p)}}function ce(p,o){return()=>{let i={parse:o,json:o,getType:()=>p};return{...ne(i),...I(i)}}}function yi(p){let o=new Set(p);return ce(q.ENUM,(a,{allowUnrecognizedEnumValues:n,breadcrumbsPrefix:r=[]}={})=>typeof a!="string"?{ok:!1,errors:[{path:r,message:F(a,"string")}]}:!o.has(a)&&!n?{ok:!1,errors:[{path:r,message:F(a,"enum")}]}:{ok:!0,value:a})()}function Ka(p){let o=No(p);return{...o,...I(o)}}function No(p){return{parse:(o,i)=>_r(p).parse(o,i),json:(o,i)=>_r(p).json(o,i),getType:()=>_r(p).getType()}}function _r(p){let o=p;return o.__zurg_memoized==null&&(o.__zurg_memoized=p()),o.__zurg_memoized}function ri(p){return Object.entries(p)}function ii(p,o){let i=new Set(o);return Object.entries(p).reduce((a,[n,r])=>(i.has(n)&&(a[n]=r),a),{})}function Ge(p){if(typeof p!="object"||p===null)return!1;if(Object.getPrototypeOf(p)===null)return!0;let o=p;for(;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return Object.getPrototypeOf(p)===o}function oi(p){return Object.keys(p)}function Ga(p,o){let i=[],a=[];for(let n of p)o(n)?i.push(n):a.push(n);return[i,a]}function ve(p){return{withParsedProperties:o=>Ho(p,o)}}function Ho(p,o){let i={parse:(a,n)=>{let r=p.parse(a,n);if(!r.ok)return r;let s=Object.entries(o).reduce((u,[g,d])=>({...u,[g]:typeof d=="function"?d(r.value):d}),{});return{ok:!0,value:{...r.value,...s}}},json:(a,n)=>{if(!Ge(a))return{ok:!1,errors:[{path:n?.breadcrumbsPrefix??[],message:F(a,"object")}]};let r=new Set(Object.keys(o)),s=ii(a,Object.keys(a).filter(u=>!r.has(u)));return p.json(s,n)},getType:()=>p.getType()};return{...i,...I(i),...ve(i)}}function La(p,o){return{rawKey:p,valueSchema:o,isProperty:!0}}function $e(p){return p.isProperty}function wi(p){let o={_getRawProperties:()=>Object.entries(p).map(([i,a])=>$e(a)?a.rawKey:i),_getParsedProperties:()=>oi(p),parse:(i,a)=>{let n={},r=[];for(let[s,u]of ri(p)){let g=$e(u)?u.rawKey:s,d=$e(u)?u.valueSchema:u,l={rawKey:g,parsedKey:s,valueSchema:d};n[g]=l,Ha(d)&&r.push(g)}return Wa({value:i,requiredKeys:r,getProperty:s=>{let u=n[s];if(u!=null)return{transformedKey:u.parsedKey,transform:g=>u.valueSchema.parse(g,{...a,breadcrumbsPrefix:[...a?.breadcrumbsPrefix??[],s]})}},unrecognizedObjectKeys:a?.unrecognizedObjectKeys,skipValidation:a?.skipValidation,breadcrumbsPrefix:a?.breadcrumbsPrefix,omitUndefined:a?.omitUndefined})},json:(i,a)=>{let n=[];for(let[r,s]of ri(p)){let u=$e(s)?s.valueSchema:s;Ha(u)&&n.push(r)}return Wa({value:i,requiredKeys:n,getProperty:r=>{let s=p[r];if(s!=null)return $e(s)?{transformedKey:s.rawKey,transform:u=>s.valueSchema.json(u,{...a,breadcrumbsPrefix:[...a?.breadcrumbsPrefix??[],r]})}:{transformedKey:r,transform:u=>s.json(u,{...a,breadcrumbsPrefix:[...a?.breadcrumbsPrefix??[],r]})}},unrecognizedObjectKeys:a?.unrecognizedObjectKeys,skipValidation:a?.skipValidation,breadcrumbsPrefix:a?.breadcrumbsPrefix,omitUndefined:a?.omitUndefined})},getType:()=>q.OBJECT};return{...ne(o),...I(o),...ve(o),...pr(o)}}function Wa({value:p,requiredKeys:o,getProperty:i,unrecognizedObjectKeys:a="fail",skipValidation:n=!1,breadcrumbsPrefix:r=[]}){if(!Ge(p))return{ok:!1,errors:[{path:r,message:F(p,"object")}]};let s=new Set(o),u=[],g={};for(let[d,l]of Object.entries(p)){let m=i(d);if(m!=null){s.delete(d);let y=m.transform(l);y.ok?g[m.transformedKey]=y.value:(g[d]=l,u.push(...y.errors))}else switch(a){case"fail":u.push({path:[...r,d],message:`Unexpected key "${d}"`});break;case"strip":break;case"passthrough":g[d]=l;break}}return u.push(...o.filter(d=>s.has(d)).map(d=>({path:r,message:`Missing required key "${d}"`}))),u.length===0||n?{ok:!0,value:g}:{ok:!1,errors:u}}function pr(p){return{extend:o=>{let i={_getParsedProperties:()=>[...p._getParsedProperties(),...o._getParsedProperties()],_getRawProperties:()=>[...p._getRawProperties(),...o._getRawProperties()],parse:(a,n)=>Na({extensionKeys:o._getRawProperties(),value:a,transformBase:r=>p.parse(r,n),transformExtension:r=>o.parse(r,n),breadcrumbsPrefix:n?.breadcrumbsPrefix}),json:(a,n)=>Na({extensionKeys:o._getParsedProperties(),value:a,transformBase:r=>p.json(r,n),transformExtension:r=>o.json(r,n),breadcrumbsPrefix:n?.breadcrumbsPrefix}),getType:()=>q.OBJECT};return{...i,...I(i),...ve(i),...pr(i)}},passthrough:()=>{let o={_getParsedProperties:()=>p._getParsedProperties(),_getRawProperties:()=>p._getRawProperties(),parse:(i,a)=>{let n=p.parse(i,{...a,unrecognizedObjectKeys:"passthrough"});return n.ok?{ok:!0,value:{...i,...n.value}}:n},json:(i,a)=>{let n=p.json(i,{...a,unrecognizedObjectKeys:"passthrough"});return n.ok?{ok:!0,value:{...i,...n.value}}:n},getType:()=>q.OBJECT};return{...o,...I(o),...ve(o),...pr(o)}}}}function Na({extensionKeys:p,value:o,transformBase:i,transformExtension:a,breadcrumbsPrefix:n=[]}){if(!Ge(o))return{ok:!1,errors:[{path:n,message:F(o,"object")}]};let r=new Set(p),[s,u]=Ga(oi(o),l=>r.has(l)),g=i(ii(o,u)),d=a(ii(o,s));return g.ok&&d.ok?{ok:!0,value:{...g.value,...d.value}}:{ok:!1,errors:[...g.ok?[]:g.errors,...d.ok?[]:d.errors]}}function Ha(p){return!Zh(p)}function Zh(p){switch(p.getType()){case q.ANY:case q.UNKNOWN:case q.OPTIONAL:case q.OPTIONAL_NULLABLE:return!0;default:return!1}}function $a(p){return wi(p)}function Za(p){let o={...No(p),_getRawProperties:()=>_r(p)._getRawProperties(),_getParsedProperties:()=>_r(p)._getParsedProperties()};return{...o,...I(o),...ve(o),...pr(o)}}function bi(p){let o={parse:(i,a)=>Ja(i,(n,r)=>p.parse(n,{...a,breadcrumbsPrefix:[...a?.breadcrumbsPrefix??[],`[${r}]`]})),json:(i,a)=>Ja(i,(n,r)=>p.json(n,{...a,breadcrumbsPrefix:[...a?.breadcrumbsPrefix??[],`[${r}]`]})),getType:()=>q.LIST};return{...ne(o),...I(o)}}function Ja(p,o){return Array.isArray(p)?p.map((a,n)=>o(a,n)).reduce((a,n)=>{if(a.ok&&n.ok)return{ok:!0,value:[...a.value,n.value]};let r=[];return a.ok||r.push(...a.errors),n.ok||r.push(...n.errors),{ok:!1,errors:r}},{ok:!0,value:[]}):{ok:!1,errors:[{message:F(p,"list"),path:[]}]}}function Qa(p){return ce(q.BOOLEAN_LITERAL,(i,{breadcrumbsPrefix:a=[]}={})=>i===p?{ok:!0,value:p}:{ok:!1,errors:[{path:a,message:F(i,`${p.toString()}`)}]})()}function Ya(p){return ce(q.STRING_LITERAL,(i,{breadcrumbsPrefix:a=[]}={})=>i===p?{ok:!0,value:p}:{ok:!1,errors:[{path:a,message:F(i,`"${p}"`)}]})()}var Xa=ce(q.ANY,p=>({ok:!0,value:p}));var es=ce(q.BOOLEAN,(p,{breadcrumbsPrefix:o=[]}={})=>typeof p=="boolean"?{ok:!0,value:p}:{ok:!1,errors:[{path:o,message:F(p,"boolean")}]});var rs=ce(q.NEVER,(p,{breadcrumbsPrefix:o=[]}={})=>({ok:!1,errors:[{path:o,message:"Expected never"}]}));var is=ce(q.NUMBER,(p,{breadcrumbsPrefix:o=[]}={})=>typeof p=="number"?{ok:!0,value:p}:{ok:!1,errors:[{path:o,message:F(p,"number")}]});var os=ce(q.STRING,(p,{breadcrumbsPrefix:o=[]}={})=>typeof p=="string"?{ok:!0,value:p}:{ok:!1,errors:[{path:o,message:F(p,"string")}]});var ts=ce(q.UNKNOWN,p=>({ok:!0,value:p}));function ss(p,o){let i={parse:(a,n)=>as({value:a,isKeyNumeric:p.getType()===q.NUMBER,transformKey:r=>p.parse(r,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${r} (key)`]}),transformValue:(r,s)=>o.parse(r,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:n?.breadcrumbsPrefix}),json:(a,n)=>as({value:a,isKeyNumeric:p.getType()===q.NUMBER,transformKey:r=>p.json(r,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${r} (key)`]}),transformValue:(r,s)=>o.json(r,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:n?.breadcrumbsPrefix}),getType:()=>q.RECORD};return{...ne(i),...I(i)}}function as({value:p,isKeyNumeric:o,transformKey:i,transformValue:a,breadcrumbsPrefix:n=[]}){return Ge(p)?ri(p).reduce((r,[s,u])=>{if(u===void 0)return r;let g=r,d=s;if(o){let j=s.length>0?Number(s):NaN;Number.isNaN(j)||(d=j)}let l=i(d),m=a(u,d);if(g.ok&&l.ok&&m.ok)return{ok:!0,value:{...g.value,[l.value]:m.value}};let y=[];return g.ok||y.push(...g.errors),l.ok||y.push(...l.errors),m.ok||y.push(...m.errors),{ok:!1,errors:y}},{ok:!0,value:{}}):{ok:!1,errors:[{path:n,message:F(p,"object")}]}}function ns(p){let o=bi(p),i={parse:(a,n)=>{let r=o.parse(a,n);return r.ok?{ok:!0,value:new Set(r.value)}:r},json:(a,n)=>a instanceof Set?o.json([...a],n):{ok:!1,errors:[{path:n?.breadcrumbsPrefix??[],message:F(a,"Set")}]},getType:()=>q.SET};return{...ne(i),...I(i)}}function ls(p){let o={parse:(i,a)=>cs((n,r)=>n.parse(i,r),p,a),json:(i,a)=>cs((n,r)=>n.json(i,r),p,a),getType:()=>q.UNDISCRIMINATED_UNION};return{...ne(o),...I(o)}}function cs(p,o,i){let a=[];for(let[n,r]of o.entries()){let s=p(r,{...i,skipValidation:!1});if(s.ok)return s;for(let u of s.errors)a.push({path:u.path,message:`[Variant ${n}] ${u.message}`})}return{ok:!1,errors:a}}function ps(p,o){return{parsedDiscriminant:p,rawDiscriminant:o}}function ds(p,o){let i=typeof p=="string"?p:p.rawDiscriminant,a=typeof p=="string"?p:p.parsedDiscriminant,n=yi(oi(o)),r={parse:(s,u)=>us({value:s,discriminant:i,transformedDiscriminant:a,transformDiscriminantValue:g=>n.parse(g,{allowUnrecognizedEnumValues:u?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...u?.breadcrumbsPrefix??[],i]}),getAdditionalPropertiesSchema:g=>o[g],allowUnrecognizedUnionMembers:u?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(g,d)=>d.parse(g,u),breadcrumbsPrefix:u?.breadcrumbsPrefix}),json:(s,u)=>us({value:s,discriminant:a,transformedDiscriminant:i,transformDiscriminantValue:g=>n.json(g,{allowUnrecognizedEnumValues:u?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...u?.breadcrumbsPrefix??[],a]}),getAdditionalPropertiesSchema:g=>o[g],allowUnrecognizedUnionMembers:u?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(g,d)=>d.json(g,u),breadcrumbsPrefix:u?.breadcrumbsPrefix}),getType:()=>q.UNION};return{...ne(r),...I(r),...ve(r)}}function us({value:p,discriminant:o,transformedDiscriminant:i,transformDiscriminantValue:a,getAdditionalPropertiesSchema:n,allowUnrecognizedUnionMembers:r=!1,transformAdditionalProperties:s,breadcrumbsPrefix:u=[]}){if(!Ge(p))return{ok:!1,errors:[{path:u,message:F(p,"object")}]};let{[o]:g,...d}=p;if(g==null)return{ok:!1,errors:[{path:u,message:`Missing discriminant ("${o}")`}]};let l=a(g);if(!l.ok)return{ok:!1,errors:l.errors};let m=n(l.value);if(m==null)return r?{ok:!0,value:{[i]:l.value,...d}}:{ok:!1,errors:[{path:[...u,o],message:"Unexpected discriminant value"}]};let y=s(d,m);return y.ok?{ok:!0,value:{[i]:g,...y.value}}:y}var w={};Ke(w,{encodePathParam:()=>ms,join:()=>gs,toQueryString:()=>yr});function ms(p){if(p===null)return"null";switch(typeof p){case"undefined":return"undefined";case"string":case"number":case"boolean":break;default:p=String(p);break}return encodeURIComponent(p)}function gs(p,...o){if(!p)return"";if(o.length===0)return p;if(p.includes("://")){let i;try{i=new URL(p)}catch{return hs(p,...o)}let n=o[o.length-1]?.endsWith("/");for(let r of o){let s=ws(r);s&&(i.pathname=ys(i.pathname,s))}return n&&!i.pathname.endsWith("/")&&(i.pathname+="/"),i.toString()}return hs(p,...o)}function hs(p,...o){if(o.length===0)return p;let i=p,n=o[o.length-1]?.endsWith("/");for(let r of o){let s=ws(r);s&&(i=ys(i,s))}return n&&!i.endsWith("/")&&(i+="/"),i}function ys(p,o){return p.endsWith("/")?p+o:`${p}/${o}`}function ws(p){if(!p)return p;let o=0,i=p.length;return p.startsWith("/")&&(o=1),p.endsWith("/")&&(i=p.length-1),o===0&&i===p.length?p:p.slice(o,i)}var zi=class{constructor(o){this.headerValue=o.apiKey}static canCreate(o){return o.apiKey!=null}async getAuthRequest(o){let i=await h.get(this.headerValue);if(i==null)throw new z({message:"Please specify a apiKey by passing it in to the constructor"});return{headers:{"X-Schematic-Api-Key":i}}}};function f(...p){let o={};for(let[i,a]of p.filter(n=>n!=null).flatMap(n=>Object.entries(n))){let n=i.toLowerCase();a!=null?o[n]=a:n in o&&delete o[n]}return o}function Jh(p){let o=f({"X-Fern-Language":"JavaScript","X-Fern-SDK-Name":"@schematichq/schematic-typescript-node","X-Fern-SDK-Version":"1.3.1","User-Agent":"@schematichq/schematic-typescript-node/1.3.1","X-Fern-Runtime":he.type,"X-Fern-Runtime-Version":he.version},p?.headers);return{...p,logging:hi.createLogger(p?.logging),headers:o}}function K(p){let o=Jh(p),i=Qh(o);return o.authProvider??=new zi(i),o}function Qh(p){return{...p,authProvider:new Yr}}var _={Default:"https://api.schematichq.com"};function U(p,o,i,a){switch(p.reason){case"non-json":throw new z({statusCode:p.statusCode,body:p.rawBody,rawResponse:o});case"body-is-null":throw new z({statusCode:p.statusCode,rawResponse:o});case"timeout":throw new cr(`Timeout exceeded when calling ${i} ${a}.`);case"unknown":throw new z({message:p.errorMessage,rawResponse:o});default:throw new z({message:"Unknown error",rawResponse:o})}}var $o=e.object({lookup:e.record(e.string(),e.string())});var bs=e.stringLiteral("company");var zs=e.object({apiKeyId:e.property("api_key_id",e.string()),createdAt:e.property("created_at",e.date()),environmentId:e.property("environment_id",e.string()),expiredAt:e.property("expired_at",e.date()),id:e.string(),resourceType:e.property("resource_type",bs),token:e.string(),updatedAt:e.property("updated_at",e.date())});var Rs=e.object({data:zs,params:e.record(e.string(),e.unknown())});var Zo=e.object({description:e.string().optional(),environmentId:e.property("environment_id",e.string().optional()),name:e.string()});var Ze=e.enum_(["development","production","staging"]);var Jo=e.object({environmentType:e.property("environment_type",Ze),name:e.string()});var Qo=e.object({description:e.string().optional(),name:e.string().optional()});var Yo=e.object({environmentType:e.property("environment_type",Ze.optional()),name:e.string().optional()});var fs=e.object({environmentId:e.property("environment_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),requireEnvironment:e.property("require_environment",e.boolean().optional())});var A=e.object({count:e.number().optional()});var _s=e.object({data:A,params:fs});var Ss=e.object({environmentId:e.property("environment_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional(),requestType:e.property("request_type",e.string().optional())});var Ps=e.object({data:A,params:Ss});var Ri=e.enum_(["admin","capture","read","write"]);var xs=e.object({createdAt:e.property("created_at",e.date()),description:e.string().optional(),environmentId:e.property("environment_id",e.string().optional()),id:e.string(),lastUsedAt:e.property("last_used_at",e.date().optional()),name:e.string(),scopes:e.list(Ri),secret:e.string(),updatedAt:e.property("updated_at",e.date())});var Es=e.object({data:xs,params:e.record(e.string(),e.unknown())});var Re=e.object({createdAt:e.property("created_at",e.date()),description:e.string().optional(),environmentId:e.property("environment_id",e.string().optional()),id:e.string(),lastUsedAt:e.property("last_used_at",e.date().optional()),name:e.string(),scopes:e.list(Ri),updatedAt:e.property("updated_at",e.date())});var Cs=e.object({apiKeys:e.property("api_keys",e.list(Re)),createdAt:e.property("created_at",e.date()),environmentType:e.property("environment_type",Ze),id:e.string(),name:e.string(),updatedAt:e.property("updated_at",e.date())});var Us=e.object({data:Cs,params:e.record(e.string(),e.unknown())});var D=e.object({deleted:e.boolean().optional()});var Ts=e.object({data:D,params:e.record(e.string(),e.unknown())});var vs=e.object({data:D,params:e.record(e.string(),e.unknown())});var Os=e.object({data:Re,params:e.record(e.string(),e.unknown())});var js=e.object({apiKey:e.property("api_key",Re.optional()),apiKeyId:e.property("api_key_id",e.string()),endedAt:e.property("ended_at",e.date().optional()),environmentId:e.property("environment_id",e.string().optional()),id:e.string(),method:e.string(),reqBody:e.property("req_body",e.string().optional()),requestType:e.property("request_type",e.string().optional()),resourceId:e.property("resource_id",e.number().optional()),resourceIdString:e.property("resource_id_string",e.string().optional()),resourceName:e.property("resource_name",e.string().optional()),resourceType:e.property("resource_type",e.string().optional()),respBody:e.property("resp_body",e.string().optional()),respCode:e.property("resp_code",e.number().optional()),secondaryResource:e.property("secondary_resource",e.string().optional()),startedAt:e.property("started_at",e.date()),url:e.string(),userAgent:e.property("user_agent",e.string().optional()),userId:e.property("user_id",e.string().optional()),userName:e.property("user_name",e.string().optional())});var ks=e.object({data:js,params:e.record(e.string(),e.unknown())});var Sr=e.object({createdAt:e.property("created_at",e.date()),environmentType:e.property("environment_type",Ze),id:e.string(),name:e.string(),updatedAt:e.property("updated_at",e.date())});var Bs=e.object({data:Sr,params:e.record(e.string(),e.unknown())});var As=e.object({environmentId:e.property("environment_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),requireEnvironment:e.property("require_environment",e.boolean().optional())});var Vs=e.object({data:e.list(Re),params:As});var qs=e.object({environmentId:e.property("environment_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional(),requestType:e.property("request_type",e.string().optional())});var fi=e.object({apiKeyId:e.property("api_key_id",e.string()),endedAt:e.property("ended_at",e.date().optional()),environmentId:e.property("environment_id",e.string().optional()),id:e.string(),method:e.string(),reqBody:e.property("req_body",e.string().optional()),requestType:e.property("request_type",e.string().optional()),resourceId:e.property("resource_id",e.number().optional()),resourceIdString:e.property("resource_id_string",e.string().optional()),resourceName:e.property("resource_name",e.string().optional()),resourceType:e.property("resource_type",e.string().optional()),respCode:e.property("resp_code",e.number().optional()),secondaryResource:e.property("secondary_resource",e.string().optional()),startedAt:e.property("started_at",e.date()),url:e.string(),userName:e.property("user_name",e.string().optional())});var Ds=e.object({data:e.list(fi),params:qs});var Ms=e.object({ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional()});var Fs=e.object({data:e.list(Sr),params:Ms});var Is=e.object({ok:e.boolean()});var Ks=e.object({data:Is,params:e.record(e.string(),e.unknown())});var Gs=e.object({data:Re,params:e.record(e.string(),e.unknown())});var Ls=e.object({data:Sr,params:e.record(e.string(),e.unknown())});var B=e.enum_(["schematic","stripe"]);var Xo=e.object({companyId:e.property("company_id",e.string().optional()),defaultPaymentMethodId:e.property("default_payment_method_id",e.string().optional()),email:e.string(),externalId:e.property("external_id",e.string()),meta:e.record(e.string(),e.string()),name:e.string(),providerType:e.property("provider_type",B.optional())});var ke=e.enum_(["per_unit","tiered"]);var Z=e.enum_(["licensed","metered"]);var ie=e.enum_(["graduated","volume"]);var Ws=e.object({flatAmount:e.property("flat_amount",e.number().optional()),perUnitDecimal:e.property("per_unit_decimal",e.string().optional()),perUnitPrice:e.property("per_unit_price",e.number().optional()),priceExternalId:e.property("price_external_id",e.string()),providerType:e.property("provider_type",B.optional()),upTo:e.property("up_to",e.number().optional())});var et=e.object({billingScheme:e.property("billing_scheme",ke),currency:e.string(),externalAccountId:e.property("external_account_id",e.string()),interval:e.string(),isActive:e.property("is_active",e.boolean()),meterId:e.property("meter_id",e.string().optional()),packageSize:e.property("package_size",e.number().optional()),price:e.number(),priceDecimal:e.property("price_decimal",e.string().optional()),priceExternalId:e.property("price_external_id",e.string()),priceTiers:e.property("price_tiers",e.list(Ws)),productExternalId:e.property("product_external_id",e.string()),providerType:e.property("provider_type",B.optional()),tiersMode:e.property("tiers_mode",ie.optional()),usageType:e.property("usage_type",Z)});var rt=e.object({externalId:e.property("external_id",e.string()),isActive:e.property("is_active",e.boolean().optional()),name:e.string(),price:e.number(),providerType:e.property("provider_type",B.optional())});var Ns=e.object({billingThreshold:e.property("billing_threshold",e.number().optional()),currency:e.string(),interval:e.string(),meterId:e.property("meter_id",e.string().optional()),packageSize:e.property("package_size",e.number().optional()),price:e.number(),priceDecimal:e.property("price_decimal",e.string().optional()),priceExternalId:e.property("price_external_id",e.string()),productExternalId:e.property("product_external_id",e.string()),quantity:e.number(),subscriptionItemExternalId:e.property("subscription_item_external_id",e.string().optional()),usageType:e.property("usage_type",Z)});var Hs=e.object({couponExternalId:e.property("coupon_external_id",e.string()),customerFacingCode:e.property("customer_facing_code",e.string().optional()),endedAt:e.property("ended_at",e.date().optional()),externalId:e.property("external_id",e.string()),isActive:e.property("is_active",e.boolean()),promoCodeExternalId:e.property("promo_code_external_id",e.string().optional()),startedAt:e.property("started_at",e.date())});var Je=e.enum_(["cancel","subscribe"]);var it=e.object({applicationId:e.property("application_id",e.string().optional()),cancelAt:e.property("cancel_at",e.number().optional()),cancelAtPeriodEnd:e.property("cancel_at_period_end",e.boolean()),currency:e.string(),customerExternalId:e.property("customer_external_id",e.string()),defaultPaymentMethodExternalId:e.property("default_payment_method_external_id",e.string().optional()),defaultPaymentMethodId:e.property("default_payment_method_id",e.string().optional()),discounts:e.list(Hs),expiredAt:e.property("expired_at",e.date()),interval:e.string().optional(),metadata:e.record(e.string(),e.unknown()).optional(),periodEnd:e.property("period_end",e.number().optional()),periodStart:e.property("period_start",e.number().optional()),productExternalIds:e.property("product_external_ids",e.list(Ns)),status:e.string().optional(),subscriptionExternalId:e.property("subscription_external_id",e.string()),totalPrice:e.property("total_price",e.number()),trialEnd:e.property("trial_end",e.number().optional()),trialEndSetting:e.property("trial_end_setting",Je.optional())});var ot=e.object({amountOff:e.property("amount_off",e.number()),currency:e.string().optional(),duration:e.string(),durationInMonths:e.property("duration_in_months",e.number()),externalId:e.property("external_id",e.string()),maxRedemptions:e.property("max_redemptions",e.number()),name:e.string(),percentOff:e.property("percent_off",e.number()),timesRedeemed:e.property("times_redeemed",e.number())});var tt=e.object({amountDue:e.property("amount_due",e.number()),amountPaid:e.property("amount_paid",e.number()),amountRemaining:e.property("amount_remaining",e.number()),collectionMethod:e.property("collection_method",e.string()),currency:e.string(),customerExternalId:e.property("customer_external_id",e.string()),dueDate:e.property("due_date",e.date().optional()),externalId:e.property("external_id",e.string().optional()),paymentMethodExternalId:e.property("payment_method_external_id",e.string().optional()),subscriptionExternalId:e.property("subscription_external_id",e.string().optional()),subtotal:e.number(),url:e.string().optional()});var at=e.object({displayName:e.property("display_name",e.string()),eventName:e.property("event_name",e.string()),eventPayloadKey:e.property("event_payload_key",e.string()),externalId:e.property("external_id",e.string())});var st=e.object({accountLast4:e.property("account_last4",e.string().optional()),accountName:e.property("account_name",e.string().optional()),bankName:e.property("bank_name",e.string().optional()),billingEmail:e.property("billing_email",e.string().optional()),billingName:e.property("billing_name",e.string().optional()),cardBrand:e.property("card_brand",e.string().optional()),cardExpMonth:e.property("card_exp_month",e.number().optional()),cardExpYear:e.property("card_exp_year",e.number().optional()),cardLast4:e.property("card_last4",e.string().optional()),customerExternalId:e.property("customer_external_id",e.string()),externalId:e.property("external_id",e.string()),paymentMethodType:e.property("payment_method_type",e.string())});var $s=e.object({ids:e.list(e.string()).optional(),isActive:e.property("is_active",e.boolean().optional()),limit:e.number().optional(),name:e.string().optional(),offset:e.number().optional(),priceUsageType:e.property("price_usage_type",Z.optional()),providerType:e.property("provider_type",B.optional()),q:e.string().optional(),withOneTimeCharges:e.property("with_one_time_charges",e.boolean().optional()),withPricesOnly:e.property("with_prices_only",e.boolean().optional()),withZeroPrice:e.property("with_zero_price",e.boolean().optional()),withoutLinkedToPlan:e.property("without_linked_to_plan",e.boolean().optional())});var Zs=e.object({data:A,params:$s});var Js=e.object({companyIds:e.property("company_ids",e.list(e.string()).optional()),limit:e.number().optional(),name:e.string().optional(),offset:e.number().optional(),providerType:e.property("provider_type",B.optional()),q:e.string().optional()});var Qs=e.object({data:A,params:Js});var Ys=e.object({data:D,params:e.record(e.string(),e.unknown())});var Xs=e.object({data:D,params:e.record(e.string(),e.unknown())});var en=e.object({forInitialPlan:e.property("for_initial_plan",e.boolean().optional()),forTrialExpiryPlan:e.property("for_trial_expiry_plan",e.boolean().optional()),ids:e.list(e.string()).optional(),interval:e.string().optional(),isActive:e.property("is_active",e.boolean().optional()),limit:e.number().optional(),offset:e.number().optional(),price:e.number().optional(),productId:e.property("product_id",e.string().optional()),productIds:e.property("product_ids",e.list(e.string()).optional()),providerType:e.property("provider_type",B.optional()),q:e.string().optional(),tiersMode:e.property("tiers_mode",ie.optional()),usageType:e.property("usage_type",Z.optional()),withMeter:e.property("with_meter",e.boolean().optional())});var Pr=e.enum_(["day","month","one-time","year"]);var _i=e.object({flatAmount:e.property("flat_amount",e.number().optional()),perUnitPrice:e.property("per_unit_price",e.number().optional()),perUnitPriceDecimal:e.property("per_unit_price_decimal",e.string().optional()),upTo:e.property("up_to",e.number().optional())});var J=e.object({billingScheme:e.property("billing_scheme",ke),createdAt:e.property("created_at",e.date()),currency:e.string(),id:e.string(),interval:Pr,isActive:e.property("is_active",e.boolean()),meterEventName:e.property("meter_event_name",e.string().optional()),meterEventPayloadKey:e.property("meter_event_payload_key",e.string().optional()),meterId:e.property("meter_id",e.string().optional()),packageSize:e.property("package_size",e.number()),price:e.number(),priceDecimal:e.property("price_decimal",e.string().optional()),priceExternalId:e.property("price_external_id",e.string()),priceId:e.property("price_id",e.string()),priceTier:e.property("price_tier",e.list(_i)),productExternalId:e.property("product_external_id",e.string()),productId:e.property("product_id",e.string()),productName:e.property("product_name",e.string()),providerType:e.property("provider_type",B),tiersMode:e.property("tiers_mode",ie.optional()),updatedAt:e.property("updated_at",e.date()),usageType:e.property("usage_type",Z)});var rn=e.object({data:e.list(J),params:en});var on=e.object({forInitialPlan:e.property("for_initial_plan",e.boolean().optional()),forTrialExpiryPlan:e.property("for_trial_expiry_plan",e.boolean().optional()),ids:e.list(e.string()).optional(),interval:e.string().optional(),isActive:e.property("is_active",e.boolean().optional()),limit:e.number().optional(),offset:e.number().optional(),price:e.number().optional(),productId:e.property("product_id",e.string().optional()),productIds:e.property("product_ids",e.list(e.string()).optional()),providerType:e.property("provider_type",B.optional()),q:e.string().optional(),tiersMode:e.property("tiers_mode",ie.optional()),usageType:e.property("usage_type",Z.optional()),withMeter:e.property("with_meter",e.boolean().optional())});var tn=e.object({data:e.list(J),params:on});var an=e.object({ids:e.list(e.string()).optional(),isActive:e.property("is_active",e.boolean().optional()),limit:e.number().optional(),name:e.string().optional(),offset:e.number().optional(),priceUsageType:e.property("price_usage_type",Z.optional()),providerType:e.property("provider_type",B.optional()),q:e.string().optional(),withOneTimeCharges:e.property("with_one_time_charges",e.boolean().optional()),withPricesOnly:e.property("with_prices_only",e.boolean().optional()),withZeroPrice:e.property("with_zero_price",e.boolean().optional()),withoutLinkedToPlan:e.property("without_linked_to_plan",e.boolean().optional())});var Q=e.object({currency:e.string(),externalPriceId:e.property("external_price_id",e.string()),id:e.string(),interval:Pr,price:e.number(),priceDecimal:e.property("price_decimal",e.string().optional()),providerType:e.property("provider_type",B),scheme:ke});var Qe=e.object({accountId:e.property("account_id",e.string()),createdAt:e.property("created_at",e.date()),currency:e.string().optional(),environmentId:e.property("environment_id",e.string()),externalId:e.property("external_id",e.string()),isActive:e.property("is_active",e.boolean()),name:e.string(),price:e.number(),priceDecimal:e.property("price_decimal",e.string().optional()),prices:e.list(Q),productId:e.property("product_id",e.string()),providerType:e.property("provider_type",B),quantity:e.number(),subscriptionCount:e.property("subscription_count",e.number()),updatedAt:e.property("updated_at",e.date())});var sn=e.object({data:e.list(Qe),params:an});var nn=e.object({isActive:e.property("is_active",e.boolean().optional()),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var Si=e.object({accountId:e.property("account_id",e.string()),amountOff:e.property("amount_off",e.number().optional()),currency:e.string().optional(),duration:e.string().optional(),durationInMonths:e.property("duration_in_months",e.number().optional()),environmentId:e.property("environment_id",e.string()),externalId:e.property("external_id",e.string()),id:e.string(),isActive:e.property("is_active",e.boolean()),maxRedemptions:e.property("max_redemptions",e.number().optional()),metadata:e.record(e.string(),e.unknown()),name:e.string(),percentOff:e.property("percent_off",e.number().optional()),providerType:e.property("provider_type",B),timesRedeemed:e.property("times_redeemed",e.number()),validFrom:e.property("valid_from",e.date().optional()),validUntil:e.property("valid_until",e.date().optional())});var cn=e.object({data:e.list(Si),params:nn});var ln=e.object({companyIds:e.property("company_ids",e.list(e.string()).optional()),limit:e.number().optional(),name:e.string().optional(),offset:e.number().optional(),providerType:e.property("provider_type",B.optional()),q:e.string().optional()});var pn=e.object({currency:e.string(),expiredAt:e.property("expired_at",e.date().optional()),interval:e.string(),meteredUsage:e.property("metered_usage",e.boolean()),perUnitPrice:e.property("per_unit_price",e.number()),totalPrice:e.property("total_price",e.number())});var un=e.object({companyId:e.property("company_id",e.string().optional()),deletedAt:e.property("deleted_at",e.date().optional()),email:e.string(),externalId:e.property("external_id",e.string()),id:e.string(),name:e.string(),providerType:e.property("provider_type",B),subscriptions:e.list(pn),updatedAt:e.property("updated_at",e.date())});var dn=e.object({data:e.list(un),params:ln});var mn=e.object({companyId:e.property("company_id",e.string().optional()),customerExternalId:e.property("customer_external_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),subscriptionExternalId:e.property("subscription_external_id",e.string().optional())});var Oe=e.object({amountDue:e.property("amount_due",e.number()),amountPaid:e.property("amount_paid",e.number()),amountRemaining:e.property("amount_remaining",e.number()),collectionMethod:e.property("collection_method",e.string()),companyId:e.property("company_id",e.string().optional()),createdAt:e.property("created_at",e.date()),currency:e.string(),customerExternalId:e.property("customer_external_id",e.string()),dueDate:e.property("due_date",e.date().optional()),environmentId:e.property("environment_id",e.string()),externalId:e.property("external_id",e.string().optional()),id:e.string(),paymentMethodExternalId:e.property("payment_method_external_id",e.string().optional()),providerType:e.property("provider_type",B),subscriptionExternalId:e.property("subscription_external_id",e.string().optional()),subtotal:e.number(),updatedAt:e.property("updated_at",e.date()),url:e.string().optional()});var hn=e.object({data:e.list(Oe),params:mn});var gn=e.object({displayName:e.property("display_name",e.string().optional()),limit:e.number().optional(),offset:e.number().optional()});var Pi=e.object({dispalyName:e.property("dispaly_name",e.string()),eventName:e.property("event_name",e.string()),eventPayloadKey:e.property("event_payload_key",e.string()),externalPriceId:e.property("external_price_id",e.string()),id:e.string(),providerType:e.property("provider_type",B)});var yn=e.object({data:e.list(Pi),params:gn});var wn=e.object({companyId:e.property("company_id",e.string().optional()),customerExternalId:e.property("customer_external_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional()});var ge=e.object({accountLast4:e.property("account_last4",e.string().optional()),accountName:e.property("account_name",e.string().optional()),bankName:e.property("bank_name",e.string().optional()),billingEmail:e.property("billing_email",e.string().optional()),billingName:e.property("billing_name",e.string().optional()),cardBrand:e.property("card_brand",e.string().optional()),cardExpMonth:e.property("card_exp_month",e.number().optional()),cardExpYear:e.property("card_exp_year",e.number().optional()),cardLast4:e.property("card_last4",e.string().optional()),companyId:e.property("company_id",e.string().optional()),createdAt:e.property("created_at",e.date()),customerExternalId:e.property("customer_external_id",e.string()),environmentId:e.property("environment_id",e.string()),externalId:e.property("external_id",e.string()),id:e.string(),paymentMethodType:e.property("payment_method_type",e.string()),providerType:e.property("provider_type",B),updatedAt:e.property("updated_at",e.date())});var bn=e.object({data:e.list(ge),params:wn});var zn=e.object({data:Si,params:e.record(e.string(),e.unknown())});var Rn=e.object({companyId:e.property("company_id",e.string().optional()),deletedAt:e.property("deleted_at",e.date().optional()),email:e.string(),externalId:e.property("external_id",e.string()),id:e.string(),name:e.string(),providerType:e.property("provider_type",B),updatedAt:e.property("updated_at",e.date())});var fn=e.object({data:Rn,params:e.record(e.string(),e.unknown())});var _n=e.object({data:Pi,params:e.record(e.string(),e.unknown())});var Sn=e.object({data:Q,params:e.record(e.string(),e.unknown())});var xr=e.object({accountId:e.property("account_id",e.string()),createdAt:e.property("created_at",e.date()),currency:e.string().optional(),environmentId:e.property("environment_id",e.string()),externalId:e.property("external_id",e.string()),isActive:e.property("is_active",e.boolean()),name:e.string(),price:e.number(),priceDecimal:e.property("price_decimal",e.string().optional()),productId:e.property("product_id",e.string()),providerType:e.property("provider_type",B),quantity:e.number(),updatedAt:e.property("updated_at",e.date())});var Pn=e.object({data:xr,params:e.record(e.string(),e.unknown())});var xn=e.object({applicationId:e.property("application_id",e.string().optional()),cancelAt:e.property("cancel_at",e.number().optional()),cancelAtPeriodEnd:e.property("cancel_at_period_end",e.boolean()),companyId:e.property("company_id",e.string().optional()),createdAt:e.property("created_at",e.date()),currency:e.string(),customerExternalId:e.property("customer_external_id",e.string()),defaultPaymentMethodId:e.property("default_payment_method_id",e.string().optional()),expiredAt:e.property("expired_at",e.date().optional()),id:e.string(),interval:e.string(),metadata:e.record(e.string(),e.unknown()).optional(),periodEnd:e.property("period_end",e.number()),periodStart:e.property("period_start",e.number()),providerType:e.property("provider_type",B),status:e.string(),subscriptionExternalId:e.property("subscription_external_id",e.string()),totalPrice:e.property("total_price",e.number()),trialEnd:e.property("trial_end",e.number().optional()),trialEndSetting:e.property("trial_end_setting",Je.optional())});var En=e.object({data:xn,params:e.record(e.string(),e.unknown())});var Cn=e.object({data:Oe,params:e.record(e.string(),e.unknown())});var Un=e.object({data:ge,params:e.record(e.string(),e.unknown())});var nt=e.object({cancelImmediately:e.property("cancel_immediately",e.boolean().optional()),companyId:e.property("company_id",e.string()),prorate:e.boolean().optional()});var ct=e.object({companyId:e.property("company_id",e.string()),selectedPlanId:e.property("selected_plan_id",e.string().optional())});var lt=e.object({trialEnd:e.property("trial_end",e.date().optional())});var xi=e.object({billingScheme:e.property("billing_scheme",ke),billingThreshold:e.property("billing_threshold",e.number().optional()),createdAt:e.property("created_at",e.date()),currency:e.string(),environmentId:e.property("environment_id",e.string()),externalId:e.property("external_id",e.string()),id:e.string(),interval:e.string(),meterId:e.property("meter_id",e.string().optional()),name:e.string(),packageSize:e.property("package_size",e.number()),price:e.number(),priceDecimal:e.property("price_decimal",e.string().optional()),priceExternalId:e.property("price_external_id",e.string()),priceId:e.property("price_id",e.string()),priceTier:e.property("price_tier",e.list(_i)),providerType:e.property("provider_type",B),quantity:e.number(),subscriptionId:e.property("subscription_id",e.string()),subscriptionItemExternalId:e.property("subscription_item_external_id",e.string().optional()),updatedAt:e.property("updated_at",e.date()),usageType:e.property("usage_type",Z)});var Ei=e.object({amountOff:e.property("amount_off",e.number().optional()),couponId:e.property("coupon_id",e.string()),couponName:e.property("coupon_name",e.string()),currency:e.string().optional(),customerFacingCode:e.property("customer_facing_code",e.string().optional()),discountExternalId:e.property("discount_external_id",e.string()),duration:e.string(),durationInMonths:e.property("duration_in_months",e.number().optional()),endedAt:e.property("ended_at",e.date().optional()),isActive:e.property("is_active",e.boolean()),percentOff:e.property("percent_off",e.number().optional()),promoCodeExternalId:e.property("promo_code_external_id",e.string().optional()),startedAt:e.property("started_at",e.date()),subscriptionExternalId:e.property("subscription_external_id",e.string())});var Ye=e.object({applicationId:e.property("application_id",e.string().optional()),cancelAt:e.property("cancel_at",e.number().optional()),cancelAtPeriodEnd:e.property("cancel_at_period_end",e.boolean()),companyId:e.property("company_id",e.string().optional()),createdAt:e.property("created_at",e.date()),currency:e.string(),customerExternalId:e.property("customer_external_id",e.string()),defaultPaymentMethodId:e.property("default_payment_method_id",e.string().optional()),discounts:e.list(Ei),expiredAt:e.property("expired_at",e.date().optional()),id:e.string(),interval:e.string(),latestInvoice:e.property("latest_invoice",Oe.optional()),metadata:e.record(e.string(),e.unknown()).optional(),paymentMethod:e.property("payment_method",ge.optional()),periodEnd:e.property("period_end",e.number()),periodStart:e.property("period_start",e.number()),products:e.list(xi),providerType:e.property("provider_type",B),status:e.string(),subscriptionExternalId:e.property("subscription_external_id",e.string()),totalPrice:e.property("total_price",e.number()),trialEnd:e.property("trial_end",e.number().optional()),trialEndSetting:e.property("trial_end_setting",Je.optional())});var Ci=e.object({accountId:e.property("account_id",e.string()),capturedAtMax:e.property("captured_at_max",e.date()),capturedAtMin:e.property("captured_at_min",e.date()),companyId:e.property("company_id",e.string()),createdAt:e.property("created_at",e.date()),environmentId:e.property("environment_id",e.string()),eventSubtype:e.property("event_subtype",e.string()),monthReset:e.property("month_reset",e.string()),period:e.string(),validUntil:e.property("valid_until",e.date().optional()),value:e.number()});var N=e.enum_(["duration","end_of_billing_period","end_of_next_billing_period","end_of_trial","no_expiry"]);var G=e.enum_(["billing_periods","days"]);var fe=e.enum_(["daily","monthly","weekly","yearly"]);var Be=e.enum_(["billing_period","first_of_month"]);var Xe=e.enum_(["no_reset","plan_period"]);var Ui=e.object({billingCreditAutoTopupAmount:e.property("billing_credit_auto_topup_amount",e.number().optional()),billingCreditAutoTopupAmountType:e.property("billing_credit_auto_topup_amount_type",e.string().optional()),billingCreditAutoTopupEnabled:e.property("billing_credit_auto_topup_enabled",e.boolean()),billingCreditAutoTopupExpiryType:e.property("billing_credit_auto_topup_expiry_type",N.optional()),billingCreditAutoTopupExpiryUnit:e.property("billing_credit_auto_topup_expiry_unit",G.optional()),billingCreditAutoTopupExpiryUnitCount:e.property("billing_credit_auto_topup_expiry_unit_count",e.number().optional()),billingCreditAutoTopupThresholdPercent:e.property("billing_credit_auto_topup_threshold_percent",e.number().optional()),createdAt:e.property("created_at",e.date()),creditAmount:e.property("credit_amount",e.number()),creditDescription:e.property("credit_description",e.string()),creditIcon:e.property("credit_icon",e.string().optional()),creditId:e.property("credit_id",e.string()),creditName:e.property("credit_name",e.string()),expiryType:e.property("expiry_type",N.optional()),expiryUnit:e.property("expiry_unit",G.optional()),expiryUnitCount:e.property("expiry_unit_count",e.number().optional()),id:e.string(),planId:e.property("plan_id",e.string()),planName:e.property("plan_name",e.string()),pluralName:e.property("plural_name",e.string().optional()),resetCadence:e.property("reset_cadence",fe),resetStart:e.property("reset_start",Be),resetType:e.property("reset_type",Xe),singularName:e.property("singular_name",e.string().optional()),updatedAt:e.property("updated_at",e.date())});var Er=e.object({addedOn:e.property("added_on",e.date().optional()),billingProductExternalId:e.property("billing_product_external_id",e.string().optional()),billingProductId:e.property("billing_product_id",e.string().optional()),description:e.string().optional(),id:e.string(),imageUrl:e.property("image_url",e.string().optional()),includedCreditGrants:e.property("included_credit_grants",e.list(Ui)),name:e.string(),planPeriod:e.property("plan_period",e.string().optional()),planPrice:e.property("plan_price",e.number().optional()),planVersionId:e.property("plan_version_id",e.string().optional())});var W=e.enum_(["company","user"]);var Ti=e.object({createdAt:e.property("created_at",e.date()),entityType:e.property("entity_type",W),id:e.string(),key:e.string(),updatedAt:e.property("updated_at",e.date())});var Cr=e.object({createdAt:e.property("created_at",e.date()),definition:Ti.optional(),definitionId:e.property("definition_id",e.string()),entityId:e.property("entity_id",e.string()),entityType:e.property("entity_type",W),environmentId:e.property("environment_id",e.string()),id:e.string(),key:e.string(),updatedAt:e.property("updated_at",e.date()),value:e.string()});var X=e.enum_(["boolean","currency","date","number","string","url"]);var oe=e.object({createdAt:e.property("created_at",e.date()),displayName:e.property("display_name",e.string()),entityType:e.property("entity_type",W),hierarchy:e.list(e.string()),id:e.string(),traitType:e.property("trait_type",X),updatedAt:e.property("updated_at",e.date())});var Ur=e.object({createdAt:e.property("created_at",e.date()),definition:oe.optional(),definitionId:e.property("definition_id",e.string()),environmentId:e.property("environment_id",e.string()),id:e.string(),updatedAt:e.property("updated_at",e.date()),value:e.string()});var vi=e.object({description:e.string().optional(),id:e.string(),imageUrl:e.property("image_url",e.string().optional()),name:e.string()});var Tn=e.enum_(["base_plan","billing_product","company","credit","crm_product","metric","plan","trait","user"]);var vn=e.enum_(["all_time","current_day","current_month","current_week"]);var On=e.enum_(["first_of_month","billing_cycle"]);var jn=e.enum_(["eq","ne","gt","lt","gte","lte","is_empty","not_empty"]);var kn=e.enum_(["bool","date","int","string"]);var pt=e.object({comparableType:e.property("comparable_type",kn),entityType:e.property("entity_type",W),id:e.string()});var Oi=e.object({accountId:e.property("account_id",e.string()),comparisonTraitDefinition:e.property("comparison_trait_definition",pt.optional()),conditionType:e.property("condition_type",Tn),consumptionRate:e.property("consumption_rate",e.number().optional()),creditId:e.property("credit_id",e.string().optional()),environmentId:e.property("environment_id",e.string()),eventSubtype:e.property("event_subtype",e.string().optional()),id:e.string(),metricPeriod:e.property("metric_period",vn.optional()),metricPeriodMonthReset:e.property("metric_period_month_reset",On.optional()),metricValue:e.property("metric_value",e.number().optional()),operator:jn,resourceIds:e.property("resource_ids",e.list(e.string())),traitDefinition:e.property("trait_definition",pt.optional()),traitValue:e.property("trait_value",e.string())});var Bn=e.object({conditions:e.list(Oi)});var An=e.enum_(["default","global_override","company_override","company_override_usage_exceeded","plan_entitlement","plan_entitlement_usage_exceeded","standard"]);var ji=e.object({accountId:e.property("account_id",e.string()),conditionGroups:e.property("condition_groups",e.list(Bn)),conditions:e.list(Oi),environmentId:e.property("environment_id",e.string()),flagId:e.property("flag_id",e.string().optional()),id:e.string(),name:e.string(),priority:e.number(),ruleType:e.property("rule_type",An),value:e.boolean()});var L=e.object({addOns:e.property("add_ons",e.list(Er)),billingCreditBalances:e.property("billing_credit_balances",e.record(e.string(),e.number()).optional()),billingSubscription:e.property("billing_subscription",Ye.optional()),billingSubscriptions:e.property("billing_subscriptions",e.list(Ye)),createdAt:e.property("created_at",e.date()),defaultPaymentMethod:e.property("default_payment_method",ge.optional()),entityTraits:e.property("entity_traits",e.list(Ur)),environmentId:e.property("environment_id",e.string()),id:e.string(),keys:e.list(Cr),lastSeenAt:e.property("last_seen_at",e.date().optional()),logoUrl:e.property("logo_url",e.string().optional()),metrics:e.list(Ci),name:e.string(),paymentMethods:e.property("payment_methods",e.list(ge)),plan:Er.optional(),plans:e.list(vi),rules:e.list(ji),traits:e.record(e.string(),e.unknown()).optional(),updatedAt:e.property("updated_at",e.date()),userCount:e.property("user_count",e.number())});var ki=e.object({company:L.optional(),success:e.boolean()});var Vn=e.object({data:ki,params:e.record(e.string(),e.unknown())});var qn=e.object({applicationId:e.property("application_id",e.string().optional()),cancelAt:e.property("cancel_at",e.number().optional()),cancelAtPeriodEnd:e.property("cancel_at_period_end",e.boolean()),companyId:e.property("company_id",e.string().optional()),confirmPaymentIntentClientSecret:e.property("confirm_payment_intent_client_secret",e.string().optional()),confirmPaymentIntentId:e.property("confirm_payment_intent_id",e.string().optional()),createdAt:e.property("created_at",e.date()),currency:e.string(),customerExternalId:e.property("customer_external_id",e.string()),defaultPaymentMethodId:e.property("default_payment_method_id",e.string().optional()),expiredAt:e.property("expired_at",e.date().optional()),id:e.string(),interval:e.string(),metadata:e.record(e.string(),e.unknown()).optional(),periodEnd:e.property("period_end",e.number()),periodStart:e.property("period_start",e.number()),providerType:e.property("provider_type",B),status:e.string(),subscriptionExternalId:e.property("subscription_external_id",e.string()),totalPrice:e.property("total_price",e.number()),trialEnd:e.property("trial_end",e.number().optional()),trialEndSetting:e.property("trial_end_setting",Je.optional())});var Dn=e.object({data:qn,params:e.record(e.string(),e.unknown())});var ue=e.enum_(["active","inactive"]);var ze=e.stringLiteral("fixed");var _e=e.object({billingInvoiceId:e.property("billing_invoice_id",e.string().optional()),bundleType:e.property("bundle_type",ze),createdAt:e.property("created_at",e.date()),creditDescription:e.property("credit_description",e.string().optional()),creditIcon:e.property("credit_icon",e.string().optional()),creditId:e.property("credit_id",e.string()),creditName:e.property("credit_name",e.string()),expiryType:e.property("expiry_type",N),expiryUnit:e.property("expiry_unit",G),expiryUnitCount:e.property("expiry_unit_count",e.number().optional()),hasGrants:e.property("has_grants",e.boolean()),id:e.string(),name:e.string(),pluralName:e.property("plural_name",e.string().optional()),price:Q.optional(),quantity:e.number().optional(),singularName:e.property("singular_name",e.string().optional()),status:ue,unitPrice:e.property("unit_price",Q.optional()),updatedAt:e.property("updated_at",e.date())});var Tr=e.object({cancelAt:e.property("cancel_at",e.date().optional()),cancelAtPeriodEnd:e.property("cancel_at_period_end",e.boolean()),currency:e.string(),customerExternalId:e.property("customer_external_id",e.string()),discounts:e.list(Ei),expiredAt:e.property("expired_at",e.date().optional()),interval:e.string(),latestInvoice:e.property("latest_invoice",Oe.optional()),paymentMethod:e.property("payment_method",ge.optional()),products:e.list(xi),status:e.string(),subscriptionExternalId:e.property("subscription_external_id",e.string()),totalPrice:e.property("total_price",e.number()),trialEnd:e.property("trial_end",e.date().optional())});var Mn=e.object({bundle:_e.optional(),quantity:e.number(),total:e.number()});var Se=e.enum_(["billing_credit_auto_topup","free","plan","purchased"]);var Fn=e.object({createdAt:e.property("created_at",e.date()),externalUserId:e.property("external_user_id",e.string()),externalUserName:e.property("external_user_name",e.string()),id:e.string(),note:e.string(),updatedAt:e.property("updated_at",e.date())});var Y=e.enum_(["boolean","credit","numeric","trait","unknown","unlimited"]);var er=e.enum_(["add_on","alpha","beta","deprecated","ga","inactive","in_plan","internal_testing","legacy"]);var te=e.enum_(["boolean","event","trait"]);var vr=e.object({createdAt:e.property("created_at",e.date()),description:e.string(),eventSubtype:e.property("event_subtype",e.string().optional()),featureType:e.property("feature_type",te),icon:e.string(),id:e.string(),lifecyclePhase:e.property("lifecycle_phase",er.optional()),maintainerId:e.property("maintainer_id",e.string().optional()),name:e.string(),pluralName:e.property("plural_name",e.string().optional()),singularName:e.property("singular_name",e.string().optional()),traitId:e.property("trait_id",e.string().optional()),updatedAt:e.property("updated_at",e.date())});var Pe=e.object({company:L.optional(),companyId:e.property("company_id",e.string()),consumptionRate:e.property("consumption_rate",e.number().optional()),createdAt:e.property("created_at",e.date()),environmentId:e.property("environment_id",e.string()),expirationDate:e.property("expiration_date",e.date().optional()),feature:vr.optional(),featureId:e.property("feature_id",e.string()),id:e.string(),metricPeriod:e.property("metric_period",e.string().optional()),metricPeriodMonthReset:e.property("metric_period_month_reset",e.string().optional()),notes:e.list(Fn),ruleId:e.property("rule_id",e.string().optional()),ruleIdUsageExceeded:e.property("rule_id_usage_exceeded",e.string().optional()),updatedAt:e.property("updated_at",e.date()),valueBool:e.property("value_bool",e.boolean().optional()),valueNumeric:e.property("value_numeric",e.number().optional()),valueTrait:e.property("value_trait",oe.optional()),valueTraitId:e.property("value_trait_id",e.string().optional()),valueType:e.property("value_type",Y)});var rr=e.object({creditTypeIcon:e.property("credit_type_icon",e.string().optional()),expiresAt:e.property("expires_at",e.date().optional()),grantReason:e.property("grant_reason",Se),quantity:e.number()});var Or=e.object({usageThisBillingPeriod:e.property("usage_this_billing_period",e.number().optional()),usageThisCalendarMonth:e.property("usage_this_calendar_month",e.number().optional()),usageThisWeek:e.property("usage_this_week",e.number().optional()),usageToday:e.property("usage_today",e.number().optional())});var ye=e.enum_(["credit_burndown","overage","pay_as_you_go","pay_in_advance","tier"]);var jr=e.enum_(["company_override","plan_entitlement","unknown"]);var Bi=e.object({companyCount:e.property("company_count",e.number()),environmentId:e.property("environment_id",e.string()),eventCount:e.property("event_count",e.number()),eventSubtype:e.property("event_subtype",e.string()),lastSeenAt:e.property("last_seen_at",e.date().optional()),userCount:e.property("user_count",e.number())});var ir=e.stringLiteral("boolean");var In=e.object({description:e.string().optional(),id:e.string(),imageUrl:e.property("image_url",e.string().optional()),name:e.string()});var Ai=e.object({comparisonTrait:e.property("comparison_trait",oe.optional()),comparisonTraitId:e.property("comparison_trait_id",e.string().optional()),conditionGroupId:e.property("condition_group_id",e.string().optional()),conditionType:e.property("condition_type",e.string()),createdAt:e.property("created_at",e.date()),environmentId:e.property("environment_id",e.string()),eventSubtype:e.property("event_subtype",e.string().optional()),flagId:e.property("flag_id",e.string().optional()),id:e.string(),metricPeriod:e.property("metric_period",e.string().optional()),metricPeriodMonthReset:e.property("metric_period_month_reset",e.string().optional()),metricValue:e.property("metric_value",e.number().optional()),operator:e.string(),resourceIds:e.property("resource_ids",e.list(e.string())),resources:e.list(In),ruleId:e.property("rule_id",e.string()),trait:oe.optional(),traitEntityType:e.property("trait_entity_type",W.optional()),traitId:e.property("trait_id",e.string().optional()),traitValue:e.property("trait_value",e.string()),updatedAt:e.property("updated_at",e.date())});var Kn=e.object({conditions:e.list(Ai),createdAt:e.property("created_at",e.date()),environmentId:e.property("environment_id",e.string()),flagId:e.property("flag_id",e.string().optional()),id:e.string(),ruleId:e.property("rule_id",e.string()),updatedAt:e.property("updated_at",e.date())});var Vi=e.object({conditionGroups:e.property("condition_groups",e.list(Kn)),conditions:e.list(Ai),createdAt:e.property("created_at",e.date()),environmentId:e.property("environment_id",e.string()),flagId:e.property("flag_id",e.string().optional()),id:e.string(),name:e.string(),priority:e.number(),ruleType:e.property("rule_type",e.string()),updatedAt:e.property("updated_at",e.date()),value:e.boolean()});var Ae=e.object({createdAt:e.property("created_at",e.date()),defaultValue:e.property("default_value",e.boolean()),description:e.string(),feature:vr.optional(),featureId:e.property("feature_id",e.string().optional()),flagType:e.property("flag_type",ir),id:e.string(),key:e.string(),lastCheckedAt:e.property("last_checked_at",e.date().optional()),maintainerId:e.property("maintainer_id",e.string().optional()),name:e.string(),rules:e.list(Vi),updatedAt:e.property("updated_at",e.date())});var kr=e.object({description:e.string().optional(),id:e.string(),imageUrl:e.property("image_url",e.string().optional()),name:e.string()});var ee=e.object({createdAt:e.property("created_at",e.date()),description:e.string(),eventSubtype:e.property("event_subtype",e.string().optional()),eventSummary:e.property("event_summary",Bi.optional()),featureType:e.property("feature_type",te),flags:e.list(Ae),icon:e.string(),id:e.string(),lifecyclePhase:e.property("lifecycle_phase",er.optional()),maintainerId:e.property("maintainer_id",e.string().optional()),name:e.string(),plans:e.list(kr),pluralName:e.property("plural_name",e.string().optional()),singularName:e.property("singular_name",e.string().optional()),trait:oe.optional(),traitId:e.property("trait_id",e.string().optional()),updatedAt:e.property("updated_at",e.date())});var Br=e.enum_(["expiration_priority","first_in_first_out","last_in_first_out","plan_first_then_credit_bundles_first_in_first_out"]);var Ar=e.enum_(["expire","none","rollover"]);var Ve=e.object({burnStrategy:e.property("burn_strategy",Br),createdAt:e.property("created_at",e.date()),defaultExpiryUnit:e.property("default_expiry_unit",G),defaultExpiryUnitCount:e.property("default_expiry_unit_count",e.number().optional()),defaultRolloverPolicy:e.property("default_rollover_policy",Ar),description:e.string(),icon:e.string().optional(),id:e.string(),name:e.string(),pluralName:e.property("plural_name",e.string().optional()),price:Q.optional(),product:xr.optional(),singularName:e.property("singular_name",e.string().optional()),updatedAt:e.property("updated_at",e.date())});var ae=e.enum_(["plan","add_on"]);var qe=e.object({audienceType:e.property("audience_type",e.string().optional()),createdAt:e.property("created_at",e.date()),description:e.string(),icon:e.string(),id:e.string(),name:e.string(),planType:e.property("plan_type",ae),updatedAt:e.property("updated_at",e.date())});var re=e.object({billingThreshold:e.property("billing_threshold",e.number().optional()),consumptionRate:e.property("consumption_rate",e.number().optional()),createdAt:e.property("created_at",e.date()),environmentId:e.property("environment_id",e.string()),feature:vr.optional(),featureId:e.property("feature_id",e.string()),id:e.string(),meteredMonthlyPrice:e.property("metered_monthly_price",J.optional()),meteredYearlyPrice:e.property("metered_yearly_price",J.optional()),metricPeriod:e.property("metric_period",e.string().optional()),metricPeriodMonthReset:e.property("metric_period_month_reset",e.string().optional()),plan:qe.optional(),planId:e.property("plan_id",e.string()),priceBehavior:e.property("price_behavior",ye.optional()),ruleId:e.property("rule_id",e.string()),ruleIdUsageExceeded:e.property("rule_id_usage_exceeded",e.string().optional()),softLimit:e.property("soft_limit",e.number().optional()),updatedAt:e.property("updated_at",e.date()),usageBasedProduct:e.property("usage_based_product",xr.optional()),valueBool:e.property("value_bool",e.boolean().optional()),valueCredit:e.property("value_credit",Ve.optional()),valueNumeric:e.property("value_numeric",e.number().optional()),valueTrait:e.property("value_trait",oe.optional()),valueTraitId:e.property("value_trait_id",e.string().optional()),valueType:e.property("value_type",Y)});var or=e.object({access:e.boolean(),allocation:e.number().optional(),allocationType:e.property("allocation_type",Y),companyOverride:e.property("company_override",Pe.optional()),creditConsumptionRate:e.property("credit_consumption_rate",e.number().optional()),creditGrantCounts:e.property("credit_grant_counts",e.record(e.string(),e.number()).optional()),creditGrantDetails:e.property("credit_grant_details",e.list(rr).optional()),creditGrantReason:e.property("credit_grant_reason",Se.optional()),creditRemaining:e.property("credit_remaining",e.number().optional()),creditTotal:e.property("credit_total",e.number().optional()),creditTypeIcon:e.property("credit_type_icon",e.string().optional()),creditUsageAggregation:e.property("credit_usage_aggregation",Or.optional()),creditUsed:e.property("credit_used",e.number().optional()),effectiveLimit:e.property("effective_limit",e.number().optional()),effectivePrice:e.property("effective_price",e.number().optional()),entitlementExpirationDate:e.property("entitlement_expiration_date",e.date().optional()),entitlementId:e.property("entitlement_id",e.string()),entitlementSource:e.property("entitlement_source",e.string().optional()),entitlementType:e.property("entitlement_type",jr),feature:ee.optional(),hasValidAllocation:e.property("has_valid_allocation",e.boolean().optional()),isUnlimited:e.property("is_unlimited",e.boolean().optional()),metricResetAt:e.property("metric_reset_at",e.date().optional()),monthReset:e.property("month_reset",e.string().optional()),monthlyUsageBasedPrice:e.property("monthly_usage_based_price",J.optional()),overuse:e.number().optional(),percentUsed:e.property("percent_used",e.number().optional()),period:e.string().optional(),plan:qe.optional(),planEntitlement:e.property("plan_entitlement",re.optional()),priceBehavior:e.property("price_behavior",ye.optional()),softLimit:e.property("soft_limit",e.number().optional()),usage:e.number().optional(),yearlyUsageBasedPrice:e.property("yearly_usage_based_price",J.optional())});var Vr=e.object({features:e.list(or)});var xe=e.object({autoTopupAmount:e.property("auto_topup_amount",e.number().optional()),autoTopupAmountType:e.property("auto_topup_amount_type",e.string().optional()),autoTopupEnabled:e.property("auto_topup_enabled",e.boolean()),autoTopupExpiryType:e.property("auto_topup_expiry_type",N.optional()),autoTopupExpiryUnit:e.property("auto_topup_expiry_unit",G.optional()),autoTopupExpiryUnitCount:e.property("auto_topup_expiry_unit_count",e.number().optional()),autoTopupThresholdPercent:e.property("auto_topup_threshold_percent",e.number().optional()),createdAt:e.property("created_at",e.date()),creditAmount:e.property("credit_amount",e.number()),creditId:e.property("credit_id",e.string()),creditName:e.property("credit_name",e.string()),creditPluralName:e.property("credit_plural_name",e.string().optional()),creditSingularName:e.property("credit_singular_name",e.string().optional()),expiryType:e.property("expiry_type",N.optional()),expiryUnit:e.property("expiry_unit",G.optional()),expiryUnitCount:e.property("expiry_unit_count",e.number().optional()),id:e.string(),planId:e.property("plan_id",e.string()),planName:e.property("plan_name",e.string()),resetCadence:e.property("reset_cadence",fe),resetStart:e.property("reset_start",Be),resetType:e.property("reset_type",Xe.optional()),updatedAt:e.property("updated_at",e.date())});var De=e.enum_(["free","one_time","recurring"]);var tr=e.enum_(["schematic","stripe"]);var Gn=e.enum_(["published","draft","archived"]);var qr=e.object({createdAt:e.property("created_at",e.date()),description:e.string(),environmentId:e.property("environment_id",e.string()),icon:e.string(),id:e.string(),name:e.string(),originalPlanId:e.property("original_plan_id",e.string().optional()),planType:e.property("plan_type",ae),status:Gn,updatedAt:e.property("updated_at",e.date()),version:e.number()});var de=e.object({audienceType:e.property("audience_type",e.string().optional()),billingProduct:e.property("billing_product",Qe.optional()),chargeType:e.property("charge_type",De),companyCount:e.property("company_count",e.number()),controlledBy:e.property("controlled_by",tr),createdAt:e.property("created_at",e.date()),description:e.string(),features:e.list(ee),icon:e.string(),id:e.string(),includedCreditGrants:e.property("included_credit_grants",e.list(xe).optional()),isDefault:e.property("is_default",e.boolean()),isFree:e.property("is_free",e.boolean()),isTrialable:e.property("is_trialable",e.boolean()),monthlyPrice:e.property("monthly_price",Q.optional()),name:e.string(),oneTimePrice:e.property("one_time_price",Q.optional()),planType:e.property("plan_type",ae),trialDays:e.property("trial_days",e.number().optional()),updatedAt:e.property("updated_at",e.date()),versions:e.list(qr),yearlyPrice:e.property("yearly_price",Q.optional())});var ti=e.object({billingThreshold:e.property("billing_threshold",e.number().optional()),consumptionRate:e.property("consumption_rate",e.number().optional()),featureId:e.property("feature_id",e.string()),meteredPrice:e.property("metered_price",J.optional()),metricPeriod:e.property("metric_period",e.string().optional()),metricPeriodMonthReset:e.property("metric_period_month_reset",e.string().optional()),monthlyUsageBasedPrice:e.property("monthly_usage_based_price",J.optional()),priceBehavior:e.property("price_behavior",ye.optional()),valueBool:e.property("value_bool",e.boolean().optional()),valueNumeric:e.property("value_numeric",e.number().optional()),valueType:e.property("value_type",Y),yearlyUsageBasedPrice:e.property("yearly_usage_based_price",J.optional())});var Ln=e.object({activeAddOns:e.property("active_add_ons",e.list(de)),activePlan:e.property("active_plan",de.optional()),activeUsageBasedEntitlements:e.property("active_usage_based_entitlements",e.list(ti)),availableCreditBundles:e.property("available_credit_bundles",e.list(_e)),company:L.optional(),featureUsage:e.property("feature_usage",Vr.optional()),selectedCreditBundles:e.property("selected_credit_bundles",e.list(Mn)),selectedPlan:e.property("selected_plan",de.optional()),selectedUsageBasedEntitlements:e.property("selected_usage_based_entitlements",e.list(ti)),subscription:Tr.optional()});var Wn=e.object({data:Ln,params:e.record(e.string(),e.unknown())});var Nn=e.object({data:ki,params:e.record(e.string(),e.unknown())});var Hn=e.object({amount:e.number(),description:e.string(),priceId:e.property("price_id",e.string()),proration:e.boolean(),quantity:e.number()});var $n=e.object({amountOff:e.property("amount_off",e.number()),dueNow:e.property("due_now",e.number()),newCharges:e.property("new_charges",e.number()),percentOff:e.property("percent_off",e.number()),periodStart:e.property("period_start",e.date()),promoCodeApplied:e.property("promo_code_applied",e.boolean()),proration:e.number(),taxAmount:e.property("tax_amount",e.number().optional()),taxDisplayName:e.property("tax_display_name",e.string().optional()),taxRequireBillingDetails:e.property("tax_require_billing_details",e.boolean()),totalPerBillingPeriod:e.property("total_per_billing_period",e.number()),trialEnd:e.property("trial_end",e.date().optional()),upcomingInvoiceLineItems:e.property("upcoming_invoice_line_items",e.list(Hn))});var qi=e.object({amountOff:e.property("amount_off",e.number()),dueNow:e.property("due_now",e.number()),finance:$n.optional(),newCharges:e.property("new_charges",e.number()),paymentMethodRequired:e.property("payment_method_required",e.boolean()),percentOff:e.property("percent_off",e.number()),periodStart:e.property("period_start",e.date()),promoCodeApplied:e.property("promo_code_applied",e.boolean()),proration:e.number(),trialEnd:e.property("trial_end",e.date().optional()),usageViolations:e.property("usage_violations",e.list(or))});var Zn=e.object({data:qi,params:e.record(e.string(),e.unknown())});var Jn=e.object({subscriptionChangePreview:e.property("subscription_change_preview",qi.optional())});var Qn=e.object({data:Jn,params:e.record(e.string(),e.unknown())});var Yn=e.object({data:Ye,params:e.record(e.string(),e.unknown())});var ut=e.object({displayName:e.property("display_name",e.string().optional()),entityType:e.property("entity_type",W),hierarchy:e.list(e.string()),traitType:e.property("trait_type",X)});var dt=e.object({planId:e.property("plan_id",e.string()),traitId:e.property("trait_id",e.string()),traitValue:e.property("trait_value",e.string())});var mt=e.object({companyId:e.property("company_id",e.string()),userId:e.property("user_id",e.string())});var ht=e.object({displayName:e.property("display_name",e.string().optional()),traitType:e.property("trait_type",X)});var Dr=e.object({traitId:e.property("trait_id",e.string()),traitValue:e.property("trait_value",e.string())});var gt=e.object({applyToExistingCompanies:e.property("apply_to_existing_companies",e.boolean()),planId:e.property("plan_id",e.string()),traits:e.list(Dr)});var yt=e.object({planId:e.property("plan_id",e.string()),traitValue:e.property("trait_value",e.string())});var we=e.enum_(["asc","desc"]);var Le=e.enum_(["active","canceled","expired","incomplete","incomplete_expired","past_due","paused","trialing","unpaid"]);var We=e.enum_(["free","one_time","paid","trial"]);var Xn=e.object({creditTypeIds:e.property("credit_type_ids",e.list(e.string()).optional()),displayProperties:e.property("display_properties",e.list(e.string()).optional()),featureIds:e.property("feature_ids",e.list(e.string()).optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),monetizedSubscriptions:e.property("monetized_subscriptions",e.boolean().optional()),offset:e.number().optional(),planIds:e.property("plan_ids",e.list(e.string()).optional()),q:e.string().optional(),sortOrderColumn:e.property("sort_order_column",e.string().optional()),sortOrderDirection:e.property("sort_order_direction",we.optional()),subscriptionStatuses:e.property("subscription_statuses",e.list(Le).optional()),subscriptionTypes:e.property("subscription_types",e.list(We).optional()),withoutPlan:e.property("without_plan",e.boolean().optional()),withoutSubscription:e.property("without_subscription",e.boolean().optional())});var ec=e.object({data:A,params:Xn});var rc=e.object({ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),planId:e.property("plan_id",e.string().optional()),q:e.string().optional(),withSubscription:e.property("with_subscription",e.boolean().optional()),withoutFeatureOverrideFor:e.property("without_feature_override_for",e.string().optional()),withoutPlan:e.property("without_plan",e.boolean().optional())});var ic=e.object({data:A,params:rc});var oc=e.object({entityType:e.property("entity_type",W.optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var tc=e.object({data:A,params:oc});var ac=e.object({entityType:e.property("entity_type",W.optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional(),traitType:e.property("trait_type",X.optional()),traitTypes:e.property("trait_types",e.list(X).optional())});var sc=e.object({data:A,params:ac});var nc=e.object({ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),planId:e.property("plan_id",e.string().optional()),traitId:e.property("trait_id",e.string().optional()),traitIds:e.property("trait_ids",e.list(e.string()).optional())});var cc=e.object({data:A,params:nc});var lc=e.object({companyId:e.property("company_id",e.string().optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),planId:e.property("plan_id",e.string().optional()),q:e.string().optional()});var pc=e.object({data:A,params:lc});var uc=e.object({data:L,params:e.record(e.string(),e.unknown())});var Ee=e.object({accountId:e.property("account_id",e.string()),createdAt:e.property("created_at",e.date()),environmentId:e.property("environment_id",e.string()),id:e.string(),planId:e.property("plan_id",e.string()),planType:e.property("plan_type",e.string()),traitId:e.property("trait_id",e.string()),traitValue:e.property("trait_value",e.string()),updatedAt:e.property("updated_at",e.date())});var dc=e.object({data:Ee,params:e.record(e.string(),e.unknown())});var Mr=e.object({createdAt:e.property("created_at",e.date()),environmentId:e.property("environment_id",e.string()),id:e.string(),lastSeenAt:e.property("last_seen_at",e.date().optional()),logoUrl:e.property("logo_url",e.string().optional()),name:e.string(),updatedAt:e.property("updated_at",e.date())});var Fr=e.object({company:Mr.optional(),companyId:e.property("company_id",e.string()),createdAt:e.property("created_at",e.date()),id:e.string(),updatedAt:e.property("updated_at",e.date()),userId:e.property("user_id",e.string())});var Ce=e.object({companyMemberships:e.property("company_memberships",e.list(Fr)),createdAt:e.property("created_at",e.date()),entityTraits:e.property("entity_traits",e.list(Ur)),environmentId:e.property("environment_id",e.string()),id:e.string(),keys:e.list(Cr),lastSeenAt:e.property("last_seen_at",e.date().optional()),name:e.string(),traits:e.record(e.string(),e.unknown()).optional(),updatedAt:e.property("updated_at",e.date())});var mc=e.object({data:Ce,params:e.record(e.string(),e.unknown())});var hc=e.object({data:Mr,params:e.record(e.string(),e.unknown())});var gc=e.object({data:D,params:e.record(e.string(),e.unknown())});var yc=e.object({cancelSubscription:e.property("cancel_subscription",e.boolean().optional()),prorate:e.boolean().optional()});var wc=e.object({data:D,params:yc});var bc=e.object({data:D,params:e.record(e.string(),e.unknown())});var Di=e.object({createdAt:e.property("created_at",e.date()),environmentId:e.property("environment_id",e.string()),id:e.string(),lastSeenAt:e.property("last_seen_at",e.date().optional()),name:e.string(),updatedAt:e.property("updated_at",e.date())});var zc=e.object({data:Di,params:e.record(e.string(),e.unknown())});var Rc=e.object({data:D,params:e.record(e.string(),e.unknown())});var fc=e.object({companyId:e.property("company_id",e.string().optional()),companyIds:e.property("company_ids",e.list(e.string()).optional()),limit:e.number().optional(),offset:e.number().optional()});var _c=e.object({data:e.list(Tr),params:fc});var Sc=e.object({data:L,params:e.record(e.string(),e.unknown())});var Pc=e.object({data:oe,params:e.record(e.string(),e.unknown())});var xc=e.object({definitionId:e.property("definition_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var Ec=e.object({definitionId:e.property("definition_id",e.string()),value:e.string()});var Cc=e.object({data:e.list(Ec),params:xc});var Uc=e.object({data:Fr,params:e.record(e.string(),e.unknown())});var Tc=e.object({data:oe,params:e.record(e.string(),e.unknown())});var vc=e.enum_(["checkout","company_upsert","fallback_plan","manage_plan","migration","plan_billing_product_changed","plan_deleted","plan_trait_change","quickstart","subscription_change"]);var Oc=e.enum_(["api_key","app_user","system","temporary_access_token"]);var jc=e.enum_(["fallback","initial","trait","trial_expiry"]);var kc=e.enum_(["adjustment","downgrade","invalid","subscribe","unsubscribe","upgrade","upgrade_trial"]);var ai=e.object({deleted:e.boolean(),description:e.string(),icon:e.string(),id:e.string(),name:e.string()});var Bc=e.object({featureId:e.property("feature_id",e.string()),hierarchy:e.list(e.string()),reason:e.string(),traitId:e.property("trait_id",e.string()),traitName:e.property("trait_name",e.string()),traitType:e.property("trait_type",X),value:e.string()});var Mi=e.object({action:vc,actorType:e.property("actor_type",Oc),addOnsAdded:e.property("add_ons_added",e.list(ai)),addOnsRemoved:e.property("add_ons_removed",e.list(ai)),apiKey:e.property("api_key",Re.optional()),apiKeyRequest:e.property("api_key_request",fi.optional()),basePlan:e.property("base_plan",ai.optional()),basePlanAction:e.property("base_plan_action",jc.optional()),company:Mr.optional(),companyId:e.property("company_id",e.string()),createdAt:e.property("created_at",e.date()),environmentId:e.property("environment_id",e.string()),id:e.string(),previousBasePlan:e.property("previous_base_plan",ai.optional()),requestId:e.property("request_id",e.string().optional()),subscriptionChangeAction:e.property("subscription_change_action",kc.optional()),traitsUpdated:e.property("traits_updated",e.list(Bc)),updatedAt:e.property("updated_at",e.date()),userId:e.property("user_id",e.string().optional()),userName:e.property("user_name",e.string().optional())});var Ac=e.object({data:Mi,params:e.record(e.string(),e.unknown())});var Vc=e.object({data:Ee,params:e.record(e.string(),e.unknown())});var qc=e.object({data:Ce,params:e.record(e.string(),e.unknown())});var Dc=e.object({creditTypeIds:e.property("credit_type_ids",e.list(e.string()).optional()),displayProperties:e.property("display_properties",e.list(e.string()).optional()),featureIds:e.property("feature_ids",e.list(e.string()).optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),monetizedSubscriptions:e.property("monetized_subscriptions",e.boolean().optional()),offset:e.number().optional(),planIds:e.property("plan_ids",e.list(e.string()).optional()),q:e.string().optional(),sortOrderColumn:e.property("sort_order_column",e.string().optional()),sortOrderDirection:e.property("sort_order_direction",we.optional()),subscriptionStatuses:e.property("subscription_statuses",e.list(Le).optional()),subscriptionTypes:e.property("subscription_types",e.list(We).optional()),withoutPlan:e.property("without_plan",e.boolean().optional()),withoutSubscription:e.property("without_subscription",e.boolean().optional())});var Mc=e.object({creditConsumptionRate:e.property("credit_consumption_rate",e.number().optional()),creditGrantCounts:e.property("credit_grant_counts",e.record(e.string(),e.number()).optional()),creditGrantDetails:e.property("credit_grant_details",e.list(rr)),creditRemaining:e.property("credit_remaining",e.number().optional()),creditTotal:e.property("credit_total",e.number().optional()),creditTypeIcon:e.property("credit_type_icon",e.string().optional()),creditTypeName:e.property("credit_type_name",e.string().optional()),creditUsed:e.property("credit_used",e.number().optional())});var Fc=e.object({creditTypeId:e.property("credit_type_id",e.string().optional()),creditUsage:e.property("credit_usage",Mc.optional()),entitlementSource:e.property("entitlement_source",e.string()),entitlementValueType:e.property("entitlement_value_type",e.string()),featureId:e.property("feature_id",e.string()),featureName:e.property("feature_name",e.string()),featureType:e.property("feature_type",te),hardLimit:e.property("hard_limit",e.string()),hasAccess:e.property("has_access",e.boolean()),metricResetAt:e.property("metric_reset_at",e.date().optional()),monthlyUsageBasedPrice:e.property("monthly_usage_based_price",J.optional()),priceBehavior:e.property("price_behavior",e.string().optional()),softLimit:e.property("soft_limit",e.string()),usage:e.string(),valueNumeric:e.property("value_numeric",e.number().optional()),yearlyUsageBasedPrice:e.property("yearly_usage_based_price",J.optional())});var Ic=e.object({addOns:e.property("add_ons",e.list(Er)),billingCreditBalances:e.property("billing_credit_balances",e.record(e.string(),e.number()).optional()),billingSubscription:e.property("billing_subscription",Ye.optional()),billingSubscriptions:e.property("billing_subscriptions",e.list(Ye)),createdAt:e.property("created_at",e.date()),defaultPaymentMethod:e.property("default_payment_method",ge.optional()),entityTraits:e.property("entity_traits",e.list(Ur)),environmentId:e.property("environment_id",e.string()),featureUsage:e.property("feature_usage",e.list(Fc)),id:e.string(),keys:e.list(Cr),lastSeenAt:e.property("last_seen_at",e.date().optional()),logoUrl:e.property("logo_url",e.string().optional()),metrics:e.list(Ci),name:e.string(),paymentMethods:e.property("payment_methods",e.list(ge)),plan:Er.optional(),plans:e.list(vi),rules:e.list(ji),traits:e.record(e.string(),e.unknown()).optional(),updatedAt:e.property("updated_at",e.date()),userCount:e.property("user_count",e.number())});var Kc=e.object({data:e.list(Ic),params:Dc});var Gc=e.object({ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),planId:e.property("plan_id",e.string().optional()),q:e.string().optional(),withSubscription:e.property("with_subscription",e.boolean().optional()),withoutFeatureOverrideFor:e.property("without_feature_override_for",e.string().optional()),withoutPlan:e.property("without_plan",e.boolean().optional())});var Lc=e.object({data:e.list(L),params:Gc});var Wc=e.object({companyId:e.property("company_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),userId:e.property("user_id",e.string().optional())});var Nc=e.object({data:e.list(Fr),params:Wc});var Hc=e.object({entityType:e.property("entity_type",W.optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var $c=e.object({data:e.list(Ti),params:Hc});var Zc=e.object({entityType:e.property("entity_type",W.optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional(),traitType:e.property("trait_type",X.optional()),traitTypes:e.property("trait_types",e.list(X).optional())});var Jc=e.object({data:e.list(oe),params:Zc});var Qc=e.object({action:e.string().optional(),basePlanAction:e.property("base_plan_action",e.string().optional()),companyId:e.property("company_id",e.string().optional()),companyIds:e.property("company_ids",e.list(e.string()).optional()),limit:e.number().optional(),offset:e.number().optional(),planIds:e.property("plan_ids",e.list(e.string()).optional())});var Yc=e.object({data:e.list(Mi),params:Qc});var Xc=e.object({ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),planId:e.property("plan_id",e.string().optional()),traitId:e.property("trait_id",e.string().optional()),traitIds:e.property("trait_ids",e.list(e.string()).optional())});var el=e.object({data:e.list(Ee),params:Xc});var rl=e.object({companyId:e.property("company_id",e.string().optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),planId:e.property("plan_id",e.string().optional()),q:e.string().optional()});var il=e.object({data:e.list(Ce),params:rl});var ol=e.object({keys:e.record(e.string(),e.string()).optional()});var tl=e.object({data:L,params:ol});var al=e.object({keys:e.record(e.string(),e.string()).optional()});var sl=e.object({data:Ce,params:al});var nl=e.object({data:oe,params:e.record(e.string(),e.unknown())});var cl=e.object({data:Ee,params:e.record(e.string(),e.unknown())});var ll=e.object({data:e.list(Ee),params:e.record(e.string(),e.unknown())});var pl=e.object({data:L,params:e.record(e.string(),e.unknown())});var ul=e.object({data:L,params:e.record(e.string(),e.unknown())});var dl=e.object({data:Ce,params:e.record(e.string(),e.unknown())});var ml=e.object({data:Ce,params:e.record(e.string(),e.unknown())});var Ir=e.enum_(["billing","entitlement"]);var wt=e.object({ast:e.record(e.string(),e.number()).optional(),entityType:e.property("entity_type",Ir),name:e.string()});var Fi=e.enum_(["draft","live"]);var bt=e.object({ast:e.record(e.string(),e.number()).optional(),entityType:e.property("entity_type",Ir.optional()),name:e.string().optional(),state:Fi.optional()});var hl=e.object({limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var gl=e.object({data:A,params:hl});var Me=e.object({ast:e.record(e.string(),e.number()).optional(),createdAt:e.property("created_at",e.date()),id:e.string(),name:e.string(),state:Fi,type:Ir,updatedAt:e.property("updated_at",e.date())});var yl=e.object({data:Me,params:e.record(e.string(),e.unknown())});var wl=e.object({data:D,params:e.record(e.string(),e.unknown())});var bl=e.object({data:Me,params:e.record(e.string(),e.unknown())});var zl=e.object({limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var Rl=e.object({data:e.list(Me),params:zl});var fl=e.object({companyId:e.property("company_id",e.string().optional()),componentId:e.property("component_id",e.string().optional())});var si=e.object({billingScheme:e.property("billing_scheme",ke),createdAt:e.property("created_at",e.date()),currency:e.string(),id:e.string(),interval:Pr,isActive:e.property("is_active",e.boolean()),meterId:e.property("meter_id",e.string().optional()),packageSize:e.property("package_size",e.number()),price:e.number(),priceDecimal:e.property("price_decimal",e.string().optional()),priceExternalId:e.property("price_external_id",e.string()),productExternalId:e.property("product_external_id",e.string()),providerType:e.property("provider_type",B),tiersMode:e.property("tiers_mode",ie.optional()),updatedAt:e.property("updated_at",e.date()),usageType:e.property("usage_type",Z)});var _l=e.object({billingInvoiceId:e.property("billing_invoice_id",e.string().optional()),bundleType:e.property("bundle_type",ze),createdAt:e.property("created_at",e.date()),creditDescription:e.property("credit_description",e.string().optional()),creditIcon:e.property("credit_icon",e.string().optional()),creditId:e.property("credit_id",e.string()),creditName:e.property("credit_name",e.string()),expiryType:e.property("expiry_type",N),expiryUnit:e.property("expiry_unit",G),expiryUnitCount:e.property("expiry_unit_count",e.number().optional()),hasGrants:e.property("has_grants",e.boolean()),id:e.string(),name:e.string(),pluralName:e.property("plural_name",e.string().optional()),price:si.optional(),quantity:e.number().optional(),singularName:e.property("singular_name",e.string().optional()),status:ue,unitPrice:e.property("unit_price",si.optional()),updatedAt:e.property("updated_at",e.date())});var Sl=e.enum_(["downgrade_not_permitted","feature_usage_exceeded"]);var Kr=e.object({ctaText:e.property("cta_text",e.string()),ctaWebSite:e.property("cta_web_site",e.string()),priceText:e.property("price_text",e.string())});var zt=e.object({audienceType:e.property("audience_type",e.string().optional()),billingProduct:e.property("billing_product",Qe.optional()),chargeType:e.property("charge_type",De),companyCanTrial:e.property("company_can_trial",e.boolean()),companyCount:e.property("company_count",e.number()),compatiblePlanIds:e.property("compatible_plan_ids",e.list(e.string())),controlledBy:e.property("controlled_by",tr),createdAt:e.property("created_at",e.date()),current:e.boolean(),custom:e.boolean(),customPlanConfig:e.property("custom_plan_config",Kr.optional()),description:e.string(),entitlements:e.list(re),features:e.list(ee),icon:e.string(),id:e.string(),includedCreditGrants:e.property("included_credit_grants",e.list(Ui)),invalidReason:e.property("invalid_reason",Sl.optional()),isCustom:e.property("is_custom",e.boolean()),isDefault:e.property("is_default",e.boolean()),isFree:e.property("is_free",e.boolean()),isTrialable:e.property("is_trialable",e.boolean()),monthlyPrice:e.property("monthly_price",Q.optional()),name:e.string(),oneTimePrice:e.property("one_time_price",Q.optional()),planType:e.property("plan_type",ae),trialDays:e.property("trial_days",e.number().optional()),updatedAt:e.property("updated_at",e.date()),usageViolations:e.property("usage_violations",e.list(or)),valid:e.boolean(),versions:e.list(qr),yearlyPrice:e.property("yearly_price",Q.optional())});var Gr=e.object({compatiblePlanIds:e.property("compatible_plan_ids",e.list(e.string())),sourcePlanId:e.property("source_plan_id",e.string())});var Pl=e.object({badgeVisibility:e.property("badge_visibility",e.boolean()),checkout:e.boolean()});var xl=e.object({collectAddress:e.property("collect_address",e.boolean()),collectEmail:e.property("collect_email",e.boolean()),collectPhone:e.property("collect_phone",e.boolean()),taxCollectionEnabled:e.property("tax_collection_enabled",e.boolean())});var El=e.object({showAsMonthlyPrices:e.property("show_as_monthly_prices",e.boolean()),showCredits:e.property("show_credits",e.boolean()),showPeriodToggle:e.property("show_period_toggle",e.boolean()),showZeroPriceAsFree:e.property("show_zero_price_as_free",e.boolean())});var Lr=e.enum_(["expired","manual","plan_change","plan_period_reset"]);var Cl=e.object({amount:e.number(),createdAt:e.property("created_at",e.date()),direction:e.string(),id:e.string(),reason:e.string(),relatedGrantId:e.property("related_grant_id",e.string())});var Ul=e.object({billingCreditBundleId:e.property("billing_credit_bundle_id",e.string().optional()),billingCreditId:e.property("billing_credit_id",e.string()),companyId:e.property("company_id",e.string()),companyName:e.property("company_name",e.string()),createdAt:e.property("created_at",e.date()),creditDescription:e.property("credit_description",e.string()),creditIcon:e.property("credit_icon",e.string().optional()),creditName:e.property("credit_name",e.string()),exhaustedAt:e.property("exhausted_at",e.date().optional()),expiresAt:e.property("expires_at",e.date().optional()),expiryType:e.property("expiry_type",N.optional()),expiryUnit:e.property("expiry_unit",G.optional()),expiryUnitCount:e.property("expiry_unit_count",e.number().optional()),grantReason:e.property("grant_reason",Se),id:e.string(),planId:e.property("plan_id",e.string().optional()),planName:e.property("plan_name",e.string().optional()),pluralName:e.property("plural_name",e.string().optional()),price:si.optional(),quantity:e.number(),quantityRemaining:e.property("quantity_remaining",e.number()),quantityUsed:e.property("quantity_used",e.number()),renewalEnabled:e.property("renewal_enabled",e.boolean()),renewalPeriod:e.property("renewal_period",fe.optional()),singularName:e.property("singular_name",e.string().optional()),sourceLabel:e.property("source_label",e.string()),transfers:e.list(Cl).optional(),updatedAt:e.property("updated_at",e.date()),validFrom:e.property("valid_from",e.date().optional()),zeroedOutDate:e.property("zeroed_out_date",e.date().optional()),zeroedOutReason:e.property("zeroed_out_reason",Lr.optional())});var Tl=e.object({accountId:e.property("account_id",e.string().optional()),publishableKey:e.property("publishable_key",e.string().optional()),schematicPublishableKey:e.property("schematic_publishable_key",e.string()),setupIntentClientSecret:e.property("setup_intent_client_secret",e.string().optional())});var vl=e.object({activeAddOns:e.property("active_add_ons",e.list(zt)),activePlans:e.property("active_plans",e.list(zt)),activeUsageBasedEntitlements:e.property("active_usage_based_entitlements",e.list(ti)),addOnCompatibilities:e.property("add_on_compatibilities",e.list(Gr)),capabilities:Pl.optional(),checkoutSettings:e.property("checkout_settings",xl),company:L.optional(),component:Me.optional(),creditBundles:e.property("credit_bundles",e.list(_l)),creditGrants:e.property("credit_grants",e.list(Ul)),defaultPlan:e.property("default_plan",de.optional()),displaySettings:e.property("display_settings",El),featureUsage:e.property("feature_usage",Vr.optional()),invoices:e.list(Oe),postTrialPlan:e.property("post_trial_plan",de.optional()),preventSelfServiceDowngrade:e.property("prevent_self_service_downgrade",e.boolean()),preventSelfServiceDowngradeButtonText:e.property("prevent_self_service_downgrade_button_text",e.string().optional()),preventSelfServiceDowngradeUrl:e.property("prevent_self_service_downgrade_url",e.string().optional()),showAsMonthlyPrices:e.property("show_as_monthly_prices",e.boolean()),showCredits:e.property("show_credits",e.boolean()),showPeriodToggle:e.property("show_period_toggle",e.boolean()),showZeroPriceAsFree:e.property("show_zero_price_as_free",e.boolean()),stripeEmbed:e.property("stripe_embed",Tl.optional()),subscription:Tr.optional(),trialPaymentMethodRequired:e.property("trial_payment_method_required",e.boolean().optional()),upcomingInvoice:e.property("upcoming_invoice",Oe.optional())});var Ol=e.object({data:vl,params:fl});var jl=e.object({data:Me,params:e.record(e.string(),e.unknown())});var Rt=e.object({burnStrategy:e.property("burn_strategy",Br.optional()),currency:e.string(),defaultExpiryUnit:e.property("default_expiry_unit",G.optional()),defaultExpiryUnitCount:e.property("default_expiry_unit_count",e.number().optional()),defaultRolloverPolicy:e.property("default_rollover_policy",Ar.optional()),description:e.string(),icon:e.string().optional(),name:e.string(),perUnitPrice:e.property("per_unit_price",e.number().optional()),perUnitPriceDecimal:e.property("per_unit_price_decimal",e.string().optional()),pluralName:e.property("plural_name",e.string().optional()),singularName:e.property("singular_name",e.string().optional())});var ft=e.object({billingPeriodsCount:e.property("billing_periods_count",e.number().optional()),companyId:e.property("company_id",e.string()),creditId:e.property("credit_id",e.string()),expiresAt:e.property("expires_at",e.date().optional()),expiryType:e.property("expiry_type",N.optional()),expiryUnit:e.property("expiry_unit",G.optional()),expiryUnitCount:e.property("expiry_unit_count",e.number().optional()),quantity:e.number(),reason:Se,renewalEnabled:e.property("renewal_enabled",e.boolean().optional()),renewalPeriod:e.property("renewal_period",Be.optional())});var _t=e.object({bundleName:e.property("bundle_name",e.string()),bundleType:e.property("bundle_type",ze.optional()),creditId:e.property("credit_id",e.string()),currency:e.string(),expiryType:e.property("expiry_type",N.optional()),expiryUnit:e.property("expiry_unit",G.optional()),expiryUnitCount:e.property("expiry_unit_count",e.number().optional()),pricePerUnit:e.property("price_per_unit",e.number()),pricePerUnitDecimal:e.property("price_per_unit_decimal",e.string().optional()),quantity:e.number().optional(),status:ue.optional()});var St=e.object({burnStrategy:e.property("burn_strategy",Br.optional()),defaultExpiryUnit:e.property("default_expiry_unit",G.optional()),defaultExpiryUnitCount:e.property("default_expiry_unit_count",e.number().optional()),defaultRolloverPolicy:e.property("default_rollover_policy",Ar.optional()),description:e.string(),icon:e.string().optional(),name:e.string(),perUnitPrice:e.property("per_unit_price",e.number().optional()),perUnitPriceDecimal:e.property("per_unit_price_decimal",e.string().optional()),pluralName:e.property("plural_name",e.string().optional()),singularName:e.property("singular_name",e.string().optional())});var Pt=e.object({bundleName:e.property("bundle_name",e.string()),expiryType:e.property("expiry_type",N.optional()),expiryUnit:e.property("expiry_unit",G.optional()),expiryUnitCount:e.property("expiry_unit_count",e.number().optional()),pricePerUnit:e.property("price_per_unit",e.number()),pricePerUnitDecimal:e.property("price_per_unit_decimal",e.string().optional()),quantity:e.number().optional(),status:ue.optional()});var xt=e.object({reason:Lr.optional()});var kl=e.object({creditId:e.property("credit_id",e.string().optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional()});var Bl=e.object({data:A,params:kl});var Al=e.object({ids:e.list(e.string()).optional(),limit:e.number().optional(),name:e.string().optional(),offset:e.number().optional()});var Vl=e.object({data:A,params:Al});var ql=e.object({creditId:e.property("credit_id",e.string().optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),planId:e.property("plan_id",e.string().optional()),planIds:e.property("plan_ids",e.list(e.string()).optional())});var Dl=e.object({data:A,params:ql});var ur=e.enum_(["created_at","expires_at","quantity","quantity_remaining"]);var Ml=e.object({companyId:e.property("company_id",e.string().optional()),dir:we.optional(),limit:e.number().optional(),offset:e.number().optional(),order:ur.optional()});var Fl=e.object({data:A,params:Ml});var Il=e.object({bundleType:e.property("bundle_type",ze.optional()),creditId:e.property("credit_id",e.string().optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),status:ue.optional()});var Kl=e.object({data:A,params:Il});var dr=e.enum_(["daily","monthly","raw","weekly"]);var Gl=e.object({billingCreditId:e.property("billing_credit_id",e.string().optional()),companyId:e.property("company_id",e.string().optional()),endTime:e.property("end_time",e.string().optional()),featureId:e.property("feature_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),period:dr.optional(),startTime:e.property("start_time",e.string().optional())});var Ll=e.object({data:A,params:Gl});var Wl=e.object({data:Ve,params:e.record(e.string(),e.unknown())});var Nl=e.object({data:xe,params:e.record(e.string(),e.unknown())});var Hl=e.object({data:_e,params:e.record(e.string(),e.unknown())});var $l=e.object({applyToExisting:e.property("apply_to_existing",e.boolean().optional())});var Zl=e.object({data:D,params:$l});var Jl=e.object({data:D,params:e.record(e.string(),e.unknown())});var Ql=e.object({data:_e,params:e.record(e.string(),e.unknown())});var Yl=e.object({billingCreditId:e.property("billing_credit_id",e.string().optional()),companyId:e.property("company_id",e.string().optional()),endTime:e.property("end_time",e.string().optional()),featureId:e.property("feature_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),period:dr.optional(),startTime:e.property("start_time",e.string().optional())});var Xl=e.object({description:e.string().optional(),icon:e.string().optional(),id:e.string(),name:e.string(),pluralName:e.property("plural_name",e.string().optional()),singularName:e.property("singular_name",e.string().optional())});var ep=e.object({id:e.string(),logoUrl:e.property("logo_url",e.string().optional()),name:e.string()});var rp=e.object({description:e.string().optional(),icon:e.string().optional(),id:e.string(),name:e.string()});var ip=e.object({billingCreditAutoTopupGrantCount:e.property("billing_credit_auto_topup_grant_count",e.number()),billingCreditId:e.property("billing_credit_id",e.string()),company:ep.optional(),companyId:e.property("company_id",e.string()),credit:Xl.optional(),expiredGrantCount:e.property("expired_grant_count",e.number()),feature:rp.optional(),featureId:e.property("feature_id",e.string().optional()),firstTransactionAt:e.property("first_transaction_at",e.date()),freeGrantCount:e.property("free_grant_count",e.number()),grantCount:e.property("grant_count",e.number()),lastTransactionAt:e.property("last_transaction_at",e.date()),manuallyZeroedCount:e.property("manually_zeroed_count",e.number()),netChange:e.property("net_change",e.number()),planGrantCount:e.property("plan_grant_count",e.number()),purchasedGrantCount:e.property("purchased_grant_count",e.number()),timeBucket:e.property("time_bucket",e.date()),totalConsumed:e.property("total_consumed",e.number()),totalGranted:e.property("total_granted",e.number()),transactionCount:e.property("transaction_count",e.number()),usageCount:e.property("usage_count",e.number()),zeroedOutCount:e.property("zeroed_out_count",e.number())});var op=e.object({data:e.list(ip),params:Yl});var tp=e.object({data:Ve,params:e.record(e.string(),e.unknown())});var ap=e.object({amount:e.number(),createdAt:e.property("created_at",e.date()),direction:e.string(),id:e.string(),reason:e.string(),relatedGrantId:e.property("related_grant_id",e.string())});var ar=e.object({companyId:e.property("company_id",e.string()),companyName:e.property("company_name",e.string()),createdAt:e.property("created_at",e.date()),creditIcon:e.property("credit_icon",e.string().optional()),creditId:e.property("credit_id",e.string()),creditName:e.property("credit_name",e.string()),expiresAt:e.property("expires_at",e.date().optional()),grantReason:e.property("grant_reason",Se),id:e.string(),planId:e.property("plan_id",e.string().optional()),planName:e.property("plan_name",e.string().optional()),price:Q.optional(),quantity:e.number(),quantityRemaining:e.property("quantity_remaining",e.number()),quantityUsed:e.property("quantity_used",e.number()),renewalEnabled:e.property("renewal_enabled",e.boolean()),renewalPeriod:e.property("renewal_period",fe.optional()),sourceLabel:e.property("source_label",e.string()),transfers:e.list(ap).optional(),updatedAt:e.property("updated_at",e.date()),validFrom:e.property("valid_from",e.date().optional()),zeroedOutDate:e.property("zeroed_out_date",e.date().optional()),zeroedOutReason:e.property("zeroed_out_reason",Lr.optional())});var sp=e.object({data:ar,params:e.record(e.string(),e.unknown())});var np=e.object({ids:e.list(e.string()).optional(),limit:e.number().optional(),name:e.string().optional(),offset:e.number().optional()});var cp=e.object({data:e.list(Ve),params:np});var lp=e.object({creditId:e.property("credit_id",e.string().optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),planId:e.property("plan_id",e.string().optional()),planIds:e.property("plan_ids",e.list(e.string()).optional())});var pp=e.object({data:e.list(xe),params:lp});var up=e.object({companyId:e.property("company_id",e.string().optional()),dir:we.optional(),limit:e.number().optional(),offset:e.number().optional(),order:ur.optional()});var dp=e.object({data:e.list(ar),params:up});var mp=e.object({bundleType:e.property("bundle_type",ze.optional()),creditId:e.property("credit_id",e.string().optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),status:ue.optional()});var hp=e.object({data:e.list(_e),params:mp});var gp=e.object({creditId:e.property("credit_id",e.string().optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional()});var yp=e.object({data:e.list(ar),params:gp});var wp=e.object({data:D,params:e.record(e.string(),e.unknown())});var bp=e.object({data:Ve,params:e.record(e.string(),e.unknown())});var zp=e.object({data:xe,params:e.record(e.string(),e.unknown())});var Rp=e.object({data:_e,params:e.record(e.string(),e.unknown())});var fp=e.object({data:ar,params:e.record(e.string(),e.unknown())});var Et=e.object({metadata:e.string()});var _p=e.stringLiteral("csv");var Sp=e.enum_(["failure","pending","success"]);var Pp=e.stringLiteral("company-feature-usage");var xp=e.object({accountId:e.property("account_id",e.string()),createdAt:e.property("created_at",e.date()),environmentId:e.property("environment_id",e.string()),exportType:e.property("export_type",Pp),id:e.string(),metadata:e.string(),outputFileType:e.property("output_file_type",_p),status:Sp,updatedAt:e.property("updated_at",e.date())});var Ep=e.object({data:xp,params:e.record(e.string(),e.unknown())});var Cp=e.enum_(["all_time","current_month","current_week","current_day"]);var Up=e.enum_(["first_of_month","billing_cycle"]);var Ct=e.object({companyId:e.property("company_id",e.string()),creditConsumptionRate:e.property("credit_consumption_rate",e.number().optional()),expirationDate:e.property("expiration_date",e.date().optional()),featureId:e.property("feature_id",e.string()),metricPeriod:e.property("metric_period",Cp.optional()),metricPeriodMonthReset:e.property("metric_period_month_reset",Up.optional()),note:e.string().optional(),valueBool:e.property("value_bool",e.boolean().optional()),valueCreditId:e.property("value_credit_id",e.string().optional()),valueNumeric:e.property("value_numeric",e.number().optional()),valueTraitId:e.property("value_trait_id",e.string().optional()),valueType:e.property("value_type",Y)});var Ue=e.object({flatAmount:e.property("flat_amount",e.number().optional()),perUnitPrice:e.property("per_unit_price",e.number().optional()),perUnitPriceDecimal:e.property("per_unit_price_decimal",e.string().optional()),upTo:e.property("up_to",e.number().optional())});var Tp=e.enum_(["all_time","current_month","current_week","current_day"]);var vp=e.enum_(["first_of_month","billing_cycle"]);var Ut=e.object({billingProductId:e.property("billing_product_id",e.string().optional()),billingThreshold:e.property("billing_threshold",e.number().optional()),creditConsumptionRate:e.property("credit_consumption_rate",e.number().optional()),currency:e.string().optional(),featureId:e.property("feature_id",e.string()),metricPeriod:e.property("metric_period",Tp.optional()),metricPeriodMonthReset:e.property("metric_period_month_reset",vp.optional()),monthlyMeteredPriceId:e.property("monthly_metered_price_id",e.string().optional()),monthlyPriceTiers:e.property("monthly_price_tiers",e.list(Ue).optional()),monthlyUnitPrice:e.property("monthly_unit_price",e.number().optional()),monthlyUnitPriceDecimal:e.property("monthly_unit_price_decimal",e.string().optional()),overageBillingProductId:e.property("overage_billing_product_id",e.string().optional()),planId:e.property("plan_id",e.string()),priceBehavior:e.property("price_behavior",ye.optional()),priceTiers:e.property("price_tiers",e.list(Ue).optional()),softLimit:e.property("soft_limit",e.number().optional()),tierMode:e.property("tier_mode",ie.optional()),valueBool:e.property("value_bool",e.boolean().optional()),valueCreditId:e.property("value_credit_id",e.string().optional()),valueNumeric:e.property("value_numeric",e.number().optional()),valueTraitId:e.property("value_trait_id",e.string().optional()),valueType:e.property("value_type",Y),yearlyMeteredPriceId:e.property("yearly_metered_price_id",e.string().optional()),yearlyPriceTiers:e.property("yearly_price_tiers",e.list(Ue).optional()),yearlyUnitPrice:e.property("yearly_unit_price",e.number().optional()),yearlyUnitPriceDecimal:e.property("yearly_unit_price_decimal",e.string().optional())});var Tt=e.object({sourcePlanId:e.property("source_plan_id",e.string()),targetPlanId:e.property("target_plan_id",e.string())});var Op=e.enum_(["all_time","current_month","current_week","current_day"]);var jp=e.enum_(["first_of_month","billing_cycle"]);var vt=e.object({creditConsumptionRate:e.property("credit_consumption_rate",e.number().optional()),expirationDate:e.property("expiration_date",e.date().optional()),metricPeriod:e.property("metric_period",Op.optional()),metricPeriodMonthReset:e.property("metric_period_month_reset",jp.optional()),note:e.string().optional(),valueBool:e.property("value_bool",e.boolean().optional()),valueCreditId:e.property("value_credit_id",e.string().optional()),valueNumeric:e.property("value_numeric",e.number().optional()),valueTraitId:e.property("value_trait_id",e.string().optional()),valueType:e.property("value_type",Y)});var kp=e.enum_(["all_time","current_month","current_week","current_day"]);var Bp=e.enum_(["first_of_month","billing_cycle"]);var Ot=e.object({billingProductId:e.property("billing_product_id",e.string().optional()),billingThreshold:e.property("billing_threshold",e.number().optional()),creditConsumptionRate:e.property("credit_consumption_rate",e.number().optional()),currency:e.string().optional(),metricPeriod:e.property("metric_period",kp.optional()),metricPeriodMonthReset:e.property("metric_period_month_reset",Bp.optional()),monthlyMeteredPriceId:e.property("monthly_metered_price_id",e.string().optional()),monthlyPriceTiers:e.property("monthly_price_tiers",e.list(Ue).optional()),monthlyUnitPrice:e.property("monthly_unit_price",e.number().optional()),monthlyUnitPriceDecimal:e.property("monthly_unit_price_decimal",e.string().optional()),overageBillingProductId:e.property("overage_billing_product_id",e.string().optional()),priceBehavior:e.property("price_behavior",ye.optional()),priceTiers:e.property("price_tiers",e.list(Ue).optional()),softLimit:e.property("soft_limit",e.number().optional()),tierMode:e.property("tier_mode",ie.optional()),valueBool:e.property("value_bool",e.boolean().optional()),valueCreditId:e.property("value_credit_id",e.string().optional()),valueNumeric:e.property("value_numeric",e.number().optional()),valueTraitId:e.property("value_trait_id",e.string().optional()),valueType:e.property("value_type",Y),yearlyMeteredPriceId:e.property("yearly_metered_price_id",e.string().optional()),yearlyPriceTiers:e.property("yearly_price_tiers",e.list(Ue).optional()),yearlyUnitPrice:e.property("yearly_unit_price",e.number().optional()),yearlyUnitPriceDecimal:e.property("yearly_unit_price_decimal",e.string().optional())});var Ap=e.object({companyId:e.property("company_id",e.string().optional()),companyIds:e.property("company_ids",e.list(e.string()).optional()),featureId:e.property("feature_id",e.string().optional()),featureIds:e.property("feature_ids",e.list(e.string()).optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional(),withoutExpired:e.property("without_expired",e.boolean().optional())});var Vp=e.object({data:A,params:Ap});var qp=e.object({featureId:e.property("feature_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var Dp=e.object({data:A,params:qp});var Mp=e.object({companyId:e.property("company_id",e.string().optional()),companyKeys:e.property("company_keys",e.record(e.string(),e.string()).optional()),featureIds:e.property("feature_ids",e.list(e.string()).optional()),includeUsageAggregation:e.property("include_usage_aggregation",e.boolean().optional()),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional(),withoutNegativeEntitlements:e.property("without_negative_entitlements",e.boolean().optional())});var Fp=e.object({data:A,params:Mp});var Ip=e.object({featureId:e.property("feature_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var Kp=e.object({data:A,params:Ip});var Gp=e.object({featureId:e.property("feature_id",e.string().optional()),featureIds:e.property("feature_ids",e.list(e.string()).optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),planId:e.property("plan_id",e.string().optional()),planIds:e.property("plan_ids",e.list(e.string()).optional()),q:e.string().optional(),withMeteredProducts:e.property("with_metered_products",e.boolean().optional())});var Lp=e.object({data:A,params:Gp});var Wp=e.object({data:Pe,params:e.record(e.string(),e.unknown())});var Np=e.object({data:re,params:e.record(e.string(),e.unknown())});var Hp=e.object({data:D,params:e.record(e.string(),e.unknown())});var $p=e.object({data:D,params:e.record(e.string(),e.unknown())});var Zp=e.object({message:e.string()});var Jp=e.object({entitlementId:e.property("entitlement_id",e.string()),errors:e.list(Zp),featureId:e.property("feature_id",e.string()),featureName:e.property("feature_name",e.string())});var Qp=e.object({data:e.list(re),skipped:e.list(Jp)});var Yp=e.object({data:Qp,params:e.record(e.string(),e.unknown())});var Xp=e.object({data:Pe,params:e.record(e.string(),e.unknown())});var eu=e.object({keys:e.record(e.string(),e.string()).optional()});var ru=e.object({data:Vr,params:eu});var iu=e.object({data:re,params:e.record(e.string(),e.unknown())});var ou=e.object({companyId:e.property("company_id",e.string().optional()),companyIds:e.property("company_ids",e.list(e.string()).optional()),featureId:e.property("feature_id",e.string().optional()),featureIds:e.property("feature_ids",e.list(e.string()).optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional(),withoutExpired:e.property("without_expired",e.boolean().optional())});var tu=e.object({data:e.list(Pe),params:ou});var au=e.object({featureId:e.property("feature_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var su=e.object({creditConsumptionRate:e.property("credit_consumption_rate",e.number().optional()),creditGrantCounts:e.property("credit_grant_counts",e.record(e.string(),e.number()).optional()),creditGrantDetails:e.property("credit_grant_details",e.list(rr).optional()),creditRemaining:e.property("credit_remaining",e.number().optional()),creditTotal:e.property("credit_total",e.number().optional()),creditTypeIcon:e.property("credit_type_icon",e.string().optional()),creditTypeName:e.property("credit_type_name",e.string().optional()),creditUsed:e.property("credit_used",e.number().optional()),usageAggregation:e.property("usage_aggregation",Or.optional())});var nu=e.object({access:e.boolean(),allocation:e.number().optional(),allocationType:e.property("allocation_type",Y),company:L.optional(),companyOverride:e.property("company_override",Pe.optional()),creditConsumptionRate:e.property("credit_consumption_rate",e.number().optional()),creditGrantCounts:e.property("credit_grant_counts",e.record(e.string(),e.number()).optional()),creditGrantDetails:e.property("credit_grant_details",e.list(rr).optional()),creditGrantReason:e.property("credit_grant_reason",Se.optional()),creditRemaining:e.property("credit_remaining",e.number().optional()),creditTotal:e.property("credit_total",e.number().optional()),creditTypeIcon:e.property("credit_type_icon",e.string().optional()),creditUsage:e.property("credit_usage",su.optional()),creditUsageAggregation:e.property("credit_usage_aggregation",Or.optional()),creditUsed:e.property("credit_used",e.number().optional()),effectiveLimit:e.property("effective_limit",e.number().optional()),effectivePrice:e.property("effective_price",e.number().optional()),entitlementExpirationDate:e.property("entitlement_expiration_date",e.date().optional()),entitlementId:e.property("entitlement_id",e.string()),entitlementSource:e.property("entitlement_source",e.string().optional()),entitlementType:e.property("entitlement_type",jr),feature:ee.optional(),hasValidAllocation:e.property("has_valid_allocation",e.boolean().optional()),isUnlimited:e.property("is_unlimited",e.boolean().optional()),metricResetAt:e.property("metric_reset_at",e.date().optional()),monthReset:e.property("month_reset",e.string().optional()),monthlyUsageBasedPrice:e.property("monthly_usage_based_price",J.optional()),overuse:e.number().optional(),percentUsed:e.property("percent_used",e.number().optional()),period:e.string().optional(),plan:qe.optional(),planEntitlement:e.property("plan_entitlement",re.optional()),priceBehavior:e.property("price_behavior",ye.optional()),softLimit:e.property("soft_limit",e.number().optional()),usage:e.number().optional(),yearlyUsageBasedPrice:e.property("yearly_usage_based_price",J.optional())});var cu=e.object({data:e.list(nu),params:au});var lu=e.object({companyId:e.property("company_id",e.string().optional()),companyKeys:e.property("company_keys",e.record(e.string(),e.string()).optional()),featureIds:e.property("feature_ids",e.list(e.string()).optional()),includeUsageAggregation:e.property("include_usage_aggregation",e.boolean().optional()),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional(),withoutNegativeEntitlements:e.property("without_negative_entitlements",e.boolean().optional())});var pu=e.object({data:e.list(or),params:lu});var uu=e.object({featureId:e.property("feature_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var du=e.object({access:e.boolean(),allocation:e.number().optional(),allocationType:e.property("allocation_type",Y),company:L.optional(),entitlementId:e.property("entitlement_id",e.string()),entitlementType:e.property("entitlement_type",jr),feature:ee.optional(),metricResetAt:e.property("metric_reset_at",e.date().optional()),monthReset:e.property("month_reset",e.string().optional()),period:e.string().optional(),plan:qe.optional(),usage:e.number().optional(),user:Di.optional()});var mu=e.object({data:e.list(du),params:uu});var hu=e.object({featureId:e.property("feature_id",e.string().optional()),featureIds:e.property("feature_ids",e.list(e.string()).optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),planId:e.property("plan_id",e.string().optional()),planIds:e.property("plan_ids",e.list(e.string()).optional()),q:e.string().optional(),withMeteredProducts:e.property("with_metered_products",e.boolean().optional())});var gu=e.object({data:e.list(re),params:hu});var yu=e.object({data:Pe,params:e.record(e.string(),e.unknown())});var wu=e.object({data:re,params:e.record(e.string(),e.unknown())});var bu=e.object({companyId:e.property("company_id",e.string().optional()),error:e.string().optional(),flagId:e.property("flag_id",e.string().optional()),flagKey:e.property("flag_key",e.string()),reason:e.string(),reqCompany:e.property("req_company",e.record(e.string(),e.string()).optional()),reqUser:e.property("req_user",e.record(e.string(),e.string()).optional()),ruleId:e.property("rule_id",e.string().optional()),userId:e.property("user_id",e.string().optional()),value:e.boolean()});var zu=e.object({keys:e.record(e.string(),e.string()),name:e.string().optional(),traits:e.record(e.string(),e.unknown()).optional()});var Ru=e.object({company:zu.optional(),keys:e.record(e.string(),e.string()),name:e.string().optional(),traits:e.record(e.string(),e.unknown()).optional()});var fu=e.object({company:e.record(e.string(),e.string()).optional(),event:e.string(),quantity:e.number().optional(),traits:e.record(e.string(),e.unknown()).optional(),user:e.record(e.string(),e.string()).optional()});var _u=e.undiscriminatedUnion([fu,bu,Ru]);var Ne=e.enum_(["flag_check","identify","track"]);var Ii=e.object({body:_u.optional(),eventType:e.property("event_type",Ne),sentAt:e.property("sent_at",e.date().optional())});var jt=e.object({events:e.list(Ii)});var Ki=e.object({capturedAt:e.property("captured_at",e.date()),eventId:e.property("event_id",e.string().optional()),remoteAddr:e.property("remote_addr",e.string().optional()),remoteIp:e.property("remote_ip",e.string()),userAgent:e.property("user_agent",e.string())});var Su=e.object({events:e.list(Ki)});var Pu=e.object({data:Su,params:e.record(e.string(),e.unknown())});var xu=e.object({data:Ki,params:e.record(e.string(),e.unknown())});var Eu=e.enum_(["enriched","failed","pending","processed","unknown"]);var Gi=e.object({apiKey:e.property("api_key",e.string().optional()),body:e.record(e.string(),e.unknown()),bodyPreview:e.property("body_preview",e.string()),capturedAt:e.property("captured_at",e.date()),company:kr.optional(),companyId:e.property("company_id",e.string().optional()),enrichedAt:e.property("enriched_at",e.date().optional()),environmentId:e.property("environment_id",e.string().optional()),errorMessage:e.property("error_message",e.string().optional()),featureIds:e.property("feature_ids",e.list(e.string())),features:e.list(kr),id:e.string(),loadedAt:e.property("loaded_at",e.date().optional()),processedAt:e.property("processed_at",e.date().optional()),quantity:e.number(),sentAt:e.property("sent_at",e.date().optional()),status:Eu,subtype:e.string().optional(),type:Ne,updatedAt:e.property("updated_at",e.date().optional()),user:kr.optional(),userId:e.property("user_id",e.string().optional())});var Cu=e.object({data:Gi,params:e.record(e.string(),e.unknown())});var Uu=e.object({eventSubtypes:e.property("event_subtypes",e.list(e.string()).optional()),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var Tu=e.object({data:e.list(Bi),params:Uu});var vu=e.object({connected:e.boolean(),environmentId:e.property("environment_id",e.string()),lastEventAt:e.property("last_event_at",e.date().optional())});var Ou=e.object({data:vu,params:e.record(e.string(),e.unknown())});var ju=e.object({companyId:e.property("company_id",e.string().optional()),eventSubtype:e.property("event_subtype",e.string().optional()),eventTypes:e.property("event_types",e.list(Ne).optional()),flagId:e.property("flag_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),userId:e.property("user_id",e.string().optional())});var ku=e.object({data:e.list(Gi),params:ju});var ni=e.object({company:e.record(e.string(),e.string()).optional(),user:e.record(e.string(),e.string()).optional()});var kt=e.object({contexts:e.list(ni)});var Li=e.object({defaultValue:e.property("default_value",e.boolean()),description:e.string(),featureId:e.property("feature_id",e.string().optional()),flagType:e.property("flag_type",ir),id:e.string().optional(),key:e.string(),maintainerId:e.property("maintainer_id",e.string().optional()),name:e.string()});var Bt=e.object({description:e.string(),eventSubtype:e.property("event_subtype",e.string().optional()),featureType:e.property("feature_type",te),flag:Li.optional(),icon:e.string().optional(),lifecyclePhase:e.property("lifecycle_phase",er.optional()),maintainerId:e.property("maintainer_id",e.string().optional()),name:e.string(),pluralName:e.property("plural_name",e.string().optional()),singularName:e.property("singular_name",e.string().optional()),traitId:e.property("trait_id",e.string().optional())});var At=e.object({description:e.string().optional(),eventSubtype:e.property("event_subtype",e.string().optional()),featureType:e.property("feature_type",te.optional()),flag:Li.optional(),icon:e.string().optional(),lifecyclePhase:e.property("lifecycle_phase",er.optional()),maintainerId:e.property("maintainer_id",e.string().optional()),name:e.string().optional(),pluralName:e.property("plural_name",e.string().optional()),singularName:e.property("singular_name",e.string().optional()),traitId:e.property("trait_id",e.string().optional())});var Bu=e.enum_(["company","metric","trait","user","plan","billing_product","base_plan"]);var Au=e.enum_(["all_time","current_month","current_week","current_day"]);var Vu=e.enum_(["first_of_month","billing_cycle"]);var qu=e.enum_(["eq","ne","gt","gte","lt","lte","is_empty","not_empty"]);var Wi=e.object({comparisonTraitId:e.property("comparison_trait_id",e.string().optional()),conditionType:e.property("condition_type",Bu),creditCost:e.property("credit_cost",e.number().optional()),creditId:e.property("credit_id",e.string().optional()),eventSubtype:e.property("event_subtype",e.string().optional()),id:e.string().optional(),metricPeriod:e.property("metric_period",Au.optional()),metricPeriodMonthReset:e.property("metric_period_month_reset",Vu.optional()),metricValue:e.property("metric_value",e.number().optional()),operator:qu,resourceIds:e.property("resource_ids",e.list(e.string())),traitId:e.property("trait_id",e.string().optional()),traitValue:e.property("trait_value",e.string().optional())});var Du=e.object({conditions:e.list(Wi),flagId:e.property("flag_id",e.string().optional()),id:e.string().optional()});var Mu=e.enum_(["global_override","company_override","plan_entitlement","standard","default"]);var Fu=e.object({conditionGroups:e.property("condition_groups",e.list(Du)),conditions:e.list(Wi),id:e.string().optional(),name:e.string(),priority:e.number(),ruleType:e.property("rule_type",Mu.optional()),value:e.boolean()});var Vt=e.object({rules:e.list(Fu)});var Ni=e.object({companyId:e.property("company_id",e.string().optional()),error:e.string().optional(),featureAllocation:e.property("feature_allocation",e.number().optional()),featureUsage:e.property("feature_usage",e.number().optional()),featureUsageEvent:e.property("feature_usage_event",e.string().optional()),featureUsagePeriod:e.property("feature_usage_period",e.string().optional()),featureUsageResetAt:e.property("feature_usage_reset_at",e.date().optional()),flag:e.string(),flagId:e.property("flag_id",e.string().optional()),reason:e.string(),ruleId:e.property("rule_id",e.string().optional()),ruleType:e.property("rule_type",e.string().optional()),userId:e.property("user_id",e.string().optional()),value:e.boolean()});var Iu=e.object({data:Ni,params:e.record(e.string(),e.unknown())});var Hi=e.object({flags:e.list(Ni)});var Ku=e.object({data:e.list(Hi)});var Gu=e.object({data:Ku,params:e.record(e.string(),e.unknown())});var Lu=e.object({data:Hi,params:e.record(e.string(),e.unknown())});var Wu=e.object({booleanRequireEvent:e.property("boolean_require_event",e.boolean().optional()),featureType:e.property("feature_type",e.list(te).optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional(),withoutCompanyOverrideFor:e.property("without_company_override_for",e.string().optional()),withoutPlanEntitlementFor:e.property("without_plan_entitlement_for",e.string().optional())});var Nu=e.object({data:A,params:Wu});var Hu=e.object({featureId:e.property("feature_id",e.string().optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var $u=e.object({data:A,params:Hu});var Zu=e.object({data:ee,params:e.record(e.string(),e.unknown())});var Ju=e.object({data:Ae,params:e.record(e.string(),e.unknown())});var Qu=e.object({data:D,params:e.record(e.string(),e.unknown())});var Yu=e.object({data:D,params:e.record(e.string(),e.unknown())});var Xu=e.object({data:ee,params:e.record(e.string(),e.unknown())});var ed=e.object({data:Ae,params:e.record(e.string(),e.unknown())});var rd=e.object({booleanRequireEvent:e.property("boolean_require_event",e.boolean().optional()),featureType:e.property("feature_type",e.list(te).optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional(),withoutCompanyOverrideFor:e.property("without_company_override_for",e.string().optional()),withoutPlanEntitlementFor:e.property("without_plan_entitlement_for",e.string().optional())});var id=e.object({data:e.list(ee),params:rd});var od=e.object({featureId:e.property("feature_id",e.string().optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var td=e.object({data:e.list(Ae),params:od});var ad=e.object({data:ee,params:e.record(e.string(),e.unknown())});var sd=e.object({data:Ae,params:e.record(e.string(),e.unknown())});var nd=e.object({createdAt:e.property("created_at",e.date()),defaultValue:e.property("default_value",e.boolean()),description:e.string(),featureId:e.property("feature_id",e.string().optional()),flagType:e.property("flag_type",ir),id:e.string(),key:e.string(),maintainerId:e.property("maintainer_id",e.string().optional()),name:e.string(),updatedAt:e.property("updated_at",e.date())});var cd=e.object({flag:nd.optional(),rules:e.list(Vi)});var ld=e.object({data:cd,params:e.record(e.string(),e.unknown())});var $i=e.object({description:e.string(),icon:e.string().optional(),name:e.string(),planType:e.property("plan_type",ae)});var Zi=e.stringLiteral("credit");var Ji=e.object({applyToExisting:e.property("apply_to_existing",e.boolean().optional()),autoTopupAmount:e.property("auto_topup_amount",e.number().optional()),autoTopupAmountType:e.property("auto_topup_amount_type",Zi.optional()),autoTopupEnabled:e.property("auto_topup_enabled",e.boolean().optional()),autoTopupExpiryType:e.property("auto_topup_expiry_type",N.optional()),autoTopupExpiryUnit:e.property("auto_topup_expiry_unit",G.optional()),autoTopupExpiryUnitCount:e.property("auto_topup_expiry_unit_count",e.number().optional()),autoTopupThresholdPercent:e.property("auto_topup_threshold_percent",e.number().optional()),creditAmount:e.property("credit_amount",e.number()),creditId:e.property("credit_id",e.string()),expiryType:e.property("expiry_type",N.optional()),expiryUnit:e.property("expiry_unit",G.optional()),expiryUnitCount:e.property("expiry_unit_count",e.number().optional()),planId:e.property("plan_id",e.string()),resetCadence:e.property("reset_cadence",fe),resetStart:e.property("reset_start",Be),resetType:e.property("reset_type",Xe.optional())});var pd=e.object({applyToExisting:e.property("apply_to_existing",e.boolean().optional())});var Qi=e.enum_(["create","update","delete"]);var Yi=e.object({applyToExisting:e.property("apply_to_existing",e.boolean().optional()),autoTopupAmount:e.property("auto_topup_amount",e.number().optional()),autoTopupAmountType:e.property("auto_topup_amount_type",Zi.optional()),autoTopupEnabled:e.property("auto_topup_enabled",e.boolean().optional()),autoTopupExpiryType:e.property("auto_topup_expiry_type",N.optional()),autoTopupExpiryUnit:e.property("auto_topup_expiry_unit",G.optional()),autoTopupExpiryUnitCount:e.property("auto_topup_expiry_unit_count",e.number().optional()),autoTopupThresholdPercent:e.property("auto_topup_threshold_percent",e.number().optional()),creditAmount:e.property("credit_amount",e.number().optional()),expiryType:e.property("expiry_type",N.optional()),expiryUnit:e.property("expiry_unit",G.optional()),expiryUnitCount:e.property("expiry_unit_count",e.number().optional()),resetCadence:e.property("reset_cadence",fe),resetStart:e.property("reset_start",Be),resetType:e.property("reset_type",Xe.optional())});var Xi=e.object({action:Qi,createReq:e.property("create_req",Ji.optional()),creditGrantId:e.property("credit_grant_id",e.string().optional()),deleteReq:e.property("delete_req",pd.optional()),updateReq:e.property("update_req",Yi.optional())});var ud=e.enum_(["all_time","current_month","current_week","current_day"]);var dd=e.enum_(["first_of_month","billing_cycle"]);var md=e.object({billingProductId:e.property("billing_product_id",e.string().optional()),billingThreshold:e.property("billing_threshold",e.number().optional()),creditConsumptionRate:e.property("credit_consumption_rate",e.number().optional()),currency:e.string().optional(),featureId:e.property("feature_id",e.string()),metricPeriod:e.property("metric_period",ud.optional()),metricPeriodMonthReset:e.property("metric_period_month_reset",dd.optional()),monthlyMeteredPriceId:e.property("monthly_metered_price_id",e.string().optional()),monthlyPriceTiers:e.property("monthly_price_tiers",e.list(Ue).optional()),monthlyUnitPrice:e.property("monthly_unit_price",e.number().optional()),monthlyUnitPriceDecimal:e.property("monthly_unit_price_decimal",e.string().optional()),overageBillingProductId:e.property("overage_billing_product_id",e.string().optional()),priceBehavior:e.property("price_behavior",ye.optional()),priceTiers:e.property("price_tiers",e.list(Ue).optional()),softLimit:e.property("soft_limit",e.number().optional()),tierMode:e.property("tier_mode",ie.optional()),valueBool:e.property("value_bool",e.boolean().optional()),valueCreditId:e.property("value_credit_id",e.string().optional()),valueNumeric:e.property("value_numeric",e.number().optional()),valueTraitId:e.property("value_trait_id",e.string().optional()),valueType:e.property("value_type",Y),yearlyMeteredPriceId:e.property("yearly_metered_price_id",e.string().optional()),yearlyPriceTiers:e.property("yearly_price_tiers",e.list(Ue).optional()),yearlyUnitPrice:e.property("yearly_unit_price",e.number().optional()),yearlyUnitPriceDecimal:e.property("yearly_unit_price_decimal",e.string().optional())});var eo=e.object({action:Qi,entitlementId:e.property("entitlement_id",e.string().optional()),req:md.optional()});var Wr=e.object({billingProductId:e.property("billing_product_id",e.string().optional()),chargeType:e.property("charge_type",De),currency:e.string().optional(),isTrialable:e.property("is_trialable",e.boolean()),monthlyPrice:e.property("monthly_price",e.number().optional()),monthlyPriceId:e.property("monthly_price_id",e.string().optional()),oneTimePrice:e.property("one_time_price",e.number().optional()),oneTimePriceId:e.property("one_time_price_id",e.string().optional()),trialDays:e.property("trial_days",e.number().optional()),yearlyPrice:e.property("yearly_price",e.number().optional()),yearlyPriceId:e.property("yearly_price_id",e.string().optional())});var qt=e.object({billingProduct:e.property("billing_product",Wr.optional()),creditGrants:e.property("credit_grants",e.list(Xi).optional()),entitlements:e.list(eo),plan:$i.optional(),traits:e.list(Dr).optional()});var ro=e.object({description:e.string().optional(),icon:e.string().optional(),name:e.string()});var Dt=e.object({billingProduct:e.property("billing_product",Wr.optional()),creditGrants:e.property("credit_grants",e.list(Xi).optional()),entitlements:e.list(eo),plan:ro.optional(),traits:e.list(Dr).optional()});var io=e.object({accountId:e.property("account_id",e.string()),billingProductId:e.property("billing_product_id",e.string()),chargeType:e.property("charge_type",De),controlledBy:e.property("controlled_by",tr),environmentId:e.property("environment_id",e.string()),isTrialable:e.property("is_trialable",e.boolean()),monthlyPriceId:e.property("monthly_price_id",e.string().optional()),oneTimePriceId:e.property("one_time_price_id",e.string().optional()),planId:e.property("plan_id",e.string()),trialDays:e.property("trial_days",e.number().optional()),yearlyPriceId:e.property("yearly_price_id",e.string().optional())});var oo=e.object({billingProduct:e.property("billing_product",io.optional()),creditGrants:e.property("credit_grants",e.list(xe).optional()),entitlements:e.list(re).optional(),plan:qe.optional(),traits:e.list(Ee).optional()});var hd=e.object({data:oo,params:e.record(e.string(),e.unknown())});var gd=e.object({data:oo,params:e.record(e.string(),e.unknown())});var yd=e.object({entitlementId:e.property("entitlement_id",e.string()),visible:e.boolean().optional()});var He=e.object({entitlements:e.list(yd).optional(),planId:e.property("plan_id",e.string())});var Nr=e.object({bundleId:e.string()});var to=e.enum_(["create_prorations","invoice_immediately"]);var Mt=e.object({addOnCompatibilities:e.property("add_on_compatibilities",e.list(Gr).optional()),addOnIds:e.property("add_on_ids",e.list(e.string())),checkoutCollectAddress:e.property("checkout_collect_address",e.boolean()),checkoutCollectEmail:e.property("checkout_collect_email",e.boolean()),checkoutCollectPhone:e.property("checkout_collect_phone",e.boolean()),customPlanConfig:e.property("custom_plan_config",Kr.optional()),customPlanId:e.property("custom_plan_id",e.string().optional()),enableTaxCollection:e.property("enable_tax_collection",e.boolean()),fallbackPlanId:e.property("fallback_plan_id",e.string().optional()),initialPlanId:e.property("initial_plan_id",e.string().optional()),initialPlanPriceId:e.property("initial_plan_price_id",e.string().optional()),orderedAddOns:e.property("ordered_add_ons",e.list(He)),orderedBundleList:e.property("ordered_bundle_list",e.list(Nr)),orderedPlans:e.property("ordered_plans",e.list(He)),preventDowngradesWhenOverLimit:e.property("prevent_downgrades_when_over_limit",e.boolean()),preventSelfServiceDowngrade:e.property("prevent_self_service_downgrade",e.boolean()),preventSelfServiceDowngradeButtonText:e.property("prevent_self_service_downgrade_button_text",e.string().optional()),preventSelfServiceDowngradeUrl:e.property("prevent_self_service_downgrade_url",e.string().optional()),prorationBehavior:e.property("proration_behavior",to),showAsMonthlyPrices:e.property("show_as_monthly_prices",e.boolean()),showCredits:e.property("show_credits",e.boolean()),showPeriodToggle:e.property("show_period_toggle",e.boolean()),showZeroPriceAsFree:e.property("show_zero_price_as_free",e.boolean()),syncCustomerBillingDetails:e.property("sync_customer_billing_details",e.boolean()),trialDays:e.property("trial_days",e.number().optional()),trialExpiryPlanId:e.property("trial_expiry_plan_id",e.string().optional()),trialExpiryPlanPriceId:e.property("trial_expiry_plan_price_id",e.string().optional()),trialPaymentMethodRequired:e.property("trial_payment_method_required",e.boolean().optional())});var Ft=e.object({addOnCompatibilities:e.property("add_on_compatibilities",e.list(Gr).optional()),addOnIds:e.property("add_on_ids",e.list(e.string())),checkoutCollectAddress:e.property("checkout_collect_address",e.boolean()),checkoutCollectEmail:e.property("checkout_collect_email",e.boolean()),checkoutCollectPhone:e.property("checkout_collect_phone",e.boolean()),customPlanConfig:e.property("custom_plan_config",Kr.optional()),customPlanId:e.property("custom_plan_id",e.string().optional()),enableTaxCollection:e.property("enable_tax_collection",e.boolean()),fallbackPlanId:e.property("fallback_plan_id",e.string().optional()),initialPlanId:e.property("initial_plan_id",e.string().optional()),initialPlanPriceId:e.property("initial_plan_price_id",e.string().optional()),orderedAddOns:e.property("ordered_add_ons",e.list(He)),orderedBundleList:e.property("ordered_bundle_list",e.list(Nr)),orderedPlans:e.property("ordered_plans",e.list(He)),preventDowngradesWhenOverLimit:e.property("prevent_downgrades_when_over_limit",e.boolean()),preventSelfServiceDowngrade:e.property("prevent_self_service_downgrade",e.boolean()),preventSelfServiceDowngradeButtonText:e.property("prevent_self_service_downgrade_button_text",e.string().optional()),preventSelfServiceDowngradeUrl:e.property("prevent_self_service_downgrade_url",e.string().optional()),prorationBehavior:e.property("proration_behavior",to),showAsMonthlyPrices:e.property("show_as_monthly_prices",e.boolean()),showCredits:e.property("show_credits",e.boolean()),showPeriodToggle:e.property("show_period_toggle",e.boolean()),showZeroPriceAsFree:e.property("show_zero_price_as_free",e.boolean()),syncCustomerBillingDetails:e.property("sync_customer_billing_details",e.boolean()),trialDays:e.property("trial_days",e.number().optional()),trialExpiryPlanId:e.property("trial_expiry_plan_id",e.string().optional()),trialExpiryPlanPriceId:e.property("trial_expiry_plan_price_id",e.string().optional()),trialPaymentMethodRequired:e.property("trial_payment_method_required",e.boolean().optional())});var ao=e.object({collectAddress:e.property("collect_address",e.boolean()),collectEmail:e.property("collect_email",e.boolean()),collectPhone:e.property("collect_phone",e.boolean())});var wd=e.object({compatiblePlanIds:e.property("compatible_plan_ids",e.list(e.string())),sourcePlanId:e.property("source_plan_id",e.string())});var so=e.object({showAsMonthlyPrices:e.property("show_as_monthly_prices",e.boolean()),showCredits:e.property("show_credits",e.boolean()),showPeriodToggle:e.property("show_period_toggle",e.boolean()),showZeroPriceAsFree:e.property("show_zero_price_as_free",e.boolean())});var no=e.object({addOnCompatibilities:e.property("add_on_compatibilities",e.list(wd)),addOnIds:e.property("add_on_ids",e.list(e.string())),checkoutSettings:e.property("checkout_settings",ao),componentSettings:e.property("component_settings",so),defaultPlanId:e.property("default_plan_id",e.string().optional()),fallbackPlanId:e.property("fallback_plan_id",e.string().optional()),id:e.string(),initialPlanId:e.property("initial_plan_id",e.string().optional()),initialPlanPriceId:e.property("initial_plan_price_id",e.string().optional()),orderedAddOnIds:e.property("ordered_add_on_ids",e.list(He)),planIds:e.property("plan_ids",e.list(He)),preventDowngradesWhenOverLimit:e.property("prevent_downgrades_when_over_limit",e.boolean()),preventSelfServiceDowngrade:e.property("prevent_self_service_downgrade",e.boolean()),preventSelfServiceDowngradeButtonText:e.property("prevent_self_service_downgrade_button_text",e.string().optional()),preventSelfServiceDowngradeUrl:e.property("prevent_self_service_downgrade_url",e.string().optional()),prorationBehavior:e.property("proration_behavior",e.string()),showAsMonthlyPrices:e.property("show_as_monthly_prices",e.boolean()),showCredits:e.property("show_credits",e.boolean()),showPeriodToggle:e.property("show_period_toggle",e.boolean()),showZeroPriceAsFree:e.property("show_zero_price_as_free",e.boolean()),syncCustomerBillingDetails:e.property("sync_customer_billing_details",e.boolean()),taxCollectionEnabled:e.property("tax_collection_enabled",e.boolean()),trialDays:e.property("trial_days",e.number().optional()),trialExpiryPlanId:e.property("trial_expiry_plan_id",e.string().optional()),trialExpiryPlanPriceId:e.property("trial_expiry_plan_price_id",e.string().optional()),trialPaymentMethodRequired:e.property("trial_payment_method_required",e.boolean().optional())});var bd=e.object({data:no,params:e.record(e.string(),e.unknown())});var co=e.object({ctaText:e.property("cta_text",e.string()),ctaWebSite:e.property("cta_web_site",e.string()),priceText:e.property("price_text",e.string())});var mr=e.object({audienceType:e.property("audience_type",e.string().optional()),billingProduct:e.property("billing_product",Qe.optional()),chargeType:e.property("charge_type",De),companyCount:e.property("company_count",e.number()),compatiblePlanIds:e.property("compatible_plan_ids",e.list(e.string())),controlledBy:e.property("controlled_by",tr),createdAt:e.property("created_at",e.date()),customPlanConfig:e.property("custom_plan_config",co.optional()),description:e.string(),entitlements:e.list(re),features:e.list(ee),icon:e.string(),id:e.string(),includedCreditGrants:e.property("included_credit_grants",e.list(xe).optional()),isCustom:e.property("is_custom",e.boolean()),isDefault:e.property("is_default",e.boolean()),isFree:e.property("is_free",e.boolean()),isTrialable:e.property("is_trialable",e.boolean()),monthlyPrice:e.property("monthly_price",Q.optional()),name:e.string(),oneTimePrice:e.property("one_time_price",Q.optional()),planType:e.property("plan_type",ae),trialDays:e.property("trial_days",e.number().optional()),updatedAt:e.property("updated_at",e.date()),versions:e.list(qr),yearlyPrice:e.property("yearly_price",Q.optional())});var zd=e.object({planEntitlementId:e.property("plan_entitlement_id",e.string()),visible:e.boolean().optional()});var It=e.object({entitlements:e.list(zd).optional(),planId:e.property("plan_id",e.string())});var Rd=e.object({addOns:e.property("add_ons",e.list(mr)),checkoutSettings:e.property("checkout_settings",ao),componentSettings:e.property("component_settings",so),customPlanConfig:e.property("custom_plan_config",co.optional()),customPlanId:e.property("custom_plan_id",e.string().optional()),defaultPlan:e.property("default_plan",mr.optional()),defaultPlanId:e.property("default_plan_id",e.string().optional()),fallbackPlan:e.property("fallback_plan",mr.optional()),fallbackPlanId:e.property("fallback_plan_id",e.string().optional()),id:e.string(),initialPlan:e.property("initial_plan",mr.optional()),initialPlanId:e.property("initial_plan_id",e.string().optional()),initialPlanPrice:e.property("initial_plan_price",J.optional()),initialPlanPriceId:e.property("initial_plan_price_id",e.string().optional()),orderedAddOnList:e.property("ordered_add_on_list",e.list(It)),orderedBundleList:e.property("ordered_bundle_list",e.list(Nr)),orderedPlanList:e.property("ordered_plan_list",e.list(It)),plans:e.list(mr),preventDowngradesWhenOverLimit:e.property("prevent_downgrades_when_over_limit",e.boolean()),preventSelfServiceDowngrade:e.property("prevent_self_service_downgrade",e.boolean()),preventSelfServiceDowngradeButtonText:e.property("prevent_self_service_downgrade_button_text",e.string().optional()),preventSelfServiceDowngradeUrl:e.property("prevent_self_service_downgrade_url",e.string().optional()),prorationBehavior:e.property("proration_behavior",e.string()),showAsMonthlyPrices:e.property("show_as_monthly_prices",e.boolean()),showCredits:e.property("show_credits",e.boolean()),showPeriodToggle:e.property("show_period_toggle",e.boolean()),showZeroPriceAsFree:e.property("show_zero_price_as_free",e.boolean()),syncCustomerBillingDetails:e.property("sync_customer_billing_details",e.boolean()),taxCollectionEnabled:e.property("tax_collection_enabled",e.boolean()),trialDays:e.property("trial_days",e.number().optional()),trialExpiryPlan:e.property("trial_expiry_plan",mr.optional()),trialExpiryPlanId:e.property("trial_expiry_plan_id",e.string().optional()),trialExpiryPlanPrice:e.property("trial_expiry_plan_price",J.optional()),trialExpiryPlanPriceId:e.property("trial_expiry_plan_price_id",e.string().optional()),trialPaymentMethodRequired:e.property("trial_payment_method_required",e.boolean().optional())});var fd=e.object({data:Rd,params:e.record(e.string(),e.unknown())});var _d=e.object({data:no,params:e.record(e.string(),e.unknown())});var Kt=e.object({addOnIds:e.property("add_on_ids",e.list(e.string())),basePlanId:e.property("base_plan_id",e.string().optional())});var Sd=e.object({companyId:e.property("company_id",e.string().optional()),forFallbackPlan:e.property("for_fallback_plan",e.boolean().optional()),forInitialPlan:e.property("for_initial_plan",e.boolean().optional()),forTrialExpiryPlan:e.property("for_trial_expiry_plan",e.boolean().optional()),hasProductId:e.property("has_product_id",e.boolean().optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),planType:e.property("plan_type",ae.optional()),q:e.string().optional(),withoutEntitlementFor:e.property("without_entitlement_for",e.string().optional()),withoutPaidProductId:e.property("without_paid_product_id",e.boolean().optional())});var Pd=e.object({data:A,params:Sd});var xd=e.object({data:de,params:e.record(e.string(),e.unknown())});var Ed=e.object({data:D,params:e.record(e.string(),e.unknown())});var Cd=e.object({data:de,params:e.record(e.string(),e.unknown())});var Ud=e.object({planId:e.property("plan_id",e.string().optional())});var Td=e.object({code:e.string(),description:e.string(),detail:e.string().optional(),id:e.string().optional()});var vd=e.object({data:e.list(Td),params:Ud});var Od=e.object({companyId:e.property("company_id",e.string().optional()),forFallbackPlan:e.property("for_fallback_plan",e.boolean().optional()),forInitialPlan:e.property("for_initial_plan",e.boolean().optional()),forTrialExpiryPlan:e.property("for_trial_expiry_plan",e.boolean().optional()),hasProductId:e.property("has_product_id",e.boolean().optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),planType:e.property("plan_type",ae.optional()),q:e.string().optional(),withoutEntitlementFor:e.property("without_entitlement_for",e.string().optional()),withoutPaidProductId:e.property("without_paid_product_id",e.boolean().optional())});var jd=e.object({data:e.list(de),params:Od});var kd=e.object({data:L,params:e.record(e.string(),e.unknown())});var Bd=e.object({data:de,params:e.record(e.string(),e.unknown())});var Ad=e.object({data:io,params:e.record(e.string(),e.unknown())});var Hr=e.object({creditId:e.property("credit_id",e.string())});var $r=e.object({featureId:e.property("feature_id",e.string())});var sr=e.enum_(["subscription.trial.ended","company.created","company.deleted","company.override.created","company.override.deleted","company.override.expired","company.override.updated","company.plan_changed","company.updated","credit.limit.reached","credit.limit.warning","entitlement.limit.reached","entitlement.limit.warning","entitlement.soft_limit.reached","entitlement.soft_limit.warning","entitlement.tier_limit.reached","entitlement.tier_limit.warning","feature.created","feature.deleted","feature.updated","flag.created","flag.deleted","flag_rules.updated","flag.updated","plan.created","plan.deleted","plan.entitlement.created","plan.entitlement.deleted","plan.entitlement.updated","plan.updated","rule.deleted","test.send","user.created","user.deleted","user.updated","auto.topup.hard.failure","auto.topup.retry.exceeded"]);var Gt=e.object({creditTriggerConfigs:e.property("credit_trigger_configs",e.list(Hr).optional()),entitlementTriggerConfigs:e.property("entitlement_trigger_configs",e.list($r).optional()),name:e.string(),requestTypes:e.property("request_types",e.list(sr)),url:e.string()});var lo=e.enum_(["active","inactive"]);var Lt=e.object({creditTriggerConfigs:e.property("credit_trigger_configs",e.list(Hr).optional()),entitlementTriggerConfigs:e.property("entitlement_trigger_configs",e.list($r).optional()),name:e.string().optional(),requestTypes:e.property("request_types",e.list(sr).optional()),status:lo.optional(),url:e.string().optional()});var Vd=e.object({ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional(),webhookId:e.property("webhook_id",e.string().optional())});var qd=e.object({data:A,params:Vd});var Dd=e.object({limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var Md=e.object({data:A,params:Dd});var Fe=e.object({createdAt:e.property("created_at",e.date()),creditTriggerConfigs:e.property("credit_trigger_configs",e.list(Hr).optional()),entitlementTriggerConfigs:e.property("entitlement_trigger_configs",e.list($r).optional()),id:e.string(),name:e.string(),requestTypes:e.property("request_types",e.list(sr)),secret:e.string(),status:lo,updatedAt:e.property("updated_at",e.date()),url:e.string()});var Fd=e.object({data:Fe,params:e.record(e.string(),e.unknown())});var Id=e.object({data:D,params:e.record(e.string(),e.unknown())});var Kd=e.enum_(["failure","pending","success"]);var po=e.object({createdAt:e.property("created_at",e.date()),id:e.string(),payload:e.string().optional(),requestType:e.property("request_type",sr),responseCode:e.property("response_code",e.number().optional()),sentAt:e.property("sent_at",e.date().optional()),status:Kd,updatedAt:e.property("updated_at",e.date()),webhook:Fe.optional(),webhookId:e.property("webhook_id",e.string())});var Gd=e.object({data:po,params:e.record(e.string(),e.unknown())});var Ld=e.object({data:Fe,params:e.record(e.string(),e.unknown())});var Wd=e.object({ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional(),webhookId:e.property("webhook_id",e.string().optional())});var Nd=e.object({data:e.list(po),params:Wd});var Hd=e.object({limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var $d=e.object({data:e.list(Fe),params:Hd});var Zd=e.object({data:Fe,params:e.record(e.string(),e.unknown())});var t=e.object({error:e.string()});var Jd=e.object({addOnId:e.property("add_on_id",e.string()),priceId:e.property("price_id",e.string())});var uo=e.object({bundleId:e.property("bundle_id",e.string()),quantity:e.number()});var mo=e.object({priceId:e.property("price_id",e.string()),quantity:e.number()});var Wt=e.object({addOnIds:e.property("add_on_ids",e.list(Jd)),companyId:e.property("company_id",e.string()),couponExternalId:e.property("coupon_external_id",e.string().optional()),creditBundles:e.property("credit_bundles",e.list(uo)),newPlanId:e.property("new_plan_id",e.string()),newPriceId:e.property("new_price_id",e.string()),payInAdvance:e.property("pay_in_advance",e.list(mo)),paymentMethodId:e.property("payment_method_id",e.string().optional()),promoCode:e.property("promo_code",e.string().optional()),skipTrial:e.property("skip_trial",e.boolean())});var Nt=e.object({defaultValue:e.property("default_value",e.boolean()),description:e.string(),featureId:e.property("feature_id",e.string().optional()),flagType:e.property("flag_type",ir),key:e.string(),maintainerId:e.property("maintainer_id",e.string().optional()),name:e.string()});var Ht=e.object({keys:e.record(e.string(),e.string())});var Qd=e.object({planId:e.property("plan_id",e.string()),priceId:e.property("price_id",e.string().optional())});var $t=e.object({addOnSelections:e.property("add_on_selections",e.list(Qd)),basePlanId:e.property("base_plan_id",e.string().optional()),basePlanPriceId:e.property("base_plan_price_id",e.string().optional()),cancelImmediately:e.property("cancel_immediately",e.boolean().optional()),companyId:e.property("company_id",e.string()),couponExternalId:e.property("coupon_external_id",e.string().optional()),creditBundles:e.property("credit_bundles",e.list(uo)),payInAdvanceEntitlements:e.property("pay_in_advance_entitlements",e.list(mo)),paymentMethodExternalId:e.property("payment_method_external_id",e.string().optional()),promoCode:e.property("promo_code",e.string().optional()),prorate:e.boolean().optional(),trialEnd:e.property("trial_end",e.date().optional())});var Zt=e.object({id:e.string().optional(),keys:e.record(e.string(),e.string()),lastSeenAt:e.property("last_seen_at",e.date().optional()),name:e.string().optional(),traits:e.record(e.string(),e.unknown()).optional(),updateOnly:e.property("update_only",e.boolean().optional())});var Jt=e.object({incr:e.number().optional(),keys:e.record(e.string(),e.string()),set:e.string().optional(),trait:e.string(),updateOnly:e.property("update_only",e.boolean().optional())});var Qt=e.object({companies:e.list(e.record(e.string(),e.string())).optional(),company:e.record(e.string(),e.string()).optional(),companyId:e.property("company_id",e.string().optional()),companyIds:e.property("company_ids",e.list(e.string()).optional()),id:e.string().optional(),keys:e.record(e.string(),e.string()),lastSeenAt:e.property("last_seen_at",e.date().optional()),name:e.string().optional(),traits:e.record(e.string(),e.unknown()).optional(),updateOnly:e.property("update_only",e.boolean().optional())});var ho=class{constructor(o){this._options=K(o)}issueTemporaryAccessToken(o,i){return R.fromPromise(this.__issueTemporaryAccessToken(o,i))}async __issueTemporaryAccessToken(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"temporary-access-tokens"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:{...$o.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),resource_type:"company"},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Rs.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/temporary-access-tokens")}};var go=class{constructor(o){this._options=K(o)}listApiKeys(o,i){return R.fromPromise(this.__listApiKeys(o,i))}async __listApiKeys(o,i){let{environmentId:a,requireEnvironment:n,limit:r,offset:s}=o,u={};a!=null&&(u.environment_id=a),u.require_environment=n.toString(),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"api-keys"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:Vs.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/api-keys")}createApiKey(o,i){return R.fromPromise(this.__createApiKey(o,i))}async __createApiKey(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"api-keys"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Zo.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Es.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/api-keys")}getApiKey(o,i){return R.fromPromise(this.__getApiKey(o,i))}async __getApiKey(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`api-keys/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Os.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/api-keys/{api_key_id}")}updateApiKey(o,i={},a){return R.fromPromise(this.__updateApiKey(o,i,a))}async __updateApiKey(o,i={},a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`api-keys/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:Qo.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:Gs.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/api-keys/{api_key_id}")}deleteApiKey(o,i){return R.fromPromise(this.__deleteApiKey(o,i))}async __deleteApiKey(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`api-keys/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Ts.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/api-keys/{api_key_id}")}countApiKeys(o,i){return R.fromPromise(this.__countApiKeys(o,i))}async __countApiKeys(o,i){let{environmentId:a,requireEnvironment:n,limit:r,offset:s}=o,u={};a!=null&&(u.environment_id=a),u.require_environment=n.toString(),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"api-keys/count"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:_s.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/api-keys/count")}listApiRequests(o={},i){return R.fromPromise(this.__listApiRequests(o,i))}async __listApiRequests(o={},i){let{q:a,requestType:n,environmentId:r,limit:s,offset:u}=o,g={};a!=null&&(g.q=a),n!=null&&(g.request_type=n),r!=null&&(g.environment_id=r),s!=null&&(g.limit=s.toString()),u!=null&&(g.offset=u.toString());let d=await this._options.authProvider.getAuthRequest(),l=f(d.headers,this._options?.headers,i?.headers),m=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"api-requests"),method:"GET",headers:l,queryParameters:{...g,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(m.ok)return{data:Ds.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new v(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 401:throw new C(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 403:throw new P(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 404:throw new E(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 500:throw new x(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new z({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return U(m.error,m.rawResponse,"GET","/api-requests")}getApiRequest(o,i){return R.fromPromise(this.__getApiRequest(o,i))}async __getApiRequest(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`api-requests/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:ks.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/api-requests/{api_request_id}")}countApiRequests(o={},i){return R.fromPromise(this.__countApiRequests(o,i))}async __countApiRequests(o={},i){let{q:a,requestType:n,environmentId:r,limit:s,offset:u}=o,g={};a!=null&&(g.q=a),n!=null&&(g.request_type=n),r!=null&&(g.environment_id=r),s!=null&&(g.limit=s.toString()),u!=null&&(g.offset=u.toString());let d=await this._options.authProvider.getAuthRequest(),l=f(d.headers,this._options?.headers,i?.headers),m=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"api-requests/count"),method:"GET",headers:l,queryParameters:{...g,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(m.ok)return{data:Ps.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new v(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 401:throw new C(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 403:throw new P(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 404:throw new E(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 500:throw new x(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new z({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return U(m.error,m.rawResponse,"GET","/api-requests/count")}listEnvironments(o={},i){return R.fromPromise(this.__listEnvironments(o,i))}async __listEnvironments(o={},i){let{ids:a,limit:n,offset:r}=o,s={};a!=null&&(Array.isArray(a)?s.ids=a.map(l=>l):s.ids=a),n!=null&&(s.limit=n.toString()),r!=null&&(s.offset=r.toString());let u=await this._options.authProvider.getAuthRequest(),g=f(u.headers,this._options?.headers,i?.headers),d=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"environments"),method:"GET",headers:g,queryParameters:{...s,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(d.ok)return{data:Fs.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:d.rawResponse};if(d.error.reason==="status-code")switch(d.error.statusCode){case 400:throw new v(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 401:throw new C(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 403:throw new P(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 404:throw new E(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 500:throw new x(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);default:throw new z({statusCode:d.error.statusCode,body:d.error.body,rawResponse:d.rawResponse})}return U(d.error,d.rawResponse,"GET","/environments")}createEnvironment(o,i){return R.fromPromise(this.__createEnvironment(o,i))}async __createEnvironment(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"environments"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Jo.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Us.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/environments")}getEnvironment(o,i){return R.fromPromise(this.__getEnvironment(o,i))}async __getEnvironment(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`environments/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Bs.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/environments/{environment_id}")}updateEnvironment(o,i={},a){return R.fromPromise(this.__updateEnvironment(o,i,a))}async __updateEnvironment(o,i={},a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`environments/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:Yo.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:Ls.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/environments/{environment_id}")}deleteEnvironment(o,i){return R.fromPromise(this.__deleteEnvironment(o,i))}async __deleteEnvironment(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`environments/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:vs.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/environments/{environment_id}")}quickstart(o){return R.fromPromise(this.__quickstart(o))}async __quickstart(o){let i=await this._options.authProvider.getAuthRequest(),a=f(i.headers,this._options?.headers,o?.headers),n=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"quickstart"),method:"POST",headers:a,queryParameters:o?.queryParams,timeoutMs:(o?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:o?.maxRetries??this._options?.maxRetries,abortSignal:o?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(n.ok)return{data:Ks.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.statusCode){case 400:throw new v(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);case 401:throw new C(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);case 403:throw new P(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);case 404:throw new E(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);case 500:throw new x(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);default:throw new z({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse})}return U(n.error,n.rawResponse,"POST","/quickstart")}};var yo=class{constructor(o){this._options=K(o)}listCoupons(o={},i){return R.fromPromise(this.__listCoupons(o,i))}async __listCoupons(o={},i){let{isActive:a,q:n,limit:r,offset:s}=o,u={};a!=null&&(u.is_active=a.toString()),n!=null&&(u.q=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/coupons"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:cn.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/billing/coupons")}upsertBillingCoupon(o,i){return R.fromPromise(this.__upsertBillingCoupon(o,i))}async __upsertBillingCoupon(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/coupons"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:ot.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:zn.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/billing/coupons")}upsertBillingCustomer(o,i){return R.fromPromise(this.__upsertBillingCustomer(o,i))}async __upsertBillingCustomer(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/customer/upsert"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Xo.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:fn.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/billing/customer/upsert")}listCustomersWithSubscriptions(o={},i){return R.fromPromise(this.__listCustomersWithSubscriptions(o,i))}async __listCustomersWithSubscriptions(o={},i){let{companyIds:a,name:n,providerType:r,q:s,limit:u,offset:g}=o,d={};a!=null&&(Array.isArray(a)?d.company_ids=a.map(j=>j):d.company_ids=a),n!=null&&(d.name=n),r!=null&&(d.provider_type=B.jsonOrThrow(r,{unrecognizedObjectKeys:"strip"})),s!=null&&(d.q=s),u!=null&&(d.limit=u.toString()),g!=null&&(d.offset=g.toString());let l=await this._options.authProvider.getAuthRequest(),m=f(l.headers,this._options?.headers,i?.headers),y=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/customers"),method:"GET",headers:m,queryParameters:{...d,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(y.ok)return{data:dn.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 400:throw new v(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 401:throw new C(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 403:throw new P(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 404:throw new E(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 500:throw new x(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);default:throw new z({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return U(y.error,y.rawResponse,"GET","/billing/customers")}countCustomers(o={},i){return R.fromPromise(this.__countCustomers(o,i))}async __countCustomers(o={},i){let{companyIds:a,name:n,providerType:r,q:s,limit:u,offset:g}=o,d={};a!=null&&(Array.isArray(a)?d.company_ids=a.map(j=>j):d.company_ids=a),n!=null&&(d.name=n),r!=null&&(d.provider_type=B.jsonOrThrow(r,{unrecognizedObjectKeys:"strip"})),s!=null&&(d.q=s),u!=null&&(d.limit=u.toString()),g!=null&&(d.offset=g.toString());let l=await this._options.authProvider.getAuthRequest(),m=f(l.headers,this._options?.headers,i?.headers),y=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/customers/count"),method:"GET",headers:m,queryParameters:{...d,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(y.ok)return{data:Qs.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 400:throw new v(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 401:throw new C(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 403:throw new P(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 404:throw new E(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 500:throw new x(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);default:throw new z({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return U(y.error,y.rawResponse,"GET","/billing/customers/count")}listInvoices(o,i){return R.fromPromise(this.__listInvoices(o,i))}async __listInvoices(o,i){let{companyId:a,customerExternalId:n,subscriptionExternalId:r,limit:s,offset:u}=o,g={};a!=null&&(g.company_id=a),g.customer_external_id=n,g.subscription_external_id=r,s!=null&&(g.limit=s.toString()),u!=null&&(g.offset=u.toString());let d=await this._options.authProvider.getAuthRequest(),l=f(d.headers,this._options?.headers,i?.headers),m=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/invoices"),method:"GET",headers:l,queryParameters:{...g,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(m.ok)return{data:hn.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new v(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 401:throw new C(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 403:throw new P(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 404:throw new E(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 500:throw new x(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new z({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return U(m.error,m.rawResponse,"GET","/billing/invoices")}upsertInvoice(o,i){return R.fromPromise(this.__upsertInvoice(o,i))}async __upsertInvoice(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/invoices"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:tt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Cn.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/billing/invoices")}listMeters(o={},i){return R.fromPromise(this.__listMeters(o,i))}async __listMeters(o={},i){let{displayName:a,limit:n,offset:r}=o,s={};a!=null&&(s.display_name=a),n!=null&&(s.limit=n.toString()),r!=null&&(s.offset=r.toString());let u=await this._options.authProvider.getAuthRequest(),g=f(u.headers,this._options?.headers,i?.headers),d=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/meter"),method:"GET",headers:g,queryParameters:{...s,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(d.ok)return{data:yn.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:d.rawResponse};if(d.error.reason==="status-code")switch(d.error.statusCode){case 400:throw new v(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 401:throw new C(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 403:throw new P(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 404:throw new E(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 500:throw new x(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);default:throw new z({statusCode:d.error.statusCode,body:d.error.body,rawResponse:d.rawResponse})}return U(d.error,d.rawResponse,"GET","/billing/meter")}upsertBillingMeter(o,i){return R.fromPromise(this.__upsertBillingMeter(o,i))}async __upsertBillingMeter(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/meter/upsert"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:at.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:_n.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/billing/meter/upsert")}listPaymentMethods(o,i){return R.fromPromise(this.__listPaymentMethods(o,i))}async __listPaymentMethods(o,i){let{companyId:a,customerExternalId:n,limit:r,offset:s}=o,u={};a!=null&&(u.company_id=a),u.customer_external_id=n,r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/payment-methods"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:bn.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/billing/payment-methods")}upsertPaymentMethod(o,i){return R.fromPromise(this.__upsertPaymentMethod(o,i))}async __upsertPaymentMethod(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/payment-methods"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:st.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Un.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/billing/payment-methods")}listBillingPrices(o={},i){return R.fromPromise(this.__listBillingPrices(o,i))}async __listBillingPrices(o={},i){let{forInitialPlan:a,forTrialExpiryPlan:n,ids:r,interval:s,isActive:u,price:g,productId:d,productIds:l,providerType:m,q:y,tiersMode:j,usageType:b,withMeter:T,limit:V,offset:H}=o,O={};a!=null&&(O.for_initial_plan=a.toString()),n!=null&&(O.for_trial_expiry_plan=n.toString()),r!=null&&(Array.isArray(r)?O.ids=r.map(M=>M):O.ids=r),s!=null&&(O.interval=s),u!=null&&(O.is_active=u.toString()),g!=null&&(O.price=g.toString()),d!=null&&(O.product_id=d),l!=null&&(Array.isArray(l)?O.product_ids=l.map(M=>M):O.product_ids=l),m!=null&&(O.provider_type=B.jsonOrThrow(m,{unrecognizedObjectKeys:"strip"})),y!=null&&(O.q=y),j!=null&&(O.tiers_mode=ie.jsonOrThrow(j,{unrecognizedObjectKeys:"strip"})),b!=null&&(O.usage_type=Z.jsonOrThrow(b,{unrecognizedObjectKeys:"strip"})),T!=null&&(O.with_meter=T.toString()),V!=null&&(O.limit=V.toString()),H!=null&&(O.offset=H.toString());let pe=await this._options.authProvider.getAuthRequest(),nr=f(pe.headers,this._options?.headers,i?.headers),k=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/price"),method:"GET",headers:nr,queryParameters:{...O,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(k.ok)return{data:rn.parseOrThrow(k.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:k.rawResponse};if(k.error.reason==="status-code")switch(k.error.statusCode){case 400:throw new v(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 401:throw new C(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 403:throw new P(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 404:throw new E(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 500:throw new x(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);default:throw new z({statusCode:k.error.statusCode,body:k.error.body,rawResponse:k.rawResponse})}return U(k.error,k.rawResponse,"GET","/billing/price")}upsertBillingPrice(o,i){return R.fromPromise(this.__upsertBillingPrice(o,i))}async __upsertBillingPrice(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/price/upsert"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:et.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Sn.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/billing/price/upsert")}deleteBillingProduct(o,i){return R.fromPromise(this.__deleteBillingProduct(o,i))}async __deleteBillingProduct(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`billing/product/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Ys.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/billing/product/{billing_id}")}listBillingProductPrices(o={},i){return R.fromPromise(this.__listBillingProductPrices(o,i))}async __listBillingProductPrices(o={},i){let{forInitialPlan:a,forTrialExpiryPlan:n,ids:r,interval:s,isActive:u,price:g,productId:d,productIds:l,providerType:m,q:y,tiersMode:j,usageType:b,withMeter:T,limit:V,offset:H}=o,O={};a!=null&&(O.for_initial_plan=a.toString()),n!=null&&(O.for_trial_expiry_plan=n.toString()),r!=null&&(Array.isArray(r)?O.ids=r.map(M=>M):O.ids=r),s!=null&&(O.interval=s),u!=null&&(O.is_active=u.toString()),g!=null&&(O.price=g.toString()),d!=null&&(O.product_id=d),l!=null&&(Array.isArray(l)?O.product_ids=l.map(M=>M):O.product_ids=l),m!=null&&(O.provider_type=B.jsonOrThrow(m,{unrecognizedObjectKeys:"strip"})),y!=null&&(O.q=y),j!=null&&(O.tiers_mode=ie.jsonOrThrow(j,{unrecognizedObjectKeys:"strip"})),b!=null&&(O.usage_type=Z.jsonOrThrow(b,{unrecognizedObjectKeys:"strip"})),T!=null&&(O.with_meter=T.toString()),V!=null&&(O.limit=V.toString()),H!=null&&(O.offset=H.toString());let pe=await this._options.authProvider.getAuthRequest(),nr=f(pe.headers,this._options?.headers,i?.headers),k=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/product/prices"),method:"GET",headers:nr,queryParameters:{...O,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(k.ok)return{data:tn.parseOrThrow(k.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:k.rawResponse};if(k.error.reason==="status-code")switch(k.error.statusCode){case 400:throw new v(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 401:throw new C(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 403:throw new P(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 404:throw new E(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 500:throw new x(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);default:throw new z({statusCode:k.error.statusCode,body:k.error.body,rawResponse:k.rawResponse})}return U(k.error,k.rawResponse,"GET","/billing/product/prices")}deleteProductPrice(o,i){return R.fromPromise(this.__deleteProductPrice(o,i))}async __deleteProductPrice(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`billing/product/prices/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Xs.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/billing/product/prices/{billing_id}")}upsertBillingProduct(o,i){return R.fromPromise(this.__upsertBillingProduct(o,i))}async __upsertBillingProduct(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/product/upsert"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:rt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Pn.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/billing/product/upsert")}listBillingProducts(o={},i){return R.fromPromise(this.__listBillingProducts(o,i))}async __listBillingProducts(o={},i){let{ids:a,isActive:n,name:r,priceUsageType:s,providerType:u,q:g,withOneTimeCharges:d,withPricesOnly:l,withZeroPrice:m,withoutLinkedToPlan:y,limit:j,offset:b}=o,T={};a!=null&&(Array.isArray(a)?T.ids=a.map(pe=>pe):T.ids=a),n!=null&&(T.is_active=n.toString()),r!=null&&(T.name=r),s!=null&&(T.price_usage_type=Z.jsonOrThrow(s,{unrecognizedObjectKeys:"strip"})),u!=null&&(T.provider_type=B.jsonOrThrow(u,{unrecognizedObjectKeys:"strip"})),g!=null&&(T.q=g),d!=null&&(T.with_one_time_charges=d.toString()),l!=null&&(T.with_prices_only=l.toString()),m!=null&&(T.with_zero_price=m.toString()),y!=null&&(T.without_linked_to_plan=y.toString()),j!=null&&(T.limit=j.toString()),b!=null&&(T.offset=b.toString());let V=await this._options.authProvider.getAuthRequest(),H=f(V.headers,this._options?.headers,i?.headers),O=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/products"),method:"GET",headers:H,queryParameters:{...T,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(O.ok)return{data:sn.parseOrThrow(O.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:O.rawResponse};if(O.error.reason==="status-code")switch(O.error.statusCode){case 400:throw new v(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 401:throw new C(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 403:throw new P(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 404:throw new E(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 500:throw new x(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);default:throw new z({statusCode:O.error.statusCode,body:O.error.body,rawResponse:O.rawResponse})}return U(O.error,O.rawResponse,"GET","/billing/products")}countBillingProducts(o={},i){return R.fromPromise(this.__countBillingProducts(o,i))}async __countBillingProducts(o={},i){let{ids:a,isActive:n,name:r,priceUsageType:s,providerType:u,q:g,withOneTimeCharges:d,withPricesOnly:l,withZeroPrice:m,withoutLinkedToPlan:y,limit:j,offset:b}=o,T={};a!=null&&(Array.isArray(a)?T.ids=a.map(pe=>pe):T.ids=a),n!=null&&(T.is_active=n.toString()),r!=null&&(T.name=r),s!=null&&(T.price_usage_type=Z.jsonOrThrow(s,{unrecognizedObjectKeys:"strip"})),u!=null&&(T.provider_type=B.jsonOrThrow(u,{unrecognizedObjectKeys:"strip"})),g!=null&&(T.q=g),d!=null&&(T.with_one_time_charges=d.toString()),l!=null&&(T.with_prices_only=l.toString()),m!=null&&(T.with_zero_price=m.toString()),y!=null&&(T.without_linked_to_plan=y.toString()),j!=null&&(T.limit=j.toString()),b!=null&&(T.offset=b.toString());let V=await this._options.authProvider.getAuthRequest(),H=f(V.headers,this._options?.headers,i?.headers),O=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/products/count"),method:"GET",headers:H,queryParameters:{...T,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(O.ok)return{data:Zs.parseOrThrow(O.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:O.rawResponse};if(O.error.reason==="status-code")switch(O.error.statusCode){case 400:throw new v(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 401:throw new C(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 403:throw new P(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 404:throw new E(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 500:throw new x(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);default:throw new z({statusCode:O.error.statusCode,body:O.error.body,rawResponse:O.rawResponse})}return U(O.error,O.rawResponse,"GET","/billing/products/count")}upsertBillingSubscription(o,i){return R.fromPromise(this.__upsertBillingSubscription(o,i))}async __upsertBillingSubscription(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/subscription/upsert"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:it.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:En.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/billing/subscription/upsert")}};var wo=class{constructor(o){this._options=K(o)}internal(o,i){return R.fromPromise(this.__internal(o,i))}async __internal(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"checkout-internal"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Wt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Dn.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/checkout-internal")}getCheckoutData(o,i){return R.fromPromise(this.__getCheckoutData(o,i))}async __getCheckoutData(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"checkout-internal/data"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:ct.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Wn.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/checkout-internal/data")}previewCheckoutInternal(o,i){return R.fromPromise(this.__previewCheckoutInternal(o,i))}async __previewCheckoutInternal(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"checkout-internal/preview"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Wt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Zn.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/checkout-internal/preview")}managePlan(o,i){return R.fromPromise(this.__managePlan(o,i))}async __managePlan(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"manage-plan"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:$t.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Nn.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/manage-plan")}previewManagePlan(o,i){return R.fromPromise(this.__previewManagePlan(o,i))}async __previewManagePlan(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"manage-plan/preview"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:$t.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Qn.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/manage-plan/preview")}cancelSubscription(o,i){return R.fromPromise(this.__cancelSubscription(o,i))}async __cancelSubscription(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"manage-plan/subscription/cancel"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:nt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Vn.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/manage-plan/subscription/cancel")}updateCustomerSubscriptionTrialEnd(o,i={},a){return R.fromPromise(this.__updateCustomerSubscriptionTrialEnd(o,i,a))}async __updateCustomerSubscriptionTrialEnd(o,i={},a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`subscription/${w.encodePathParam(o)}/edit-trial-end`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:lt.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:Yn.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/subscription/{subscription_id}/edit-trial-end")}};var bo=class{constructor(o){this._options=K(o)}listCompanies(o={},i){return R.fromPromise(this.__listCompanies(o,i))}async __listCompanies(o={},i){let{ids:a,planId:n,q:r,withoutFeatureOverrideFor:s,withoutPlan:u,withSubscription:g,limit:d,offset:l}=o,m={};a!=null&&(Array.isArray(a)?m.ids=a.map(T=>T):m.ids=a),n!=null&&(m.plan_id=n),r!=null&&(m.q=r),s!=null&&(m.without_feature_override_for=s),u!=null&&(m.without_plan=u.toString()),g!=null&&(m.with_subscription=g.toString()),d!=null&&(m.limit=d.toString()),l!=null&&(m.offset=l.toString());let y=await this._options.authProvider.getAuthRequest(),j=f(y.headers,this._options?.headers,i?.headers),b=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"companies"),method:"GET",headers:j,queryParameters:{...m,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(b.ok)return{data:Lc.parseOrThrow(b.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:b.rawResponse};if(b.error.reason==="status-code")switch(b.error.statusCode){case 400:throw new v(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 401:throw new C(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 403:throw new P(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 404:throw new E(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 500:throw new x(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);default:throw new z({statusCode:b.error.statusCode,body:b.error.body,rawResponse:b.rawResponse})}return U(b.error,b.rawResponse,"GET","/companies")}upsertCompany(o,i){return R.fromPromise(this.__upsertCompany(o,i))}async __upsertCompany(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"companies"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Zt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:pl.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/companies")}getCompany(o,i){return R.fromPromise(this.__getCompany(o,i))}async __getCompany(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`companies/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Sc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/companies/{company_id}")}deleteCompany(o,i={},a){return R.fromPromise(this.__deleteCompany(o,i,a))}async __deleteCompany(o,i={},a){let{cancelSubscription:n,prorate:r}=i,s={};n!=null&&(s.cancel_subscription=n.toString()),r!=null&&(s.prorate=r.toString());let u=await this._options.authProvider.getAuthRequest(),g=f(u.headers,this._options?.headers,a?.headers),d=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`companies/${w.encodePathParam(o)}`),method:"DELETE",headers:g,queryParameters:{...s,...a?.queryParams},timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(d.ok)return{data:wc.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:d.rawResponse};if(d.error.reason==="status-code")switch(d.error.statusCode){case 400:throw new v(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 401:throw new C(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 403:throw new P(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 404:throw new E(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 500:throw new x(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);default:throw new z({statusCode:d.error.statusCode,body:d.error.body,rawResponse:d.rawResponse})}return U(d.error,d.rawResponse,"DELETE","/companies/{company_id}")}countCompanies(o={},i){return R.fromPromise(this.__countCompanies(o,i))}async __countCompanies(o={},i){let{ids:a,planId:n,q:r,withoutFeatureOverrideFor:s,withoutPlan:u,withSubscription:g,limit:d,offset:l}=o,m={};a!=null&&(Array.isArray(a)?m.ids=a.map(T=>T):m.ids=a),n!=null&&(m.plan_id=n),r!=null&&(m.q=r),s!=null&&(m.without_feature_override_for=s),u!=null&&(m.without_plan=u.toString()),g!=null&&(m.with_subscription=g.toString()),d!=null&&(m.limit=d.toString()),l!=null&&(m.offset=l.toString());let y=await this._options.authProvider.getAuthRequest(),j=f(y.headers,this._options?.headers,i?.headers),b=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"companies/count"),method:"GET",headers:j,queryParameters:{...m,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(b.ok)return{data:ic.parseOrThrow(b.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:b.rawResponse};if(b.error.reason==="status-code")switch(b.error.statusCode){case 400:throw new v(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 401:throw new C(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 403:throw new P(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 404:throw new E(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 500:throw new x(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);default:throw new z({statusCode:b.error.statusCode,body:b.error.body,rawResponse:b.rawResponse})}return U(b.error,b.rawResponse,"GET","/companies/count")}countCompaniesForAdvancedFilter(o={},i){return R.fromPromise(this.__countCompaniesForAdvancedFilter(o,i))}async __countCompaniesForAdvancedFilter(o={},i){let{ids:a,planIds:n,featureIds:r,creditTypeIds:s,subscriptionStatuses:u,subscriptionTypes:g,monetizedSubscriptions:d,q:l,withoutPlan:m,withoutSubscription:y,sortOrderColumn:j,sortOrderDirection:b,displayProperties:T,limit:V,offset:H}=o,O={};a!=null&&(Array.isArray(a)?O.ids=a.map(M=>M):O.ids=a),n!=null&&(Array.isArray(n)?O.plan_ids=n.map(M=>M):O.plan_ids=n),r!=null&&(Array.isArray(r)?O.feature_ids=r.map(M=>M):O.feature_ids=r),s!=null&&(Array.isArray(s)?O.credit_type_ids=s.map(M=>M):O.credit_type_ids=s),u!=null&&(Array.isArray(u)?O.subscription_statuses=u.map(M=>Le.jsonOrThrow(M,{unrecognizedObjectKeys:"strip"})):O.subscription_statuses=Le.jsonOrThrow(u,{unrecognizedObjectKeys:"strip"})),g!=null&&(Array.isArray(g)?O.subscription_types=g.map(M=>We.jsonOrThrow(M,{unrecognizedObjectKeys:"strip"})):O.subscription_types=We.jsonOrThrow(g,{unrecognizedObjectKeys:"strip"})),d!=null&&(O.monetized_subscriptions=d.toString()),l!=null&&(O.q=l),m!=null&&(O.without_plan=m.toString()),y!=null&&(O.without_subscription=y.toString()),j!=null&&(O.sort_order_column=j),b!=null&&(O.sort_order_direction=we.jsonOrThrow(b,{unrecognizedObjectKeys:"strip"})),T!=null&&(Array.isArray(T)?O.display_properties=T.map(M=>M):O.display_properties=T),V!=null&&(O.limit=V.toString()),H!=null&&(O.offset=H.toString());let pe=await this._options.authProvider.getAuthRequest(),nr=f(pe.headers,this._options?.headers,i?.headers),k=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"companies/count2"),method:"GET",headers:nr,queryParameters:{...O,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(k.ok)return{data:ec.parseOrThrow(k.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:k.rawResponse};if(k.error.reason==="status-code")switch(k.error.statusCode){case 400:throw new v(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 401:throw new C(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 403:throw new P(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 404:throw new E(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 500:throw new x(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);default:throw new z({statusCode:k.error.statusCode,body:k.error.body,rawResponse:k.rawResponse})}return U(k.error,k.rawResponse,"GET","/companies/count2")}createCompany(o,i){return R.fromPromise(this.__createCompany(o,i))}async __createCompany(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"companies/create"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Zt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:uc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/companies/create")}deleteCompanyByKeys(o,i){return R.fromPromise(this.__deleteCompanyByKeys(o,i))}async __deleteCompanyByKeys(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"companies/delete"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Ht.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:hc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/companies/delete")}listCompaniesForAdvancedFilter(o={},i){return R.fromPromise(this.__listCompaniesForAdvancedFilter(o,i))}async __listCompaniesForAdvancedFilter(o={},i){let{ids:a,planIds:n,featureIds:r,creditTypeIds:s,subscriptionStatuses:u,subscriptionTypes:g,monetizedSubscriptions:d,q:l,withoutPlan:m,withoutSubscription:y,sortOrderColumn:j,sortOrderDirection:b,displayProperties:T,limit:V,offset:H}=o,O={};a!=null&&(Array.isArray(a)?O.ids=a.map(M=>M):O.ids=a),n!=null&&(Array.isArray(n)?O.plan_ids=n.map(M=>M):O.plan_ids=n),r!=null&&(Array.isArray(r)?O.feature_ids=r.map(M=>M):O.feature_ids=r),s!=null&&(Array.isArray(s)?O.credit_type_ids=s.map(M=>M):O.credit_type_ids=s),u!=null&&(Array.isArray(u)?O.subscription_statuses=u.map(M=>Le.jsonOrThrow(M,{unrecognizedObjectKeys:"strip"})):O.subscription_statuses=Le.jsonOrThrow(u,{unrecognizedObjectKeys:"strip"})),g!=null&&(Array.isArray(g)?O.subscription_types=g.map(M=>We.jsonOrThrow(M,{unrecognizedObjectKeys:"strip"})):O.subscription_types=We.jsonOrThrow(g,{unrecognizedObjectKeys:"strip"})),d!=null&&(O.monetized_subscriptions=d.toString()),l!=null&&(O.q=l),m!=null&&(O.without_plan=m.toString()),y!=null&&(O.without_subscription=y.toString()),j!=null&&(O.sort_order_column=j),b!=null&&(O.sort_order_direction=we.jsonOrThrow(b,{unrecognizedObjectKeys:"strip"})),T!=null&&(Array.isArray(T)?O.display_properties=T.map(M=>M):O.display_properties=T),V!=null&&(O.limit=V.toString()),H!=null&&(O.offset=H.toString());let pe=await this._options.authProvider.getAuthRequest(),nr=f(pe.headers,this._options?.headers,i?.headers),k=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"companies/list2"),method:"GET",headers:nr,queryParameters:{...O,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(k.ok)return{data:Kc.parseOrThrow(k.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:k.rawResponse};if(k.error.reason==="status-code")switch(k.error.statusCode){case 400:throw new v(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 401:throw new C(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 403:throw new P(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 404:throw new E(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 500:throw new x(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);default:throw new z({statusCode:k.error.statusCode,body:k.error.body,rawResponse:k.rawResponse})}return U(k.error,k.rawResponse,"GET","/companies/list2")}lookupCompany(o,i){return R.fromPromise(this.__lookupCompany(o,i))}async __lookupCompany(o,i){let{keys:a}=o,n={};n.keys=me(a);let r=await this._options.authProvider.getAuthRequest(),s=f(r.headers,this._options?.headers,i?.headers),u=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"companies/lookup"),method:"GET",headers:s,queryParameters:{...n,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(u.ok)return{data:tl.parseOrThrow(u.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")switch(u.error.statusCode){case 401:throw new C(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 403:throw new P(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 404:throw new E(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 500:throw new x(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);default:throw new z({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse})}return U(u.error,u.rawResponse,"GET","/companies/lookup")}listCompanyMemberships(o={},i){return R.fromPromise(this.__listCompanyMemberships(o,i))}async __listCompanyMemberships(o={},i){let{companyId:a,userId:n,limit:r,offset:s}=o,u={};a!=null&&(u.company_id=a),n!=null&&(u.user_id=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"company-memberships"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:Nc.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/company-memberships")}getOrCreateCompanyMembership(o,i){return R.fromPromise(this.__getOrCreateCompanyMembership(o,i))}async __getOrCreateCompanyMembership(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"company-memberships"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:mt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Uc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/company-memberships")}deleteCompanyMembership(o,i){return R.fromPromise(this.__deleteCompanyMembership(o,i))}async __deleteCompanyMembership(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`company-memberships/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:gc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/company-memberships/{company_membership_id}")}getActiveCompanySubscription(o={},i){return R.fromPromise(this.__getActiveCompanySubscription(o,i))}async __getActiveCompanySubscription(o={},i){let{companyId:a,companyIds:n,limit:r,offset:s}=o,u={};a!=null&&(u.company_id=a),n!=null&&(Array.isArray(n)?u.company_ids=n.map(m=>m):u.company_ids=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"company-subscriptions"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:_c.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/company-subscriptions")}upsertCompanyTrait(o,i){return R.fromPromise(this.__upsertCompanyTrait(o,i))}async __upsertCompanyTrait(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"company-traits"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Jt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:ul.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/company-traits")}listEntityKeyDefinitions(o={},i){return R.fromPromise(this.__listEntityKeyDefinitions(o,i))}async __listEntityKeyDefinitions(o={},i){let{entityType:a,ids:n,q:r,limit:s,offset:u}=o,g={};a!=null&&(g.entity_type=W.jsonOrThrow(a,{unrecognizedObjectKeys:"strip"})),n!=null&&(Array.isArray(n)?g.ids=n.map(y=>y):g.ids=n),r!=null&&(g.q=r),s!=null&&(g.limit=s.toString()),u!=null&&(g.offset=u.toString());let d=await this._options.authProvider.getAuthRequest(),l=f(d.headers,this._options?.headers,i?.headers),m=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"entity-key-definitions"),method:"GET",headers:l,queryParameters:{...g,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(m.ok)return{data:$c.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new v(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 401:throw new C(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 403:throw new P(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 404:throw new E(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 500:throw new x(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new z({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return U(m.error,m.rawResponse,"GET","/entity-key-definitions")}countEntityKeyDefinitions(o={},i){return R.fromPromise(this.__countEntityKeyDefinitions(o,i))}async __countEntityKeyDefinitions(o={},i){let{entityType:a,ids:n,q:r,limit:s,offset:u}=o,g={};a!=null&&(g.entity_type=W.jsonOrThrow(a,{unrecognizedObjectKeys:"strip"})),n!=null&&(Array.isArray(n)?g.ids=n.map(y=>y):g.ids=n),r!=null&&(g.q=r),s!=null&&(g.limit=s.toString()),u!=null&&(g.offset=u.toString());let d=await this._options.authProvider.getAuthRequest(),l=f(d.headers,this._options?.headers,i?.headers),m=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"entity-key-definitions/count"),method:"GET",headers:l,queryParameters:{...g,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(m.ok)return{data:tc.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new v(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 401:throw new C(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 403:throw new P(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 404:throw new E(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 500:throw new x(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new z({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return U(m.error,m.rawResponse,"GET","/entity-key-definitions/count")}listEntityTraitDefinitions(o={},i){return R.fromPromise(this.__listEntityTraitDefinitions(o,i))}async __listEntityTraitDefinitions(o={},i){let{entityType:a,ids:n,q:r,traitType:s,traitTypes:u,limit:g,offset:d}=o,l={};a!=null&&(l.entity_type=W.jsonOrThrow(a,{unrecognizedObjectKeys:"strip"})),n!=null&&(Array.isArray(n)?l.ids=n.map(b=>b):l.ids=n),r!=null&&(l.q=r),s!=null&&(l.trait_type=X.jsonOrThrow(s,{unrecognizedObjectKeys:"strip"})),u!=null&&(Array.isArray(u)?l.trait_types=u.map(b=>X.jsonOrThrow(b,{unrecognizedObjectKeys:"strip"})):l.trait_types=X.jsonOrThrow(u,{unrecognizedObjectKeys:"strip"})),g!=null&&(l.limit=g.toString()),d!=null&&(l.offset=d.toString());let m=await this._options.authProvider.getAuthRequest(),y=f(m.headers,this._options?.headers,i?.headers),j=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"entity-trait-definitions"),method:"GET",headers:y,queryParameters:{...l,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(j.ok)return{data:Jc.parseOrThrow(j.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:j.rawResponse};if(j.error.reason==="status-code")switch(j.error.statusCode){case 400:throw new v(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 401:throw new C(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 403:throw new P(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 404:throw new E(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 500:throw new x(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);default:throw new z({statusCode:j.error.statusCode,body:j.error.body,rawResponse:j.rawResponse})}return U(j.error,j.rawResponse,"GET","/entity-trait-definitions")}getOrCreateEntityTraitDefinition(o,i){return R.fromPromise(this.__getOrCreateEntityTraitDefinition(o,i))}async __getOrCreateEntityTraitDefinition(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"entity-trait-definitions"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:ut.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Tc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/entity-trait-definitions")}getEntityTraitDefinition(o,i){return R.fromPromise(this.__getEntityTraitDefinition(o,i))}async __getEntityTraitDefinition(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`entity-trait-definitions/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Pc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/entity-trait-definitions/{entity_trait_definition_id}")}updateEntityTraitDefinition(o,i,a){return R.fromPromise(this.__updateEntityTraitDefinition(o,i,a))}async __updateEntityTraitDefinition(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`entity-trait-definitions/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:ht.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:nl.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/entity-trait-definitions/{entity_trait_definition_id}")}countEntityTraitDefinitions(o={},i){return R.fromPromise(this.__countEntityTraitDefinitions(o,i))}async __countEntityTraitDefinitions(o={},i){let{entityType:a,ids:n,q:r,traitType:s,traitTypes:u,limit:g,offset:d}=o,l={};a!=null&&(l.entity_type=W.jsonOrThrow(a,{unrecognizedObjectKeys:"strip"})),n!=null&&(Array.isArray(n)?l.ids=n.map(b=>b):l.ids=n),r!=null&&(l.q=r),s!=null&&(l.trait_type=X.jsonOrThrow(s,{unrecognizedObjectKeys:"strip"})),u!=null&&(Array.isArray(u)?l.trait_types=u.map(b=>X.jsonOrThrow(b,{unrecognizedObjectKeys:"strip"})):l.trait_types=X.jsonOrThrow(u,{unrecognizedObjectKeys:"strip"})),g!=null&&(l.limit=g.toString()),d!=null&&(l.offset=d.toString());let m=await this._options.authProvider.getAuthRequest(),y=f(m.headers,this._options?.headers,i?.headers),j=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"entity-trait-definitions/count"),method:"GET",headers:y,queryParameters:{...l,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(j.ok)return{data:sc.parseOrThrow(j.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:j.rawResponse};if(j.error.reason==="status-code")switch(j.error.statusCode){case 400:throw new v(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 401:throw new C(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 403:throw new P(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 404:throw new E(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 500:throw new x(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);default:throw new z({statusCode:j.error.statusCode,body:j.error.body,rawResponse:j.rawResponse})}return U(j.error,j.rawResponse,"GET","/entity-trait-definitions/count")}getEntityTraitValues(o,i){return R.fromPromise(this.__getEntityTraitValues(o,i))}async __getEntityTraitValues(o,i){let{definitionId:a,q:n,limit:r,offset:s}=o,u={};u.definition_id=a,n!=null&&(u.q=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"entity-trait-values"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:Cc.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/entity-trait-values")}listPlanChanges(o={},i){return R.fromPromise(this.__listPlanChanges(o,i))}async __listPlanChanges(o={},i){let{action:a,basePlanAction:n,companyId:r,companyIds:s,planIds:u,limit:g,offset:d}=o,l={};a!=null&&(l.action=a),n!=null&&(l.base_plan_action=n),r!=null&&(l.company_id=r),s!=null&&(Array.isArray(s)?l.company_ids=s.map(b=>b):l.company_ids=s),u!=null&&(Array.isArray(u)?l.plan_ids=u.map(b=>b):l.plan_ids=u),g!=null&&(l.limit=g.toString()),d!=null&&(l.offset=d.toString());let m=await this._options.authProvider.getAuthRequest(),y=f(m.headers,this._options?.headers,i?.headers),j=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plan-changes"),method:"GET",headers:y,queryParameters:{...l,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(j.ok)return{data:Yc.parseOrThrow(j.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:j.rawResponse};if(j.error.reason==="status-code")switch(j.error.statusCode){case 400:throw new v(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 401:throw new C(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 403:throw new P(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 404:throw new E(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 500:throw new x(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);default:throw new z({statusCode:j.error.statusCode,body:j.error.body,rawResponse:j.rawResponse})}return U(j.error,j.rawResponse,"GET","/plan-changes")}getPlanChange(o,i){return R.fromPromise(this.__getPlanChange(o,i))}async __getPlanChange(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plan-changes/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Ac.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/plan-changes/{plan_change_id}")}listPlanTraits(o={},i){return R.fromPromise(this.__listPlanTraits(o,i))}async __listPlanTraits(o={},i){let{ids:a,planId:n,traitId:r,traitIds:s,limit:u,offset:g}=o,d={};a!=null&&(Array.isArray(a)?d.ids=a.map(j=>j):d.ids=a),n!=null&&(d.plan_id=n),r!=null&&(d.trait_id=r),s!=null&&(Array.isArray(s)?d.trait_ids=s.map(j=>j):d.trait_ids=s),u!=null&&(d.limit=u.toString()),g!=null&&(d.offset=g.toString());let l=await this._options.authProvider.getAuthRequest(),m=f(l.headers,this._options?.headers,i?.headers),y=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plan-traits"),method:"GET",headers:m,queryParameters:{...d,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(y.ok)return{data:el.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 400:throw new v(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 401:throw new C(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 403:throw new P(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 404:throw new E(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 500:throw new x(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);default:throw new z({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return U(y.error,y.rawResponse,"GET","/plan-traits")}createPlanTrait(o,i){return R.fromPromise(this.__createPlanTrait(o,i))}async __createPlanTrait(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plan-traits"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:dt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:dc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/plan-traits")}getPlanTrait(o,i){return R.fromPromise(this.__getPlanTrait(o,i))}async __getPlanTrait(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plan-traits/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Vc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/plan-traits/{plan_trait_id}")}updatePlanTrait(o,i,a){return R.fromPromise(this.__updatePlanTrait(o,i,a))}async __updatePlanTrait(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plan-traits/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:yt.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:cl.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/plan-traits/{plan_trait_id}")}deletePlanTrait(o,i){return R.fromPromise(this.__deletePlanTrait(o,i))}async __deletePlanTrait(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plan-traits/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:bc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/plan-traits/{plan_trait_id}")}updatePlanTraitsBulk(o,i){return R.fromPromise(this.__updatePlanTraitsBulk(o,i))}async __updatePlanTraitsBulk(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plan-traits/bulk"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:gt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:ll.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/plan-traits/bulk")}countPlanTraits(o={},i){return R.fromPromise(this.__countPlanTraits(o,i))}async __countPlanTraits(o={},i){let{ids:a,planId:n,traitId:r,traitIds:s,limit:u,offset:g}=o,d={};a!=null&&(Array.isArray(a)?d.ids=a.map(j=>j):d.ids=a),n!=null&&(d.plan_id=n),r!=null&&(d.trait_id=r),s!=null&&(Array.isArray(s)?d.trait_ids=s.map(j=>j):d.trait_ids=s),u!=null&&(d.limit=u.toString()),g!=null&&(d.offset=g.toString());let l=await this._options.authProvider.getAuthRequest(),m=f(l.headers,this._options?.headers,i?.headers),y=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plan-traits/count"),method:"GET",headers:m,queryParameters:{...d,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(y.ok)return{data:cc.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 400:throw new v(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 401:throw new C(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 403:throw new P(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 404:throw new E(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 500:throw new x(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);default:throw new z({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return U(y.error,y.rawResponse,"GET","/plan-traits/count")}upsertUserTrait(o,i){return R.fromPromise(this.__upsertUserTrait(o,i))}async __upsertUserTrait(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"user-traits"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Jt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:ml.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/user-traits")}listUsers(o={},i){return R.fromPromise(this.__listUsers(o,i))}async __listUsers(o={},i){let{companyId:a,ids:n,planId:r,q:s,limit:u,offset:g}=o,d={};a!=null&&(d.company_id=a),n!=null&&(Array.isArray(n)?d.ids=n.map(j=>j):d.ids=n),r!=null&&(d.plan_id=r),s!=null&&(d.q=s),u!=null&&(d.limit=u.toString()),g!=null&&(d.offset=g.toString());let l=await this._options.authProvider.getAuthRequest(),m=f(l.headers,this._options?.headers,i?.headers),y=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"users"),method:"GET",headers:m,queryParameters:{...d,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(y.ok)return{data:il.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 400:throw new v(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 401:throw new C(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 403:throw new P(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 404:throw new E(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 500:throw new x(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);default:throw new z({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return U(y.error,y.rawResponse,"GET","/users")}upsertUser(o,i){return R.fromPromise(this.__upsertUser(o,i))}async __upsertUser(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"users"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Qt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:dl.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/users")}getUser(o,i){return R.fromPromise(this.__getUser(o,i))}async __getUser(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`users/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:qc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/users/{user_id}")}deleteUser(o,i){return R.fromPromise(this.__deleteUser(o,i))}async __deleteUser(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`users/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Rc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/users/{user_id}")}countUsers(o={},i){return R.fromPromise(this.__countUsers(o,i))}async __countUsers(o={},i){let{companyId:a,ids:n,planId:r,q:s,limit:u,offset:g}=o,d={};a!=null&&(d.company_id=a),n!=null&&(Array.isArray(n)?d.ids=n.map(j=>j):d.ids=n),r!=null&&(d.plan_id=r),s!=null&&(d.q=s),u!=null&&(d.limit=u.toString()),g!=null&&(d.offset=g.toString());let l=await this._options.authProvider.getAuthRequest(),m=f(l.headers,this._options?.headers,i?.headers),y=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"users/count"),method:"GET",headers:m,queryParameters:{...d,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(y.ok)return{data:pc.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 400:throw new v(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 401:throw new C(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 403:throw new P(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 404:throw new E(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 500:throw new x(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);default:throw new z({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return U(y.error,y.rawResponse,"GET","/users/count")}createUser(o,i){return R.fromPromise(this.__createUser(o,i))}async __createUser(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"users/create"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Qt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:mc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/users/create")}deleteUserByKeys(o,i){return R.fromPromise(this.__deleteUserByKeys(o,i))}async __deleteUserByKeys(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"users/delete"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Ht.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:zc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/users/delete")}lookupUser(o,i){return R.fromPromise(this.__lookupUser(o,i))}async __lookupUser(o,i){let{keys:a}=o,n={};n.keys=me(a);let r=await this._options.authProvider.getAuthRequest(),s=f(r.headers,this._options?.headers,i?.headers),u=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"users/lookup"),method:"GET",headers:s,queryParameters:{...n,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(u.ok)return{data:sl.parseOrThrow(u.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")switch(u.error.statusCode){case 401:throw new C(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 403:throw new P(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 404:throw new E(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 500:throw new x(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);default:throw new z({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse})}return U(u.error,u.rawResponse,"GET","/users/lookup")}};var zo=class{constructor(o){this._options=K(o)}listComponents(o={},i){return R.fromPromise(this.__listComponents(o,i))}async __listComponents(o={},i){let{q:a,limit:n,offset:r}=o,s={};a!=null&&(s.q=a),n!=null&&(s.limit=n.toString()),r!=null&&(s.offset=r.toString());let u=await this._options.authProvider.getAuthRequest(),g=f(u.headers,this._options?.headers,i?.headers),d=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"components"),method:"GET",headers:g,queryParameters:{...s,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(d.ok)return{data:Rl.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:d.rawResponse};if(d.error.reason==="status-code")switch(d.error.statusCode){case 400:throw new v(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 401:throw new C(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 403:throw new P(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 404:throw new E(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 500:throw new x(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);default:throw new z({statusCode:d.error.statusCode,body:d.error.body,rawResponse:d.rawResponse})}return U(d.error,d.rawResponse,"GET","/components")}createComponent(o,i){return R.fromPromise(this.__createComponent(o,i))}async __createComponent(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"components"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:wt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:yl.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/components")}getComponent(o,i){return R.fromPromise(this.__getComponent(o,i))}async __getComponent(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`components/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:bl.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/components/{component_id}")}updateComponent(o,i={},a){return R.fromPromise(this.__updateComponent(o,i,a))}async __updateComponent(o,i={},a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`components/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:bt.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:jl.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/components/{component_id}")}deleteComponent(o,i){return R.fromPromise(this.__deleteComponent(o,i))}async __deleteComponent(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`components/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:wl.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/components/{component_id}")}countComponents(o={},i){return R.fromPromise(this.__countComponents(o,i))}async __countComponents(o={},i){let{q:a,limit:n,offset:r}=o,s={};a!=null&&(s.q=a),n!=null&&(s.limit=n.toString()),r!=null&&(s.offset=r.toString());let u=await this._options.authProvider.getAuthRequest(),g=f(u.headers,this._options?.headers,i?.headers),d=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"components/count"),method:"GET",headers:g,queryParameters:{...s,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(d.ok)return{data:gl.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:d.rawResponse};if(d.error.reason==="status-code")switch(d.error.statusCode){case 400:throw new v(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 401:throw new C(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 403:throw new P(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 404:throw new E(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 500:throw new x(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);default:throw new z({statusCode:d.error.statusCode,body:d.error.body,rawResponse:d.rawResponse})}return U(d.error,d.rawResponse,"GET","/components/count")}previewComponentData(o={},i){return R.fromPromise(this.__previewComponentData(o,i))}async __previewComponentData(o={},i){let{companyId:a,componentId:n}=o,r={};a!=null&&(r.company_id=a),n!=null&&(r.component_id=n);let s=await this._options.authProvider.getAuthRequest(),u=f(s.headers,this._options?.headers,i?.headers),g=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"components/preview-data"),method:"GET",headers:u,queryParameters:{...r,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(g.ok)return{data:Ol.parseOrThrow(g.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:g.rawResponse};if(g.error.reason==="status-code")switch(g.error.statusCode){case 401:throw new C(t.parseOrThrow(g.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),g.rawResponse);case 403:throw new P(t.parseOrThrow(g.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),g.rawResponse);case 404:throw new E(t.parseOrThrow(g.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),g.rawResponse);case 500:throw new x(t.parseOrThrow(g.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),g.rawResponse);default:throw new z({statusCode:g.error.statusCode,body:g.error.body,rawResponse:g.rawResponse})}return U(g.error,g.rawResponse,"GET","/components/preview-data")}};var Ro=class{constructor(o){this._options=K(o)}listBillingCredits(o={},i){return R.fromPromise(this.__listBillingCredits(o,i))}async __listBillingCredits(o={},i){let{ids:a,name:n,limit:r,offset:s}=o,u={};a!=null&&(Array.isArray(a)?u.ids=a.map(m=>m):u.ids=a),n!=null&&(u.name=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:cp.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/billing/credits")}createBillingCredit(o,i){return R.fromPromise(this.__createBillingCredit(o,i))}async __createBillingCredit(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Rt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Wl.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/billing/credits")}getSingleBillingCredit(o,i){return R.fromPromise(this.__getSingleBillingCredit(o,i))}async __getSingleBillingCredit(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`billing/credits/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:tp.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/billing/credits/{credit_id}")}updateBillingCredit(o,i,a){return R.fromPromise(this.__updateBillingCredit(o,i,a))}async __updateBillingCredit(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`billing/credits/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:St.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:bp.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/billing/credits/{credit_id}")}softDeleteBillingCredit(o,i){return R.fromPromise(this.__softDeleteBillingCredit(o,i))}async __softDeleteBillingCredit(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`billing/credits/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:wp.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/billing/credits/{credit_id}")}listCreditBundles(o={},i){return R.fromPromise(this.__listCreditBundles(o,i))}async __listCreditBundles(o={},i){let{ids:a,creditId:n,status:r,bundleType:s,limit:u,offset:g}=o,d={};a!=null&&(Array.isArray(a)?d.ids=a.map(j=>j):d.ids=a),n!=null&&(d.credit_id=n),r!=null&&(d.status=ue.jsonOrThrow(r,{unrecognizedObjectKeys:"strip"})),s!=null&&(d.bundle_type=ze.jsonOrThrow(s,{unrecognizedObjectKeys:"strip"})),u!=null&&(d.limit=u.toString()),g!=null&&(d.offset=g.toString());let l=await this._options.authProvider.getAuthRequest(),m=f(l.headers,this._options?.headers,i?.headers),y=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/bundles"),method:"GET",headers:m,queryParameters:{...d,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(y.ok)return{data:hp.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 400:throw new v(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 401:throw new C(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 403:throw new P(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 404:throw new E(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 500:throw new x(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);default:throw new z({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return U(y.error,y.rawResponse,"GET","/billing/credits/bundles")}createCreditBundle(o,i){return R.fromPromise(this.__createCreditBundle(o,i))}async __createCreditBundle(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/bundles"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:_t.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Hl.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/billing/credits/bundles")}getCreditBundle(o,i){return R.fromPromise(this.__getCreditBundle(o,i))}async __getCreditBundle(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`billing/credits/bundles/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Ql.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/billing/credits/bundles/{bundle_id}")}updateCreditBundleDetails(o,i,a){return R.fromPromise(this.__updateCreditBundleDetails(o,i,a))}async __updateCreditBundleDetails(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`billing/credits/bundles/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:Pt.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:Rp.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/billing/credits/bundles/{bundle_id}")}deleteCreditBundle(o,i){return R.fromPromise(this.__deleteCreditBundle(o,i))}async __deleteCreditBundle(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`billing/credits/bundles/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Jl.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/billing/credits/bundles/{bundle_id}")}countCreditBundles(o={},i){return R.fromPromise(this.__countCreditBundles(o,i))}async __countCreditBundles(o={},i){let{ids:a,creditId:n,status:r,bundleType:s,limit:u,offset:g}=o,d={};a!=null&&(Array.isArray(a)?d.ids=a.map(j=>j):d.ids=a),n!=null&&(d.credit_id=n),r!=null&&(d.status=ue.jsonOrThrow(r,{unrecognizedObjectKeys:"strip"})),s!=null&&(d.bundle_type=ze.jsonOrThrow(s,{unrecognizedObjectKeys:"strip"})),u!=null&&(d.limit=u.toString()),g!=null&&(d.offset=g.toString());let l=await this._options.authProvider.getAuthRequest(),m=f(l.headers,this._options?.headers,i?.headers),y=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/bundles/count"),method:"GET",headers:m,queryParameters:{...d,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(y.ok)return{data:Kl.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 400:throw new v(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 401:throw new C(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 403:throw new P(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 404:throw new E(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 500:throw new x(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);default:throw new z({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return U(y.error,y.rawResponse,"GET","/billing/credits/bundles/count")}countBillingCredits(o={},i){return R.fromPromise(this.__countBillingCredits(o,i))}async __countBillingCredits(o={},i){let{ids:a,name:n,limit:r,offset:s}=o,u={};a!=null&&(Array.isArray(a)?u.ids=a.map(m=>m):u.ids=a),n!=null&&(u.name=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/count"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:Vl.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/billing/credits/count")}zeroOutGrant(o,i={},a){return R.fromPromise(this.__zeroOutGrant(o,i,a))}async __zeroOutGrant(o,i={},a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`billing/credits/grants/${w.encodePathParam(o)}/zero-out`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:xt.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:fp.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/billing/credits/grants/{grant_id}/zero-out")}grantBillingCreditsToCompany(o,i){return R.fromPromise(this.__grantBillingCreditsToCompany(o,i))}async __grantBillingCreditsToCompany(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/grants/company"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:ft.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:sp.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/billing/credits/grants/company")}countCompanyGrants(o={},i){return R.fromPromise(this.__countCompanyGrants(o,i))}async __countCompanyGrants(o={},i){let{companyId:a,order:n,dir:r,limit:s,offset:u}=o,g={};a!=null&&(g.company_id=a),n!=null&&(g.order=ur.jsonOrThrow(n,{unrecognizedObjectKeys:"strip"})),r!=null&&(g.dir=we.jsonOrThrow(r,{unrecognizedObjectKeys:"strip"})),s!=null&&(g.limit=s.toString()),u!=null&&(g.offset=u.toString());let d=await this._options.authProvider.getAuthRequest(),l=f(d.headers,this._options?.headers,i?.headers),m=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/grants/company/count"),method:"GET",headers:l,queryParameters:{...g,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(m.ok)return{data:Fl.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new v(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 401:throw new C(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 403:throw new P(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 404:throw new E(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 500:throw new x(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new z({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return U(m.error,m.rawResponse,"GET","/billing/credits/grants/company/count")}listCompanyGrants(o={},i){return R.fromPromise(this.__listCompanyGrants(o,i))}async __listCompanyGrants(o={},i){let{companyId:a,order:n,dir:r,limit:s,offset:u}=o,g={};a!=null&&(g.company_id=a),n!=null&&(g.order=ur.jsonOrThrow(n,{unrecognizedObjectKeys:"strip"})),r!=null&&(g.dir=we.jsonOrThrow(r,{unrecognizedObjectKeys:"strip"})),s!=null&&(g.limit=s.toString()),u!=null&&(g.offset=u.toString());let d=await this._options.authProvider.getAuthRequest(),l=f(d.headers,this._options?.headers,i?.headers),m=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/grants/company/list"),method:"GET",headers:l,queryParameters:{...g,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(m.ok)return{data:dp.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new v(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 401:throw new C(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 403:throw new P(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 404:throw new E(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 500:throw new x(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new z({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return U(m.error,m.rawResponse,"GET","/billing/credits/grants/company/list")}countBillingCreditsGrants(o={},i){return R.fromPromise(this.__countBillingCreditsGrants(o,i))}async __countBillingCreditsGrants(o={},i){let{creditId:a,ids:n,limit:r,offset:s}=o,u={};a!=null&&(u.credit_id=a),n!=null&&(Array.isArray(n)?u.ids=n.map(m=>m):u.ids=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/grants/count"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:Bl.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/billing/credits/grants/count")}listGrantsForCredit(o={},i){return R.fromPromise(this.__listGrantsForCredit(o,i))}async __listGrantsForCredit(o={},i){let{creditId:a,ids:n,limit:r,offset:s}=o,u={};a!=null&&(u.credit_id=a),n!=null&&(Array.isArray(n)?u.ids=n.map(m=>m):u.ids=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/grants/list"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:yp.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/billing/credits/grants/list")}getEnrichedCreditLedger(o,i){return R.fromPromise(this.__getEnrichedCreditLedger(o,i))}async __getEnrichedCreditLedger(o,i){let{companyId:a,billingCreditId:n,featureId:r,period:s,startTime:u,endTime:g,limit:d,offset:l}=o,m={};m.company_id=a,n!=null&&(m.billing_credit_id=n),r!=null&&(m.feature_id=r),m.period=dr.jsonOrThrow(s,{unrecognizedObjectKeys:"strip"}),u!=null&&(m.start_time=u),g!=null&&(m.end_time=g),d!=null&&(m.limit=d.toString()),l!=null&&(m.offset=l.toString());let y=await this._options.authProvider.getAuthRequest(),j=f(y.headers,this._options?.headers,i?.headers),b=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/ledger"),method:"GET",headers:j,queryParameters:{...m,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(b.ok)return{data:op.parseOrThrow(b.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:b.rawResponse};if(b.error.reason==="status-code")switch(b.error.statusCode){case 400:throw new v(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 401:throw new C(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 403:throw new P(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 404:throw new E(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 500:throw new x(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);default:throw new z({statusCode:b.error.statusCode,body:b.error.body,rawResponse:b.rawResponse})}return U(b.error,b.rawResponse,"GET","/billing/credits/ledger")}countCreditLedger(o,i){return R.fromPromise(this.__countCreditLedger(o,i))}async __countCreditLedger(o,i){let{companyId:a,billingCreditId:n,featureId:r,period:s,startTime:u,endTime:g,limit:d,offset:l}=o,m={};m.company_id=a,n!=null&&(m.billing_credit_id=n),r!=null&&(m.feature_id=r),m.period=dr.jsonOrThrow(s,{unrecognizedObjectKeys:"strip"}),u!=null&&(m.start_time=u),g!=null&&(m.end_time=g),d!=null&&(m.limit=d.toString()),l!=null&&(m.offset=l.toString());let y=await this._options.authProvider.getAuthRequest(),j=f(y.headers,this._options?.headers,i?.headers),b=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/ledger/count"),method:"GET",headers:j,queryParameters:{...m,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(b.ok)return{data:Ll.parseOrThrow(b.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:b.rawResponse};if(b.error.reason==="status-code")switch(b.error.statusCode){case 400:throw new v(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 401:throw new C(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 403:throw new P(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 404:throw new E(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 500:throw new x(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);default:throw new z({statusCode:b.error.statusCode,body:b.error.body,rawResponse:b.rawResponse})}return U(b.error,b.rawResponse,"GET","/billing/credits/ledger/count")}listBillingPlanCreditGrants(o={},i){return R.fromPromise(this.__listBillingPlanCreditGrants(o,i))}async __listBillingPlanCreditGrants(o={},i){let{creditId:a,planId:n,planIds:r,ids:s,limit:u,offset:g}=o,d={};a!=null&&(d.credit_id=a),n!=null&&(d.plan_id=n),r!=null&&(Array.isArray(r)?d.plan_ids=r.map(j=>j):d.plan_ids=r),s!=null&&(Array.isArray(s)?d.ids=s.map(j=>j):d.ids=s),u!=null&&(d.limit=u.toString()),g!=null&&(d.offset=g.toString());let l=await this._options.authProvider.getAuthRequest(),m=f(l.headers,this._options?.headers,i?.headers),y=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/plan-grants"),method:"GET",headers:m,queryParameters:{...d,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(y.ok)return{data:pp.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 400:throw new v(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 401:throw new C(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 403:throw new P(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 404:throw new E(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 500:throw new x(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);default:throw new z({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return U(y.error,y.rawResponse,"GET","/billing/credits/plan-grants")}createBillingPlanCreditGrant(o,i){return R.fromPromise(this.__createBillingPlanCreditGrant(o,i))}async __createBillingPlanCreditGrant(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/plan-grants"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Ji.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Nl.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/billing/credits/plan-grants")}updateBillingPlanCreditGrant(o,i,a){return R.fromPromise(this.__updateBillingPlanCreditGrant(o,i,a))}async __updateBillingPlanCreditGrant(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`billing/credits/plan-grants/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:Yi.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:zp.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/billing/credits/plan-grants/{plan_grant_id}")}deleteBillingPlanCreditGrant(o,i={},a){return R.fromPromise(this.__deleteBillingPlanCreditGrant(o,i,a))}async __deleteBillingPlanCreditGrant(o,i={},a){let{applyToExisting:n}=i,r={};n!=null&&(r.apply_to_existing=n.toString());let s=await this._options.authProvider.getAuthRequest(),u=f(s.headers,this._options?.headers,a?.headers),g=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`billing/credits/plan-grants/${w.encodePathParam(o)}`),method:"DELETE",headers:u,queryParameters:{...r,...a?.queryParams},timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(g.ok)return{data:Zl.parseOrThrow(g.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:g.rawResponse};if(g.error.reason==="status-code")switch(g.error.statusCode){case 400:throw new v(t.parseOrThrow(g.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),g.rawResponse);case 401:throw new C(t.parseOrThrow(g.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),g.rawResponse);case 403:throw new P(t.parseOrThrow(g.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),g.rawResponse);case 404:throw new E(t.parseOrThrow(g.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),g.rawResponse);case 500:throw new x(t.parseOrThrow(g.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),g.rawResponse);default:throw new z({statusCode:g.error.statusCode,body:g.error.body,rawResponse:g.rawResponse})}return U(g.error,g.rawResponse,"DELETE","/billing/credits/plan-grants/{plan_grant_id}")}countBillingPlanCreditGrants(o={},i){return R.fromPromise(this.__countBillingPlanCreditGrants(o,i))}async __countBillingPlanCreditGrants(o={},i){let{creditId:a,planId:n,planIds:r,ids:s,limit:u,offset:g}=o,d={};a!=null&&(d.credit_id=a),n!=null&&(d.plan_id=n),r!=null&&(Array.isArray(r)?d.plan_ids=r.map(j=>j):d.plan_ids=r),s!=null&&(Array.isArray(s)?d.ids=s.map(j=>j):d.ids=s),u!=null&&(d.limit=u.toString()),g!=null&&(d.offset=g.toString());let l=await this._options.authProvider.getAuthRequest(),m=f(l.headers,this._options?.headers,i?.headers),y=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/plan-grants/count"),method:"GET",headers:m,queryParameters:{...d,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(y.ok)return{data:Dl.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 400:throw new v(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 401:throw new C(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 403:throw new P(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 404:throw new E(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 500:throw new x(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);default:throw new z({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return U(y.error,y.rawResponse,"GET","/billing/credits/plan-grants/count")}};var fo=class{constructor(o){this._options=K(o)}createDataExport(o,i){return R.fromPromise(this.__createDataExport(o,i))}async __createDataExport(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"data-exports"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:{...Et.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),export_type:"company-feature-usage",output_file_type:"csv"},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Ep.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/data-exports")}getDataExportArtifact(o,i){return R.fromPromise(this.__getDataExportArtifact(o,i))}async __getDataExportArtifact(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`data-exports/${w.encodePathParam(o)}/artifact`),method:"GET",headers:n,queryParameters:i?.queryParams,responseType:"streaming",timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:r.body,rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/data-exports/{data_export_id}/artifact")}};var _o=class{constructor(o){this._options=K(o)}listCompanyOverrides(o={},i){return R.fromPromise(this.__listCompanyOverrides(o,i))}async __listCompanyOverrides(o={},i){let{companyId:a,companyIds:n,featureId:r,featureIds:s,ids:u,withoutExpired:g,q:d,limit:l,offset:m}=o,y={};a!=null&&(y.company_id=a),n!=null&&(Array.isArray(n)?y.company_ids=n.map(V=>V):y.company_ids=n),r!=null&&(y.feature_id=r),s!=null&&(Array.isArray(s)?y.feature_ids=s.map(V=>V):y.feature_ids=s),u!=null&&(Array.isArray(u)?y.ids=u.map(V=>V):y.ids=u),g!=null&&(y.without_expired=g.toString()),d!=null&&(y.q=d),l!=null&&(y.limit=l.toString()),m!=null&&(y.offset=m.toString());let j=await this._options.authProvider.getAuthRequest(),b=f(j.headers,this._options?.headers,i?.headers),T=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"company-overrides"),method:"GET",headers:b,queryParameters:{...y,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(T.ok)return{data:tu.parseOrThrow(T.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:T.rawResponse};if(T.error.reason==="status-code")switch(T.error.statusCode){case 400:throw new v(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 401:throw new C(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 403:throw new P(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 404:throw new E(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 500:throw new x(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);default:throw new z({statusCode:T.error.statusCode,body:T.error.body,rawResponse:T.rawResponse})}return U(T.error,T.rawResponse,"GET","/company-overrides")}createCompanyOverride(o,i){return R.fromPromise(this.__createCompanyOverride(o,i))}async __createCompanyOverride(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"company-overrides"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Ct.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Wp.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/company-overrides")}getCompanyOverride(o,i){return R.fromPromise(this.__getCompanyOverride(o,i))}async __getCompanyOverride(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`company-overrides/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Xp.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/company-overrides/{company_override_id}")}updateCompanyOverride(o,i,a){return R.fromPromise(this.__updateCompanyOverride(o,i,a))}async __updateCompanyOverride(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`company-overrides/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:vt.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:yu.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/company-overrides/{company_override_id}")}deleteCompanyOverride(o,i){return R.fromPromise(this.__deleteCompanyOverride(o,i))}async __deleteCompanyOverride(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`company-overrides/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Hp.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/company-overrides/{company_override_id}")}countCompanyOverrides(o={},i){return R.fromPromise(this.__countCompanyOverrides(o,i))}async __countCompanyOverrides(o={},i){let{companyId:a,companyIds:n,featureId:r,featureIds:s,ids:u,withoutExpired:g,q:d,limit:l,offset:m}=o,y={};a!=null&&(y.company_id=a),n!=null&&(Array.isArray(n)?y.company_ids=n.map(V=>V):y.company_ids=n),r!=null&&(y.feature_id=r),s!=null&&(Array.isArray(s)?y.feature_ids=s.map(V=>V):y.feature_ids=s),u!=null&&(Array.isArray(u)?y.ids=u.map(V=>V):y.ids=u),g!=null&&(y.without_expired=g.toString()),d!=null&&(y.q=d),l!=null&&(y.limit=l.toString()),m!=null&&(y.offset=m.toString());let j=await this._options.authProvider.getAuthRequest(),b=f(j.headers,this._options?.headers,i?.headers),T=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"company-overrides/count"),method:"GET",headers:b,queryParameters:{...y,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(T.ok)return{data:Vp.parseOrThrow(T.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:T.rawResponse};if(T.error.reason==="status-code")switch(T.error.statusCode){case 400:throw new v(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 401:throw new C(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 403:throw new P(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 404:throw new E(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 500:throw new x(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);default:throw new z({statusCode:T.error.statusCode,body:T.error.body,rawResponse:T.rawResponse})}return U(T.error,T.rawResponse,"GET","/company-overrides/count")}listFeatureCompanies(o,i){return R.fromPromise(this.__listFeatureCompanies(o,i))}async __listFeatureCompanies(o,i){let{featureId:a,q:n,limit:r,offset:s}=o,u={};u.feature_id=a,n!=null&&(u.q=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"feature-companies"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:cu.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/feature-companies")}countFeatureCompanies(o,i){return R.fromPromise(this.__countFeatureCompanies(o,i))}async __countFeatureCompanies(o,i){let{featureId:a,q:n,limit:r,offset:s}=o,u={};u.feature_id=a,n!=null&&(u.q=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"feature-companies/count"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:Dp.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/feature-companies/count")}listFeatureUsage(o={},i){return R.fromPromise(this.__listFeatureUsage(o,i))}async __listFeatureUsage(o={},i){let{companyId:a,companyKeys:n,featureIds:r,includeUsageAggregation:s,q:u,withoutNegativeEntitlements:g,limit:d,offset:l}=o,m={};a!=null&&(m.company_id=a),n!=null&&(m.company_keys=me(n)),r!=null&&(Array.isArray(r)?m.feature_ids=r.map(T=>T):m.feature_ids=r),s!=null&&(m.include_usage_aggregation=s.toString()),u!=null&&(m.q=u),g!=null&&(m.without_negative_entitlements=g.toString()),d!=null&&(m.limit=d.toString()),l!=null&&(m.offset=l.toString());let y=await this._options.authProvider.getAuthRequest(),j=f(y.headers,this._options?.headers,i?.headers),b=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"feature-usage"),method:"GET",headers:j,queryParameters:{...m,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(b.ok)return{data:pu.parseOrThrow(b.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:b.rawResponse};if(b.error.reason==="status-code")switch(b.error.statusCode){case 400:throw new v(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 401:throw new C(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 403:throw new P(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 404:throw new E(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 500:throw new x(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);default:throw new z({statusCode:b.error.statusCode,body:b.error.body,rawResponse:b.rawResponse})}return U(b.error,b.rawResponse,"GET","/feature-usage")}countFeatureUsage(o={},i){return R.fromPromise(this.__countFeatureUsage(o,i))}async __countFeatureUsage(o={},i){let{companyId:a,companyKeys:n,featureIds:r,includeUsageAggregation:s,q:u,withoutNegativeEntitlements:g,limit:d,offset:l}=o,m={};a!=null&&(m.company_id=a),n!=null&&(m.company_keys=me(n)),r!=null&&(Array.isArray(r)?m.feature_ids=r.map(T=>T):m.feature_ids=r),s!=null&&(m.include_usage_aggregation=s.toString()),u!=null&&(m.q=u),g!=null&&(m.without_negative_entitlements=g.toString()),d!=null&&(m.limit=d.toString()),l!=null&&(m.offset=l.toString());let y=await this._options.authProvider.getAuthRequest(),j=f(y.headers,this._options?.headers,i?.headers),b=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"feature-usage/count"),method:"GET",headers:j,queryParameters:{...m,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(b.ok)return{data:Fp.parseOrThrow(b.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:b.rawResponse};if(b.error.reason==="status-code")switch(b.error.statusCode){case 400:throw new v(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 401:throw new C(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 403:throw new P(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 404:throw new E(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 500:throw new x(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);default:throw new z({statusCode:b.error.statusCode,body:b.error.body,rawResponse:b.rawResponse})}return U(b.error,b.rawResponse,"GET","/feature-usage/count")}listFeatureUsers(o,i){return R.fromPromise(this.__listFeatureUsers(o,i))}async __listFeatureUsers(o,i){let{featureId:a,q:n,limit:r,offset:s}=o,u={};u.feature_id=a,n!=null&&(u.q=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"feature-users"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:mu.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/feature-users")}countFeatureUsers(o,i){return R.fromPromise(this.__countFeatureUsers(o,i))}async __countFeatureUsers(o,i){let{featureId:a,q:n,limit:r,offset:s}=o,u={};u.feature_id=a,n!=null&&(u.q=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"feature-users/count"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:Kp.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/feature-users/count")}listPlanEntitlements(o={},i){return R.fromPromise(this.__listPlanEntitlements(o,i))}async __listPlanEntitlements(o={},i){let{featureId:a,featureIds:n,ids:r,planId:s,planIds:u,q:g,withMeteredProducts:d,limit:l,offset:m}=o,y={};a!=null&&(y.feature_id=a),n!=null&&(Array.isArray(n)?y.feature_ids=n.map(V=>V):y.feature_ids=n),r!=null&&(Array.isArray(r)?y.ids=r.map(V=>V):y.ids=r),s!=null&&(y.plan_id=s),u!=null&&(Array.isArray(u)?y.plan_ids=u.map(V=>V):y.plan_ids=u),g!=null&&(y.q=g),d!=null&&(y.with_metered_products=d.toString()),l!=null&&(y.limit=l.toString()),m!=null&&(y.offset=m.toString());let j=await this._options.authProvider.getAuthRequest(),b=f(j.headers,this._options?.headers,i?.headers),T=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plan-entitlements"),method:"GET",headers:b,queryParameters:{...y,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(T.ok)return{data:gu.parseOrThrow(T.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:T.rawResponse};if(T.error.reason==="status-code")switch(T.error.statusCode){case 400:throw new v(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 401:throw new C(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 403:throw new P(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 404:throw new E(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 500:throw new x(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);default:throw new z({statusCode:T.error.statusCode,body:T.error.body,rawResponse:T.rawResponse})}return U(T.error,T.rawResponse,"GET","/plan-entitlements")}createPlanEntitlement(o,i){return R.fromPromise(this.__createPlanEntitlement(o,i))}async __createPlanEntitlement(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plan-entitlements"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Ut.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Np.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/plan-entitlements")}getPlanEntitlement(o,i){return R.fromPromise(this.__getPlanEntitlement(o,i))}async __getPlanEntitlement(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plan-entitlements/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:iu.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/plan-entitlements/{plan_entitlement_id}")}updatePlanEntitlement(o,i,a){return R.fromPromise(this.__updatePlanEntitlement(o,i,a))}async __updatePlanEntitlement(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plan-entitlements/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:Ot.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:wu.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/plan-entitlements/{plan_entitlement_id}")}deletePlanEntitlement(o,i){return R.fromPromise(this.__deletePlanEntitlement(o,i))}async __deletePlanEntitlement(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plan-entitlements/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:$p.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/plan-entitlements/{plan_entitlement_id}")}countPlanEntitlements(o={},i){return R.fromPromise(this.__countPlanEntitlements(o,i))}async __countPlanEntitlements(o={},i){let{featureId:a,featureIds:n,ids:r,planId:s,planIds:u,q:g,withMeteredProducts:d,limit:l,offset:m}=o,y={};a!=null&&(y.feature_id=a),n!=null&&(Array.isArray(n)?y.feature_ids=n.map(V=>V):y.feature_ids=n),r!=null&&(Array.isArray(r)?y.ids=r.map(V=>V):y.ids=r),s!=null&&(y.plan_id=s),u!=null&&(Array.isArray(u)?y.plan_ids=u.map(V=>V):y.plan_ids=u),g!=null&&(y.q=g),d!=null&&(y.with_metered_products=d.toString()),l!=null&&(y.limit=l.toString()),m!=null&&(y.offset=m.toString());let j=await this._options.authProvider.getAuthRequest(),b=f(j.headers,this._options?.headers,i?.headers),T=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plan-entitlements/count"),method:"GET",headers:b,queryParameters:{...y,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(T.ok)return{data:Lp.parseOrThrow(T.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:T.rawResponse};if(T.error.reason==="status-code")switch(T.error.statusCode){case 400:throw new v(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 401:throw new C(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 403:throw new P(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 404:throw new E(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 500:throw new x(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);default:throw new z({statusCode:T.error.statusCode,body:T.error.body,rawResponse:T.rawResponse})}return U(T.error,T.rawResponse,"GET","/plan-entitlements/count")}duplicatePlanEntitlements(o,i){return R.fromPromise(this.__duplicatePlanEntitlements(o,i))}async __duplicatePlanEntitlements(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plan-entitlements/duplicate"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Tt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Yp.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/plan-entitlements/duplicate")}getFeatureUsageByCompany(o,i){return R.fromPromise(this.__getFeatureUsageByCompany(o,i))}async __getFeatureUsageByCompany(o,i){let{keys:a}=o,n={};n.keys=me(a);let r=await this._options.authProvider.getAuthRequest(),s=f(r.headers,this._options?.headers,i?.headers),u=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"usage-by-company"),method:"GET",headers:s,queryParameters:{...n,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(u.ok)return{data:ru.parseOrThrow(u.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")switch(u.error.statusCode){case 401:throw new C(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 403:throw new P(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 404:throw new E(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 500:throw new x(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);default:throw new z({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse})}return U(u.error,u.rawResponse,"GET","/usage-by-company")}};var So=class{constructor(o){this._options=K(o)}createEventBatch(o,i){return R.fromPromise(this.__createEventBatch(o,i))}async __createEventBatch(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"event-batch"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:jt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Pu.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/event-batch")}getEventSummaries(o={},i){return R.fromPromise(this.__getEventSummaries(o,i))}async __getEventSummaries(o={},i){let{q:a,eventSubtypes:n,limit:r,offset:s}=o,u={};a!=null&&(u.q=a),n!=null&&(Array.isArray(n)?u.event_subtypes=n.map(m=>m):u.event_subtypes=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"event-types"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:Tu.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/event-types")}listEvents(o={},i){return R.fromPromise(this.__listEvents(o,i))}async __listEvents(o={},i){let{companyId:a,eventSubtype:n,eventTypes:r,flagId:s,userId:u,limit:g,offset:d}=o,l={};a!=null&&(l.company_id=a),n!=null&&(l.event_subtype=n),r!=null&&(Array.isArray(r)?l.event_types=r.map(b=>Ne.jsonOrThrow(b,{unrecognizedObjectKeys:"strip"})):l.event_types=Ne.jsonOrThrow(r,{unrecognizedObjectKeys:"strip"})),s!=null&&(l.flag_id=s),u!=null&&(l.user_id=u),g!=null&&(l.limit=g.toString()),d!=null&&(l.offset=d.toString());let m=await this._options.authProvider.getAuthRequest(),y=f(m.headers,this._options?.headers,i?.headers),j=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"events"),method:"GET",headers:y,queryParameters:{...l,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(j.ok)return{data:ku.parseOrThrow(j.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:j.rawResponse};if(j.error.reason==="status-code")switch(j.error.statusCode){case 400:throw new v(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 401:throw new C(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 403:throw new P(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 404:throw new E(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 500:throw new x(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);default:throw new z({statusCode:j.error.statusCode,body:j.error.body,rawResponse:j.rawResponse})}return U(j.error,j.rawResponse,"GET","/events")}createEvent(o,i){return R.fromPromise(this.__createEvent(o,i))}async __createEvent(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"events"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Ii.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:xu.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/events")}getEvent(o,i){return R.fromPromise(this.__getEvent(o,i))}async __getEvent(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`events/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Cu.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/events/{event_id}")}getSegmentIntegrationStatus(o){return R.fromPromise(this.__getSegmentIntegrationStatus(o))}async __getSegmentIntegrationStatus(o){let i=await this._options.authProvider.getAuthRequest(),a=f(i.headers,this._options?.headers,o?.headers),n=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"segment-integration"),method:"GET",headers:a,queryParameters:o?.queryParams,timeoutMs:(o?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:o?.maxRetries??this._options?.maxRetries,abortSignal:o?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(n.ok)return{data:Ou.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.statusCode){case 401:throw new C(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);case 403:throw new P(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);case 404:throw new E(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);case 500:throw new x(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);default:throw new z({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse})}return U(n.error,n.rawResponse,"GET","/segment-integration")}};var Po=class{constructor(o){this._options=K(o)}listFeatures(o={},i){return R.fromPromise(this.__listFeatures(o,i))}async __listFeatures(o={},i){let{ids:a,q:n,withoutCompanyOverrideFor:r,withoutPlanEntitlementFor:s,featureType:u,booleanRequireEvent:g,limit:d,offset:l}=o,m={};a!=null&&(Array.isArray(a)?m.ids=a.map(T=>T):m.ids=a),n!=null&&(m.q=n),r!=null&&(m.without_company_override_for=r),s!=null&&(m.without_plan_entitlement_for=s),u!=null&&(Array.isArray(u)?m.feature_type=u.map(T=>te.jsonOrThrow(T,{unrecognizedObjectKeys:"strip"})):m.feature_type=te.jsonOrThrow(u,{unrecognizedObjectKeys:"strip"})),g!=null&&(m.boolean_require_event=g.toString()),d!=null&&(m.limit=d.toString()),l!=null&&(m.offset=l.toString());let y=await this._options.authProvider.getAuthRequest(),j=f(y.headers,this._options?.headers,i?.headers),b=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"features"),method:"GET",headers:j,queryParameters:{...m,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(b.ok)return{data:id.parseOrThrow(b.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:b.rawResponse};if(b.error.reason==="status-code")switch(b.error.statusCode){case 400:throw new v(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 401:throw new C(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 403:throw new P(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 404:throw new E(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 500:throw new x(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);default:throw new z({statusCode:b.error.statusCode,body:b.error.body,rawResponse:b.rawResponse})}return U(b.error,b.rawResponse,"GET","/features")}createFeature(o,i){return R.fromPromise(this.__createFeature(o,i))}async __createFeature(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"features"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Bt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Zu.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/features")}getFeature(o,i){return R.fromPromise(this.__getFeature(o,i))}async __getFeature(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`features/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Xu.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/features/{feature_id}")}updateFeature(o,i={},a){return R.fromPromise(this.__updateFeature(o,i,a))}async __updateFeature(o,i={},a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`features/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:At.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:ad.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/features/{feature_id}")}deleteFeature(o,i){return R.fromPromise(this.__deleteFeature(o,i))}async __deleteFeature(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`features/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Qu.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/features/{feature_id}")}countFeatures(o={},i){return R.fromPromise(this.__countFeatures(o,i))}async __countFeatures(o={},i){let{ids:a,q:n,withoutCompanyOverrideFor:r,withoutPlanEntitlementFor:s,featureType:u,booleanRequireEvent:g,limit:d,offset:l}=o,m={};a!=null&&(Array.isArray(a)?m.ids=a.map(T=>T):m.ids=a),n!=null&&(m.q=n),r!=null&&(m.without_company_override_for=r),s!=null&&(m.without_plan_entitlement_for=s),u!=null&&(Array.isArray(u)?m.feature_type=u.map(T=>te.jsonOrThrow(T,{unrecognizedObjectKeys:"strip"})):m.feature_type=te.jsonOrThrow(u,{unrecognizedObjectKeys:"strip"})),g!=null&&(m.boolean_require_event=g.toString()),d!=null&&(m.limit=d.toString()),l!=null&&(m.offset=l.toString());let y=await this._options.authProvider.getAuthRequest(),j=f(y.headers,this._options?.headers,i?.headers),b=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"features/count"),method:"GET",headers:j,queryParameters:{...m,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(b.ok)return{data:Nu.parseOrThrow(b.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:b.rawResponse};if(b.error.reason==="status-code")switch(b.error.statusCode){case 400:throw new v(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 401:throw new C(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 403:throw new P(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 404:throw new E(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 500:throw new x(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);default:throw new z({statusCode:b.error.statusCode,body:b.error.body,rawResponse:b.rawResponse})}return U(b.error,b.rawResponse,"GET","/features/count")}listFlags(o={},i){return R.fromPromise(this.__listFlags(o,i))}async __listFlags(o={},i){let{featureId:a,ids:n,q:r,limit:s,offset:u}=o,g={};a!=null&&(g.feature_id=a),n!=null&&(Array.isArray(n)?g.ids=n.map(y=>y):g.ids=n),r!=null&&(g.q=r),s!=null&&(g.limit=s.toString()),u!=null&&(g.offset=u.toString());let d=await this._options.authProvider.getAuthRequest(),l=f(d.headers,this._options?.headers,i?.headers),m=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"flags"),method:"GET",headers:l,queryParameters:{...g,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(m.ok)return{data:td.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new v(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 401:throw new C(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 403:throw new P(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 404:throw new E(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 500:throw new x(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new z({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return U(m.error,m.rawResponse,"GET","/flags")}createFlag(o,i){return R.fromPromise(this.__createFlag(o,i))}async __createFlag(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"flags"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Nt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Ju.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/flags")}getFlag(o,i){return R.fromPromise(this.__getFlag(o,i))}async __getFlag(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`flags/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:ed.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/flags/{flag_id}")}updateFlag(o,i,a){return R.fromPromise(this.__updateFlag(o,i,a))}async __updateFlag(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`flags/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:Nt.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:sd.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/flags/{flag_id}")}deleteFlag(o,i){return R.fromPromise(this.__deleteFlag(o,i))}async __deleteFlag(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`flags/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Yu.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/flags/{flag_id}")}updateFlagRules(o,i,a){return R.fromPromise(this.__updateFlagRules(o,i,a))}async __updateFlagRules(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`flags/${w.encodePathParam(o)}/rules`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:Vt.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:ld.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/flags/{flag_id}/rules")}checkFlag(o,i,a){return R.fromPromise(this.__checkFlag(o,i,a))}async __checkFlag(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`flags/${w.encodePathParam(o)}/check`),method:"POST",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:ni.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:Iu.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"POST","/flags/{key}/check")}checkFlags(o,i){return R.fromPromise(this.__checkFlags(o,i))}async __checkFlags(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"flags/check"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:ni.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Lu.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/flags/check")}checkFlagsBulk(o,i){return R.fromPromise(this.__checkFlagsBulk(o,i))}async __checkFlagsBulk(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"flags/check-bulk"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:kt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Gu.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/flags/check-bulk")}countFlags(o={},i){return R.fromPromise(this.__countFlags(o,i))}async __countFlags(o={},i){let{featureId:a,ids:n,q:r,limit:s,offset:u}=o,g={};a!=null&&(g.feature_id=a),n!=null&&(Array.isArray(n)?g.ids=n.map(y=>y):g.ids=n),r!=null&&(g.q=r),s!=null&&(g.limit=s.toString()),u!=null&&(g.offset=u.toString());let d=await this._options.authProvider.getAuthRequest(),l=f(d.headers,this._options?.headers,i?.headers),m=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"flags/count"),method:"GET",headers:l,queryParameters:{...g,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(m.ok)return{data:$u.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new v(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 401:throw new C(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 403:throw new P(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 404:throw new E(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 500:throw new x(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new z({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return U(m.error,m.rawResponse,"GET","/flags/count")}};var xo=class{constructor(o){this._options=K(o)}createPlanBundle(o,i){return R.fromPromise(this.__createPlanBundle(o,i))}async __createPlanBundle(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plan-bundles"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:qt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:hd.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/plan-bundles")}updatePlanBundle(o,i,a){return R.fromPromise(this.__updatePlanBundle(o,i,a))}async __updatePlanBundle(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plan-bundles/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:Dt.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:gd.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/plan-bundles/{plan_bundle_id}")}};var Eo=class{constructor(o){this._options=K(o)}getPlanGroup(o){return R.fromPromise(this.__getPlanGroup(o))}async __getPlanGroup(o){let i=await this._options.authProvider.getAuthRequest(),a=f(i.headers,this._options?.headers,o?.headers),n=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plan-groups"),method:"GET",headers:a,queryParameters:o?.queryParams,timeoutMs:(o?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:o?.maxRetries??this._options?.maxRetries,abortSignal:o?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(n.ok)return{data:fd.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.statusCode){case 401:throw new C(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);case 403:throw new P(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);case 404:throw new E(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);case 500:throw new x(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);default:throw new z({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse})}return U(n.error,n.rawResponse,"GET","/plan-groups")}createPlanGroup(o,i){return R.fromPromise(this.__createPlanGroup(o,i))}async __createPlanGroup(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plan-groups"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Mt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:bd.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/plan-groups")}updatePlanGroup(o,i,a){return R.fromPromise(this.__updatePlanGroup(o,i,a))}async __updatePlanGroup(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plan-groups/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:Ft.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:_d.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/plan-groups/{plan_group_id}")}};var Co=class{constructor(o){this._options=K(o)}updateCompanyPlans(o,i,a){return R.fromPromise(this.__updateCompanyPlans(o,i,a))}async __updateCompanyPlans(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`company-plans/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:Kt.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:kd.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/company-plans/{company_plan_id}")}listPlans(o={},i){return R.fromPromise(this.__listPlans(o,i))}async __listPlans(o={},i){let{companyId:a,forFallbackPlan:n,forInitialPlan:r,forTrialExpiryPlan:s,hasProductId:u,ids:g,planType:d,q:l,withoutEntitlementFor:m,withoutPaidProductId:y,limit:j,offset:b}=o,T={};a!=null&&(T.company_id=a),n!=null&&(T.for_fallback_plan=n.toString()),r!=null&&(T.for_initial_plan=r.toString()),s!=null&&(T.for_trial_expiry_plan=s.toString()),u!=null&&(T.has_product_id=u.toString()),g!=null&&(Array.isArray(g)?T.ids=g.map(pe=>pe):T.ids=g),d!=null&&(T.plan_type=ae.jsonOrThrow(d,{unrecognizedObjectKeys:"strip"})),l!=null&&(T.q=l),m!=null&&(T.without_entitlement_for=m),y!=null&&(T.without_paid_product_id=y.toString()),j!=null&&(T.limit=j.toString()),b!=null&&(T.offset=b.toString());let V=await this._options.authProvider.getAuthRequest(),H=f(V.headers,this._options?.headers,i?.headers),O=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plans"),method:"GET",headers:H,queryParameters:{...T,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(O.ok)return{data:jd.parseOrThrow(O.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:O.rawResponse};if(O.error.reason==="status-code")switch(O.error.statusCode){case 400:throw new v(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 401:throw new C(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 403:throw new P(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 404:throw new E(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 500:throw new x(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);default:throw new z({statusCode:O.error.statusCode,body:O.error.body,rawResponse:O.rawResponse})}return U(O.error,O.rawResponse,"GET","/plans")}createPlan(o,i){return R.fromPromise(this.__createPlan(o,i))}async __createPlan(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plans"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:$i.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:xd.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/plans")}getPlan(o,i){return R.fromPromise(this.__getPlan(o,i))}async __getPlan(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plans/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Cd.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/plans/{plan_id}")}updatePlan(o,i,a){return R.fromPromise(this.__updatePlan(o,i,a))}async __updatePlan(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plans/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:ro.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:Bd.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/plans/{plan_id}")}deletePlan(o,i){return R.fromPromise(this.__deletePlan(o,i))}async __deletePlan(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plans/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Ed.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/plans/{plan_id}")}upsertBillingProductPlan(o,i,a){return R.fromPromise(this.__upsertBillingProductPlan(o,i,a))}async __upsertBillingProductPlan(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plans/${w.encodePathParam(o)}/billing_products`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:Wr.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:Ad.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/plans/{plan_id}/billing_products")}countPlans(o={},i){return R.fromPromise(this.__countPlans(o,i))}async __countPlans(o={},i){let{companyId:a,forFallbackPlan:n,forInitialPlan:r,forTrialExpiryPlan:s,hasProductId:u,ids:g,planType:d,q:l,withoutEntitlementFor:m,withoutPaidProductId:y,limit:j,offset:b}=o,T={};a!=null&&(T.company_id=a),n!=null&&(T.for_fallback_plan=n.toString()),r!=null&&(T.for_initial_plan=r.toString()),s!=null&&(T.for_trial_expiry_plan=s.toString()),u!=null&&(T.has_product_id=u.toString()),g!=null&&(Array.isArray(g)?T.ids=g.map(pe=>pe):T.ids=g),d!=null&&(T.plan_type=ae.jsonOrThrow(d,{unrecognizedObjectKeys:"strip"})),l!=null&&(T.q=l),m!=null&&(T.without_entitlement_for=m),y!=null&&(T.without_paid_product_id=y.toString()),j!=null&&(T.limit=j.toString()),b!=null&&(T.offset=b.toString());let V=await this._options.authProvider.getAuthRequest(),H=f(V.headers,this._options?.headers,i?.headers),O=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plans/count"),method:"GET",headers:H,queryParameters:{...T,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(O.ok)return{data:Pd.parseOrThrow(O.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:O.rawResponse};if(O.error.reason==="status-code")switch(O.error.statusCode){case 400:throw new v(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 401:throw new C(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 403:throw new P(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 404:throw new E(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 500:throw new x(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);default:throw new z({statusCode:O.error.statusCode,body:O.error.body,rawResponse:O.rawResponse})}return U(O.error,O.rawResponse,"GET","/plans/count")}listPlanIssues(o,i){return R.fromPromise(this.__listPlanIssues(o,i))}async __listPlanIssues(o,i){let{planId:a}=o,n={};n.plan_id=a;let r=await this._options.authProvider.getAuthRequest(),s=f(r.headers,this._options?.headers,i?.headers),u=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plans/issues"),method:"GET",headers:s,queryParameters:{...n,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(u.ok)return{data:vd.parseOrThrow(u.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")switch(u.error.statusCode){case 400:throw new v(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 401:throw new C(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 403:throw new P(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 404:throw new E(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 500:throw new x(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);default:throw new z({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse})}return U(u.error,u.rawResponse,"GET","/plans/issues")}};var Uo=class{constructor(o){this._options=K(o)}listWebhookEvents(o={},i){return R.fromPromise(this.__listWebhookEvents(o,i))}async __listWebhookEvents(o={},i){let{ids:a,q:n,webhookId:r,limit:s,offset:u}=o,g={};a!=null&&(Array.isArray(a)?g.ids=a.map(y=>y):g.ids=a),n!=null&&(g.q=n),r!=null&&(g.webhook_id=r),s!=null&&(g.limit=s.toString()),u!=null&&(g.offset=u.toString());let d=await this._options.authProvider.getAuthRequest(),l=f(d.headers,this._options?.headers,i?.headers),m=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"webhook-events"),method:"GET",headers:l,queryParameters:{...g,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(m.ok)return{data:Nd.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new v(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 401:throw new C(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 403:throw new P(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 404:throw new E(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 500:throw new x(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new z({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return U(m.error,m.rawResponse,"GET","/webhook-events")}getWebhookEvent(o,i){return R.fromPromise(this.__getWebhookEvent(o,i))}async __getWebhookEvent(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`webhook-events/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Gd.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/webhook-events/{webhook_event_id}")}countWebhookEvents(o={},i){return R.fromPromise(this.__countWebhookEvents(o,i))}async __countWebhookEvents(o={},i){let{ids:a,q:n,webhookId:r,limit:s,offset:u}=o,g={};a!=null&&(Array.isArray(a)?g.ids=a.map(y=>y):g.ids=a),n!=null&&(g.q=n),r!=null&&(g.webhook_id=r),s!=null&&(g.limit=s.toString()),u!=null&&(g.offset=u.toString());let d=await this._options.authProvider.getAuthRequest(),l=f(d.headers,this._options?.headers,i?.headers),m=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"webhook-events/count"),method:"GET",headers:l,queryParameters:{...g,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(m.ok)return{data:qd.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new v(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 401:throw new C(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 403:throw new P(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 404:throw new E(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 500:throw new x(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new z({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return U(m.error,m.rawResponse,"GET","/webhook-events/count")}listWebhooks(o={},i){return R.fromPromise(this.__listWebhooks(o,i))}async __listWebhooks(o={},i){let{q:a,limit:n,offset:r}=o,s={};a!=null&&(s.q=a),n!=null&&(s.limit=n.toString()),r!=null&&(s.offset=r.toString());let u=await this._options.authProvider.getAuthRequest(),g=f(u.headers,this._options?.headers,i?.headers),d=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"webhooks"),method:"GET",headers:g,queryParameters:{...s,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(d.ok)return{data:$d.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:d.rawResponse};if(d.error.reason==="status-code")switch(d.error.statusCode){case 400:throw new v(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 401:throw new C(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 403:throw new P(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 404:throw new E(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 500:throw new x(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);default:throw new z({statusCode:d.error.statusCode,body:d.error.body,rawResponse:d.rawResponse})}return U(d.error,d.rawResponse,"GET","/webhooks")}createWebhook(o,i){return R.fromPromise(this.__createWebhook(o,i))}async __createWebhook(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"webhooks"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Gt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Fd.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/webhooks")}getWebhook(o,i){return R.fromPromise(this.__getWebhook(o,i))}async __getWebhook(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`webhooks/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Ld.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/webhooks/{webhook_id}")}updateWebhook(o,i={},a){return R.fromPromise(this.__updateWebhook(o,i,a))}async __updateWebhook(o,i={},a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`webhooks/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:Lt.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:Zd.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/webhooks/{webhook_id}")}deleteWebhook(o,i){return R.fromPromise(this.__deleteWebhook(o,i))}async __deleteWebhook(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`webhooks/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Id.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/webhooks/{webhook_id}")}countWebhooks(o={},i){return R.fromPromise(this.__countWebhooks(o,i))}async __countWebhooks(o={},i){let{q:a,limit:n,offset:r}=o,s={};a!=null&&(s.q=a),n!=null&&(s.limit=n.toString()),r!=null&&(s.offset=r.toString());let u=await this._options.authProvider.getAuthRequest(),g=f(u.headers,this._options?.headers,i?.headers),d=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"webhooks/count"),method:"GET",headers:g,queryParameters:{...s,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(d.ok)return{data:Md.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:d.rawResponse};if(d.error.reason==="status-code")switch(d.error.statusCode){case 400:throw new v(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 401:throw new C(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 403:throw new P(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 404:throw new E(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 500:throw new x(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);default:throw new z({statusCode:d.error.statusCode,body:d.error.body,rawResponse:d.rawResponse})}return U(d.error,d.rawResponse,"GET","/webhooks/count")}};var To=class{constructor(o){this._options=K(o)}get accounts(){return this._accounts??=new go(this._options)}get billing(){return this._billing??=new yo(this._options)}get credits(){return this._credits??=new Ro(this._options)}get checkout(){return this._checkout??=new wo(this._options)}get companies(){return this._companies??=new bo(this._options)}get entitlements(){return this._entitlements??=new _o(this._options)}get plans(){return this._plans??=new Co(this._options)}get components(){return this._components??=new zo(this._options)}get dataexports(){return this._dataexports??=new fo(this._options)}get events(){return this._events??=new So(this._options)}get features(){return this._features??=new Po(this._options)}get planbundle(){return this._planbundle??=new xo(this._options)}get plangroups(){return this._plangroups??=new Eo(this._options)}get accesstokens(){return this._accesstokens??=new ho(this._options)}get webhooks(){return this._webhooks??=new Uo(this._options)}putPlanAudiencesPlanAudienceId(o,i){return R.fromPromise(this.__putPlanAudiencesPlanAudienceId(o,i))}async __putPlanAudiencesPlanAudienceId(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plan-audiences/${w.encodePathParam(o)}`),method:"PUT",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:void 0,rawResponse:r.rawResponse};if(r.error.reason==="status-code")throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse});return U(r.error,r.rawResponse,"PUT","/plan-audiences/{plan_audience_id}")}deletePlanAudiencesPlanAudienceId(o,i){return R.fromPromise(this.__deletePlanAudiencesPlanAudienceId(o,i))}async __deletePlanAudiencesPlanAudienceId(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plan-audiences/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:void 0,rawResponse:r.rawResponse};if(r.error.reason==="status-code")throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse});return U(r.error,r.rawResponse,"DELETE","/plan-audiences/{plan_audience_id}")}};var Zr=class{error(o,...i){console.error(o,...i)}warn(o,...i){console.warn(o,...i)}info(o,...i){console.info(o,...i)}debug(o,...i){console.debug(o,...i)}};var Yh=1e3,Xh=1e3,eg=3,rg=1e3,vo=class{constructor(o,i){this.events=[];this.intervalId=null;this.shutdown=!1;this.stopped=!1;this.flushing=!1;let{logger:a=new Zr,maxSize:n=Xh,interval:r=Yh,offline:s=!1,maxRetries:u=eg,initialRetryDelay:g=rg}=i||{};this.eventsApi=o,this.interval=r,this.logger=a,this.maxSize=n,this.offline=s,this.maxRetries=u,this.initialRetryDelay=g,this.startPeriodicFlush()}async flush(){if(!(this.events.length===0||this.flushing)){this.flushing=!0;try{let o=[...this.events];this.events=[];let i=0,a=!1,n=null;for(;i<=this.maxRetries&&!a;)try{i>0&&this.logger.info(`Retrying event batch submission (attempt ${i} of ${this.maxRetries})`),await this.eventsApi.createEventBatch({events:o}),a=!0}catch(r){if(n=r,i++,i<=this.maxRetries){let s=this.initialRetryDelay*Math.pow(2,i-1),u=Math.random()*.1*s,g=s+u;this.logger.warn(`Event batch submission failed: ${r}. Retrying in ${(g/1e3).toFixed(2)} seconds...`),process.env.NODE_ENV!=="test"&&await new Promise(d=>setTimeout(d,g))}}a?i>0&&this.logger.info(`Event batch submission succeeded after ${i} retries`):this.logger.error(`Event batch submission failed after ${this.maxRetries} retries:`,n)}finally{this.flushing=!1}}}async push(o){if(!this.offline){if(this.stopped){this.logger.error("Event buffer is stopped, not accepting new events");return}this.events.length>=this.maxSize&&!this.flushing&&await this.flush(),this.events.push(o)}}async stop(){this.shutdown=!0,this.stopped=!0,this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null),await this.flush()}startPeriodicFlush(){this.offline||this.intervalId||(this.intervalId=setInterval(async()=>{this.shutdown||await this.flush()},this.interval))}};function Yd(p){return async function(i){let a={};if(p&&Object.assign(a,p),i.body!==void 0&&i.contentType!=null&&(a["Content-Type"]=i.contentType),i.headers!=null)for(let[u,g]of Object.entries(i.headers))g!=null&&typeof g=="string"&&(a[u]=g);let n=li(i.url,i.queryParameters),r=await ui({body:i.body,type:i.requestType==="json"?"json":"other"}),s=await pi();try{let u=await mi(async()=>di(s,n,i.method,a,r,i.timeoutMs,i.abortSignal,i.withCredentials,i.duplex),i.maxRetries),g=await wr(u,i.responseType),d=ei(u);return u.status>=200&&u.status<400?{ok:!0,body:g,headers:u.headers,rawResponse:d}:{ok:!1,error:{reason:"status-code",statusCode:u.status,body:g},rawResponse:d}}catch(u){return i.abortSignal!=null&&i.abortSignal.aborted?{ok:!1,error:{reason:"unknown",errorMessage:"The user aborted a request"},rawResponse:br}:u instanceof Error&&u.name==="AbortError"?{ok:!1,error:{reason:"timeout"},rawResponse:br}:u instanceof Error?{ok:!1,error:{reason:"unknown",errorMessage:u.message},rawResponse:zr}:{ok:!1,error:{reason:"unknown",errorMessage:JSON.stringify(u)},rawResponse:zr}}}}async function ig(p){return{ok:!0,body:{},headers:{"Content-Type":"application/json"},rawResponse:{headers:new je,redirected:!1,status:200,statusText:"OK",type:"basic",url:""}}}var Xd=ig;var Oo=class extends To{constructor(o){let{apiKey:i="",basePath:a,eventBufferInterval:n,flagDefaults:r={},logger:s=new Zr,timeoutMs:u}=o??{},{offline:g=!1}=o??{},d={};o?.environmentId&&(d["X-Schematic-Environment-Id"]=o.environmentId),o?.headers&&Object.assign(d,o.headers),g?i!==""&&s.debug("Offline mode enabled, ignoring API key"):i===""&&!g&&(s.warn("No API key was provided, running in offline mode"),g=!0),super({apiKey:i,environment:a,fetcher:g?Xd:Yd(d),timeoutInSeconds:u!==void 0?u/1e3:void 0}),this.logger=s,this.eventBuffer=new vo(this.events,{interval:n,logger:s,offline:g}),this.flagCheckCacheProviders=o?.cacheProviders?.flagChecks??[new hr],this.flagDefaults=r,this.offline=g}async checkFlag(o,i,a){let n=()=>a?.defaultValue===void 0?this.getFlagDefault(i):typeof a.defaultValue=="function"?a.defaultValue():a.defaultValue;if(this.offline)return this.logger.debug(`Offline mode enabled, returning default flag value for flag ${i}`),n();try{let r=JSON.stringify({evalCtx:o,key:i});for(let u of this.flagCheckCacheProviders){let g=await u.get(r);if(g!==void 0)return this.logger.debug(`${u.constructor.name} cache hit for flag ${i}`),g}let s=await this.features.checkFlag(i,o,{timeoutInSeconds:a?.timeoutMs!==void 0?a.timeoutMs/1e3:void 0});if(s.data.value===void 0)return this.logger.debug(`No value returned from feature flag API for flag ${i}, falling back to default`),n();for(let u of this.flagCheckCacheProviders)this.logger.debug(`Caching value for flag ${i} in ${u.constructor.name}`),await u.set(r,s.data.value);return this.logger.debug(`Feature flag API response for ${i}: ${JSON.stringify(s.data)}`),s.data.value}catch(r){return this.logger.error(`Error checking flag ${i}: ${r}`),n()}}async checkFlags(o,i){if(this.offline)return this.logger.debug(`Offline mode enabled, returning default flag values for flags ${i?i.join(", "):"all"}`),i&&i.length>0?i.map(a=>({flag:a,value:this.getFlagDefault(a),reason:"Offline mode - using default value"})):[];try{if(!i||i.length===0)return this.logger.debug("No specific flag keys provided, calling standard checkFlags API"),(await this.features.checkFlags(o)).data.flags;let a=new Map,n=[];for(let g of i){let d=JSON.stringify({evalCtx:o,key:g}),l=!1;for(let m of this.flagCheckCacheProviders){let y=await m.get(d);if(y!==void 0){this.logger.debug(`${m.constructor.name} cache hit for flag ${g}`),a.set(g,{flag:g,value:y,reason:"Retrieved from cache"}),l=!0;break}}l||n.push(g)}if(n.length===0)return this.logger.debug(`All ${i.length} flags found in cache`),i.map(g=>a.get(g));this.logger.debug(`Cache miss for ${n.length} flags: ${n.join(", ")}, calling API`);let s=(await this.features.checkFlags(o)).data.flags,u=[];for(let g of i){let d=s.find(l=>l.flag===g);if(d){let l=JSON.stringify({evalCtx:o,key:g});for(let m of this.flagCheckCacheProviders)this.logger.debug(`Caching value for flag ${l} in ${m.constructor.name}`),await m.set(l,d.value);u.push(d)}else{let l=a.get(g);if(l)u.push(l);else{this.logger.debug(`Flag ${g} not found in API response or cache, using default value`);let m={flag:g,value:this.getFlagDefault(g),reason:"Flag not found - using default value"};u.push(m)}}}return this.logger.debug(`Checked ${i.length} flags: used fresh API values for consistency (${n.length} were cache misses)`),u}catch(a){return this.logger.error(`Error checking flags ${i?i.join(", "):"all"}: ${a}`),i&&i.length>0?i.map(n=>({flag:n,value:this.getFlagDefault(n),reason:`Error occurred - using default value: ${a}`})):[]}}async close(){return this.eventBuffer.stop()}async identify(o){if(!this.offline)try{await this.enqueueEvent("identify",o)}catch(i){this.logger.error(`Error sending identify event: ${i}`)}}async track(o){if(!this.offline)try{await this.enqueueEvent("track",o)}catch(i){this.logger.error(`Error sending track event: ${i}`)}}setFlagDefault(o,i){this.flagDefaults[o]=i}setFlagDefaults(o){Object.assign(this.flagDefaults,o)}getFlagDefault(o){return this.flagDefaults[o]??!1}async enqueueEvent(o,i){try{this.eventBuffer.push({eventType:o,body:i,sentAt:new Date})}catch(a){this.logger.error(`Error enqueueing ${o} event: ${a}`)}}};var jo=Ao(require("crypto")),Yt="X-Schematic-Webhook-Signature",Xt="X-Schematic-Webhook-Timestamp",Ie=class p extends Error{constructor(o){super(o),Object.setPrototypeOf(this,p.prototype),this.name="WebhookSignatureError"}static missingSignature(){return new p("Missing webhook signature header")}static missingTimestamp(){return new p("Missing webhook timestamp header")}static invalidSignature(){return new p("Invalid webhook signature")}};function ko(p,o,i){let a=Buffer.isBuffer(p)?p:Buffer.from(p),n=Buffer.concat([a,Buffer.from(`+${o}`)]),r=jo.createHmac("sha256",i);return r.update(n),r.digest()}function rm(p,o,i){return ko(p,o,i).toString("hex")}function ea(p,o,i,a){if(!o)throw Ie.missingSignature();if(!i)throw Ie.missingTimestamp();let n;try{n=Buffer.from(o,"hex")}catch(s){throw new Ie(`Invalid signature format: ${s?.message||"Unknown error"}`)}let r=ko(p,i,a);if(n.length!==r.length||!jo.timingSafeEqual(n,r))throw Ie.invalidSignature()}function im(p,o,i,a={}){let n=p.headers,r=a.signatureHeader||Yt,s=a.timestampHeader||Xt,u=em(n,r),g=em(n,s),d;if(i!==void 0)d=i;else if("rawBody"in p&&p.rawBody)d=p.rawBody;else throw new Ie("Request body is not available. Provide the body as a parameter or ensure req.rawBody exists.");ea(d,u,g,o)}function em(p,o){let i=p[o]||p[o.toLowerCase()];return Array.isArray(i)?i[0]||"":i||""}0&&(module.exports={LocalCache,Schematic,SchematicClient,SchematicEnvironment,SchematicError,SchematicTimeoutError,WEBHOOK_SIGNATURE_HEADER,WEBHOOK_TIMESTAMP_HEADER,WebhookSignatureError,computeHexSignature,computeSignature,verifySignature,verifyWebhookSignature});
|
|
3
|
+
`)),{ok:!0,value:o}):a}}function gi(p){return p.path.length===0?p.message:`${p.path.join(" -> ")}: ${p.message}`}var Rr=class p extends Error{constructor(i){super(i.map(gi).join("; "));this.errors=i;Object.setPrototypeOf(this,p.prototype)}};var fr=class p extends Error{constructor(i){super(i.map(gi).join("; "));this.errors=i;Object.setPrototypeOf(this,p.prototype)}};function I(p){return{nullable:()=>Nh(p),optional:()=>Lo(p),optionalNullable:()=>Hh(p),transform:o=>Wo(p,o),parseOrThrow:(o,i)=>{let a=p.parse(o,i);if(a.ok)return a.value;throw new fr(a.errors)},jsonOrThrow:(o,i)=>{let a=p.json(o,i);if(a.ok)return a.value;throw new Rr(a.errors)}}}function Nh(p){let o={parse:(i,a)=>i==null?{ok:!0,value:null}:p.parse(i,a),json:(i,a)=>i==null?{ok:!0,value:null}:p.json(i,a),getType:()=>q.NULLABLE};return{...o,...I(o)}}function Lo(p){let o={parse:(i,a)=>i==null?{ok:!0,value:void 0}:p.parse(i,a),json:(i,a)=>a?.omitUndefined&&i===void 0?{ok:!0,value:void 0}:i==null?{ok:!0,value:null}:p.json(i,a),getType:()=>q.OPTIONAL};return{...o,...I(o)}}function Hh(p){let o={parse:(i,a)=>i===void 0?{ok:!0,value:void 0}:i===null?{ok:!0,value:null}:p.parse(i,a),json:(i,a)=>i===void 0?{ok:!0,value:void 0}:i===null?{ok:!0,value:null}:p.json(i,a),getType:()=>q.OPTIONAL_NULLABLE};return{...o,...I(o)}}function Wo(p,o){let i={parse:(a,n)=>{let r=p.parse(a,n);return r.ok?{ok:!0,value:o.transform(r.value)}:r},json:(a,n)=>{let r=o.untransform(a);return p.json(r,n)},getType:()=>p.getType()};return{...i,...I(i)}}function Fa(){let p={parse:(o,{breadcrumbsPrefix:i=[]}={})=>typeof o=="bigint"?{ok:!0,value:o}:typeof o=="number"?{ok:!0,value:BigInt(o)}:{ok:!1,errors:[{path:i,message:F(o,"bigint | number")}]},json:(o,{breadcrumbsPrefix:i=[]}={})=>typeof o!="bigint"?{ok:!1,errors:[{path:i,message:F(o,"bigint")}]}:{ok:!0,value:o},getType:()=>q.BIGINT};return{...ne(p),...I(p)}}var $h=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;function Ia(){let p={parse:(o,{breadcrumbsPrefix:i=[]}={})=>typeof o!="string"?{ok:!1,errors:[{path:i,message:F(o,"string")}]}:$h.test(o)?{ok:!0,value:new Date(o)}:{ok:!1,errors:[{path:i,message:F(o,"ISO 8601 date string")}]},json:(o,{breadcrumbsPrefix:i=[]}={})=>o instanceof Date?{ok:!0,value:o.toISOString()}:{ok:!1,errors:[{path:i,message:F(o,"Date object")}]},getType:()=>q.DATE};return{...ne(p),...I(p)}}function ce(p,o){return()=>{let i={parse:o,json:o,getType:()=>p};return{...ne(i),...I(i)}}}function yi(p){let o=new Set(p);return ce(q.ENUM,(a,{allowUnrecognizedEnumValues:n,breadcrumbsPrefix:r=[]}={})=>typeof a!="string"?{ok:!1,errors:[{path:r,message:F(a,"string")}]}:!o.has(a)&&!n?{ok:!1,errors:[{path:r,message:F(a,"enum")}]}:{ok:!0,value:a})()}function Ka(p){let o=No(p);return{...o,...I(o)}}function No(p){return{parse:(o,i)=>_r(p).parse(o,i),json:(o,i)=>_r(p).json(o,i),getType:()=>_r(p).getType()}}function _r(p){let o=p;return o.__zurg_memoized==null&&(o.__zurg_memoized=p()),o.__zurg_memoized}function ri(p){return Object.entries(p)}function ii(p,o){let i=new Set(o);return Object.entries(p).reduce((a,[n,r])=>(i.has(n)&&(a[n]=r),a),{})}function Ge(p){if(typeof p!="object"||p===null)return!1;if(Object.getPrototypeOf(p)===null)return!0;let o=p;for(;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return Object.getPrototypeOf(p)===o}function oi(p){return Object.keys(p)}function Ga(p,o){let i=[],a=[];for(let n of p)o(n)?i.push(n):a.push(n);return[i,a]}function ve(p){return{withParsedProperties:o=>Ho(p,o)}}function Ho(p,o){let i={parse:(a,n)=>{let r=p.parse(a,n);if(!r.ok)return r;let s=Object.entries(o).reduce((u,[g,d])=>({...u,[g]:typeof d=="function"?d(r.value):d}),{});return{ok:!0,value:{...r.value,...s}}},json:(a,n)=>{if(!Ge(a))return{ok:!1,errors:[{path:n?.breadcrumbsPrefix??[],message:F(a,"object")}]};let r=new Set(Object.keys(o)),s=ii(a,Object.keys(a).filter(u=>!r.has(u)));return p.json(s,n)},getType:()=>p.getType()};return{...i,...I(i),...ve(i)}}function La(p,o){return{rawKey:p,valueSchema:o,isProperty:!0}}function $e(p){return p.isProperty}function wi(p){let o={_getRawProperties:()=>Object.entries(p).map(([i,a])=>$e(a)?a.rawKey:i),_getParsedProperties:()=>oi(p),parse:(i,a)=>{let n={},r=[];for(let[s,u]of ri(p)){let g=$e(u)?u.rawKey:s,d=$e(u)?u.valueSchema:u,l={rawKey:g,parsedKey:s,valueSchema:d};n[g]=l,Ha(d)&&r.push(g)}return Wa({value:i,requiredKeys:r,getProperty:s=>{let u=n[s];if(u!=null)return{transformedKey:u.parsedKey,transform:g=>u.valueSchema.parse(g,{...a,breadcrumbsPrefix:[...a?.breadcrumbsPrefix??[],s]})}},unrecognizedObjectKeys:a?.unrecognizedObjectKeys,skipValidation:a?.skipValidation,breadcrumbsPrefix:a?.breadcrumbsPrefix,omitUndefined:a?.omitUndefined})},json:(i,a)=>{let n=[];for(let[r,s]of ri(p)){let u=$e(s)?s.valueSchema:s;Ha(u)&&n.push(r)}return Wa({value:i,requiredKeys:n,getProperty:r=>{let s=p[r];if(s!=null)return $e(s)?{transformedKey:s.rawKey,transform:u=>s.valueSchema.json(u,{...a,breadcrumbsPrefix:[...a?.breadcrumbsPrefix??[],r]})}:{transformedKey:r,transform:u=>s.json(u,{...a,breadcrumbsPrefix:[...a?.breadcrumbsPrefix??[],r]})}},unrecognizedObjectKeys:a?.unrecognizedObjectKeys,skipValidation:a?.skipValidation,breadcrumbsPrefix:a?.breadcrumbsPrefix,omitUndefined:a?.omitUndefined})},getType:()=>q.OBJECT};return{...ne(o),...I(o),...ve(o),...pr(o)}}function Wa({value:p,requiredKeys:o,getProperty:i,unrecognizedObjectKeys:a="fail",skipValidation:n=!1,breadcrumbsPrefix:r=[]}){if(!Ge(p))return{ok:!1,errors:[{path:r,message:F(p,"object")}]};let s=new Set(o),u=[],g={};for(let[d,l]of Object.entries(p)){let m=i(d);if(m!=null){s.delete(d);let y=m.transform(l);y.ok?g[m.transformedKey]=y.value:(g[d]=l,u.push(...y.errors))}else switch(a){case"fail":u.push({path:[...r,d],message:`Unexpected key "${d}"`});break;case"strip":break;case"passthrough":g[d]=l;break}}return u.push(...o.filter(d=>s.has(d)).map(d=>({path:r,message:`Missing required key "${d}"`}))),u.length===0||n?{ok:!0,value:g}:{ok:!1,errors:u}}function pr(p){return{extend:o=>{let i={_getParsedProperties:()=>[...p._getParsedProperties(),...o._getParsedProperties()],_getRawProperties:()=>[...p._getRawProperties(),...o._getRawProperties()],parse:(a,n)=>Na({extensionKeys:o._getRawProperties(),value:a,transformBase:r=>p.parse(r,n),transformExtension:r=>o.parse(r,n),breadcrumbsPrefix:n?.breadcrumbsPrefix}),json:(a,n)=>Na({extensionKeys:o._getParsedProperties(),value:a,transformBase:r=>p.json(r,n),transformExtension:r=>o.json(r,n),breadcrumbsPrefix:n?.breadcrumbsPrefix}),getType:()=>q.OBJECT};return{...i,...I(i),...ve(i),...pr(i)}},passthrough:()=>{let o={_getParsedProperties:()=>p._getParsedProperties(),_getRawProperties:()=>p._getRawProperties(),parse:(i,a)=>{let n=p.parse(i,{...a,unrecognizedObjectKeys:"passthrough"});return n.ok?{ok:!0,value:{...i,...n.value}}:n},json:(i,a)=>{let n=p.json(i,{...a,unrecognizedObjectKeys:"passthrough"});return n.ok?{ok:!0,value:{...i,...n.value}}:n},getType:()=>q.OBJECT};return{...o,...I(o),...ve(o),...pr(o)}}}}function Na({extensionKeys:p,value:o,transformBase:i,transformExtension:a,breadcrumbsPrefix:n=[]}){if(!Ge(o))return{ok:!1,errors:[{path:n,message:F(o,"object")}]};let r=new Set(p),[s,u]=Ga(oi(o),l=>r.has(l)),g=i(ii(o,u)),d=a(ii(o,s));return g.ok&&d.ok?{ok:!0,value:{...g.value,...d.value}}:{ok:!1,errors:[...g.ok?[]:g.errors,...d.ok?[]:d.errors]}}function Ha(p){return!Zh(p)}function Zh(p){switch(p.getType()){case q.ANY:case q.UNKNOWN:case q.OPTIONAL:case q.OPTIONAL_NULLABLE:return!0;default:return!1}}function $a(p){return wi(p)}function Za(p){let o={...No(p),_getRawProperties:()=>_r(p)._getRawProperties(),_getParsedProperties:()=>_r(p)._getParsedProperties()};return{...o,...I(o),...ve(o),...pr(o)}}function bi(p){let o={parse:(i,a)=>Ja(i,(n,r)=>p.parse(n,{...a,breadcrumbsPrefix:[...a?.breadcrumbsPrefix??[],`[${r}]`]})),json:(i,a)=>Ja(i,(n,r)=>p.json(n,{...a,breadcrumbsPrefix:[...a?.breadcrumbsPrefix??[],`[${r}]`]})),getType:()=>q.LIST};return{...ne(o),...I(o)}}function Ja(p,o){return Array.isArray(p)?p.map((a,n)=>o(a,n)).reduce((a,n)=>{if(a.ok&&n.ok)return{ok:!0,value:[...a.value,n.value]};let r=[];return a.ok||r.push(...a.errors),n.ok||r.push(...n.errors),{ok:!1,errors:r}},{ok:!0,value:[]}):{ok:!1,errors:[{message:F(p,"list"),path:[]}]}}function Qa(p){return ce(q.BOOLEAN_LITERAL,(i,{breadcrumbsPrefix:a=[]}={})=>i===p?{ok:!0,value:p}:{ok:!1,errors:[{path:a,message:F(i,`${p.toString()}`)}]})()}function Ya(p){return ce(q.STRING_LITERAL,(i,{breadcrumbsPrefix:a=[]}={})=>i===p?{ok:!0,value:p}:{ok:!1,errors:[{path:a,message:F(i,`"${p}"`)}]})()}var Xa=ce(q.ANY,p=>({ok:!0,value:p}));var es=ce(q.BOOLEAN,(p,{breadcrumbsPrefix:o=[]}={})=>typeof p=="boolean"?{ok:!0,value:p}:{ok:!1,errors:[{path:o,message:F(p,"boolean")}]});var rs=ce(q.NEVER,(p,{breadcrumbsPrefix:o=[]}={})=>({ok:!1,errors:[{path:o,message:"Expected never"}]}));var is=ce(q.NUMBER,(p,{breadcrumbsPrefix:o=[]}={})=>typeof p=="number"?{ok:!0,value:p}:{ok:!1,errors:[{path:o,message:F(p,"number")}]});var os=ce(q.STRING,(p,{breadcrumbsPrefix:o=[]}={})=>typeof p=="string"?{ok:!0,value:p}:{ok:!1,errors:[{path:o,message:F(p,"string")}]});var ts=ce(q.UNKNOWN,p=>({ok:!0,value:p}));function ss(p,o){let i={parse:(a,n)=>as({value:a,isKeyNumeric:p.getType()===q.NUMBER,transformKey:r=>p.parse(r,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${r} (key)`]}),transformValue:(r,s)=>o.parse(r,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:n?.breadcrumbsPrefix}),json:(a,n)=>as({value:a,isKeyNumeric:p.getType()===q.NUMBER,transformKey:r=>p.json(r,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${r} (key)`]}),transformValue:(r,s)=>o.json(r,{...n,breadcrumbsPrefix:[...n?.breadcrumbsPrefix??[],`${s}`]}),breadcrumbsPrefix:n?.breadcrumbsPrefix}),getType:()=>q.RECORD};return{...ne(i),...I(i)}}function as({value:p,isKeyNumeric:o,transformKey:i,transformValue:a,breadcrumbsPrefix:n=[]}){return Ge(p)?ri(p).reduce((r,[s,u])=>{if(u===void 0)return r;let g=r,d=s;if(o){let j=s.length>0?Number(s):NaN;Number.isNaN(j)||(d=j)}let l=i(d),m=a(u,d);if(g.ok&&l.ok&&m.ok)return{ok:!0,value:{...g.value,[l.value]:m.value}};let y=[];return g.ok||y.push(...g.errors),l.ok||y.push(...l.errors),m.ok||y.push(...m.errors),{ok:!1,errors:y}},{ok:!0,value:{}}):{ok:!1,errors:[{path:n,message:F(p,"object")}]}}function ns(p){let o=bi(p),i={parse:(a,n)=>{let r=o.parse(a,n);return r.ok?{ok:!0,value:new Set(r.value)}:r},json:(a,n)=>a instanceof Set?o.json([...a],n):{ok:!1,errors:[{path:n?.breadcrumbsPrefix??[],message:F(a,"Set")}]},getType:()=>q.SET};return{...ne(i),...I(i)}}function ls(p){let o={parse:(i,a)=>cs((n,r)=>n.parse(i,r),p,a),json:(i,a)=>cs((n,r)=>n.json(i,r),p,a),getType:()=>q.UNDISCRIMINATED_UNION};return{...ne(o),...I(o)}}function cs(p,o,i){let a=[];for(let[n,r]of o.entries()){let s=p(r,{...i,skipValidation:!1});if(s.ok)return s;for(let u of s.errors)a.push({path:u.path,message:`[Variant ${n}] ${u.message}`})}return{ok:!1,errors:a}}function ps(p,o){return{parsedDiscriminant:p,rawDiscriminant:o}}function ds(p,o){let i=typeof p=="string"?p:p.rawDiscriminant,a=typeof p=="string"?p:p.parsedDiscriminant,n=yi(oi(o)),r={parse:(s,u)=>us({value:s,discriminant:i,transformedDiscriminant:a,transformDiscriminantValue:g=>n.parse(g,{allowUnrecognizedEnumValues:u?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...u?.breadcrumbsPrefix??[],i]}),getAdditionalPropertiesSchema:g=>o[g],allowUnrecognizedUnionMembers:u?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(g,d)=>d.parse(g,u),breadcrumbsPrefix:u?.breadcrumbsPrefix}),json:(s,u)=>us({value:s,discriminant:a,transformedDiscriminant:i,transformDiscriminantValue:g=>n.json(g,{allowUnrecognizedEnumValues:u?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...u?.breadcrumbsPrefix??[],a]}),getAdditionalPropertiesSchema:g=>o[g],allowUnrecognizedUnionMembers:u?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(g,d)=>d.json(g,u),breadcrumbsPrefix:u?.breadcrumbsPrefix}),getType:()=>q.UNION};return{...ne(r),...I(r),...ve(r)}}function us({value:p,discriminant:o,transformedDiscriminant:i,transformDiscriminantValue:a,getAdditionalPropertiesSchema:n,allowUnrecognizedUnionMembers:r=!1,transformAdditionalProperties:s,breadcrumbsPrefix:u=[]}){if(!Ge(p))return{ok:!1,errors:[{path:u,message:F(p,"object")}]};let{[o]:g,...d}=p;if(g==null)return{ok:!1,errors:[{path:u,message:`Missing discriminant ("${o}")`}]};let l=a(g);if(!l.ok)return{ok:!1,errors:l.errors};let m=n(l.value);if(m==null)return r?{ok:!0,value:{[i]:l.value,...d}}:{ok:!1,errors:[{path:[...u,o],message:"Unexpected discriminant value"}]};let y=s(d,m);return y.ok?{ok:!0,value:{[i]:g,...y.value}}:y}var w={};Ke(w,{encodePathParam:()=>ms,join:()=>gs,toQueryString:()=>yr});function ms(p){if(p===null)return"null";switch(typeof p){case"undefined":return"undefined";case"string":case"number":case"boolean":break;default:p=String(p);break}return encodeURIComponent(p)}function gs(p,...o){if(!p)return"";if(o.length===0)return p;if(p.includes("://")){let i;try{i=new URL(p)}catch{return hs(p,...o)}let n=o[o.length-1]?.endsWith("/");for(let r of o){let s=ws(r);s&&(i.pathname=ys(i.pathname,s))}return n&&!i.pathname.endsWith("/")&&(i.pathname+="/"),i.toString()}return hs(p,...o)}function hs(p,...o){if(o.length===0)return p;let i=p,n=o[o.length-1]?.endsWith("/");for(let r of o){let s=ws(r);s&&(i=ys(i,s))}return n&&!i.endsWith("/")&&(i+="/"),i}function ys(p,o){return p.endsWith("/")?p+o:`${p}/${o}`}function ws(p){if(!p)return p;let o=0,i=p.length;return p.startsWith("/")&&(o=1),p.endsWith("/")&&(i=p.length-1),o===0&&i===p.length?p:p.slice(o,i)}var zi=class{constructor(o){this.headerValue=o.apiKey}static canCreate(o){return o.apiKey!=null}async getAuthRequest(o){let i=await h.get(this.headerValue);if(i==null)throw new z({message:"Please specify a apiKey by passing it in to the constructor"});return{headers:{"X-Schematic-Api-Key":i}}}};function f(...p){let o={};for(let[i,a]of p.filter(n=>n!=null).flatMap(n=>Object.entries(n))){let n=i.toLowerCase();a!=null?o[n]=a:n in o&&delete o[n]}return o}function Jh(p){let o=f({"X-Fern-Language":"JavaScript","X-Fern-SDK-Name":"@schematichq/schematic-typescript-node","X-Fern-SDK-Version":"1.3.1","User-Agent":"@schematichq/schematic-typescript-node/1.3.1","X-Fern-Runtime":he.type,"X-Fern-Runtime-Version":he.version},p?.headers);return{...p,logging:hi.createLogger(p?.logging),headers:o}}function K(p){let o=Jh(p),i=Qh(o);return o.authProvider??=new zi(i),o}function Qh(p){return{...p,authProvider:new Yr}}var _={Default:"https://api.schematichq.com"};function U(p,o,i,a){switch(p.reason){case"non-json":throw new z({statusCode:p.statusCode,body:p.rawBody,rawResponse:o});case"body-is-null":throw new z({statusCode:p.statusCode,rawResponse:o});case"timeout":throw new cr(`Timeout exceeded when calling ${i} ${a}.`);case"unknown":throw new z({message:p.errorMessage,rawResponse:o});default:throw new z({message:"Unknown error",rawResponse:o})}}var $o=e.object({lookup:e.record(e.string(),e.string())});var bs=e.stringLiteral("company");var zs=e.object({apiKeyId:e.property("api_key_id",e.string()),createdAt:e.property("created_at",e.date()),environmentId:e.property("environment_id",e.string()),expiredAt:e.property("expired_at",e.date()),id:e.string(),resourceType:e.property("resource_type",bs),token:e.string(),updatedAt:e.property("updated_at",e.date())});var Rs=e.object({data:zs,params:e.record(e.string(),e.unknown())});var Zo=e.object({description:e.string().optional(),environmentId:e.property("environment_id",e.string().optional()),name:e.string()});var Ze=e.enum_(["development","production","staging"]);var Jo=e.object({environmentType:e.property("environment_type",Ze),name:e.string()});var Qo=e.object({description:e.string().optional(),name:e.string().optional()});var Yo=e.object({environmentType:e.property("environment_type",Ze.optional()),name:e.string().optional()});var fs=e.object({environmentId:e.property("environment_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),requireEnvironment:e.property("require_environment",e.boolean().optional())});var A=e.object({count:e.number().optional()});var _s=e.object({data:A,params:fs});var Ss=e.object({environmentId:e.property("environment_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional(),requestType:e.property("request_type",e.string().optional())});var Ps=e.object({data:A,params:Ss});var Ri=e.enum_(["admin","capture","read","write"]);var xs=e.object({createdAt:e.property("created_at",e.date()),description:e.string().optional(),environmentId:e.property("environment_id",e.string().optional()),id:e.string(),lastUsedAt:e.property("last_used_at",e.date().optional()),name:e.string(),scopes:e.list(Ri),secret:e.string(),updatedAt:e.property("updated_at",e.date())});var Es=e.object({data:xs,params:e.record(e.string(),e.unknown())});var Re=e.object({createdAt:e.property("created_at",e.date()),description:e.string().optional(),environmentId:e.property("environment_id",e.string().optional()),id:e.string(),lastUsedAt:e.property("last_used_at",e.date().optional()),name:e.string(),scopes:e.list(Ri),updatedAt:e.property("updated_at",e.date())});var Cs=e.object({apiKeys:e.property("api_keys",e.list(Re)),createdAt:e.property("created_at",e.date()),environmentType:e.property("environment_type",Ze),id:e.string(),name:e.string(),updatedAt:e.property("updated_at",e.date())});var Us=e.object({data:Cs,params:e.record(e.string(),e.unknown())});var D=e.object({deleted:e.boolean().optional()});var Ts=e.object({data:D,params:e.record(e.string(),e.unknown())});var vs=e.object({data:D,params:e.record(e.string(),e.unknown())});var Os=e.object({data:Re,params:e.record(e.string(),e.unknown())});var js=e.object({apiKey:e.property("api_key",Re.optional()),apiKeyId:e.property("api_key_id",e.string()),endedAt:e.property("ended_at",e.date().optional()),environmentId:e.property("environment_id",e.string().optional()),id:e.string(),method:e.string(),reqBody:e.property("req_body",e.string().optional()),requestType:e.property("request_type",e.string().optional()),resourceId:e.property("resource_id",e.number().optional()),resourceIdString:e.property("resource_id_string",e.string().optional()),resourceName:e.property("resource_name",e.string().optional()),resourceType:e.property("resource_type",e.string().optional()),respBody:e.property("resp_body",e.string().optional()),respCode:e.property("resp_code",e.number().optional()),secondaryResource:e.property("secondary_resource",e.string().optional()),startedAt:e.property("started_at",e.date()),url:e.string(),userAgent:e.property("user_agent",e.string().optional()),userId:e.property("user_id",e.string().optional()),userName:e.property("user_name",e.string().optional())});var ks=e.object({data:js,params:e.record(e.string(),e.unknown())});var Sr=e.object({createdAt:e.property("created_at",e.date()),environmentType:e.property("environment_type",Ze),id:e.string(),name:e.string(),updatedAt:e.property("updated_at",e.date())});var Bs=e.object({data:Sr,params:e.record(e.string(),e.unknown())});var As=e.object({environmentId:e.property("environment_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),requireEnvironment:e.property("require_environment",e.boolean().optional())});var Vs=e.object({data:e.list(Re),params:As});var qs=e.object({environmentId:e.property("environment_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional(),requestType:e.property("request_type",e.string().optional())});var fi=e.object({apiKeyId:e.property("api_key_id",e.string()),endedAt:e.property("ended_at",e.date().optional()),environmentId:e.property("environment_id",e.string().optional()),id:e.string(),method:e.string(),reqBody:e.property("req_body",e.string().optional()),requestType:e.property("request_type",e.string().optional()),resourceId:e.property("resource_id",e.number().optional()),resourceIdString:e.property("resource_id_string",e.string().optional()),resourceName:e.property("resource_name",e.string().optional()),resourceType:e.property("resource_type",e.string().optional()),respCode:e.property("resp_code",e.number().optional()),secondaryResource:e.property("secondary_resource",e.string().optional()),startedAt:e.property("started_at",e.date()),url:e.string(),userName:e.property("user_name",e.string().optional())});var Ds=e.object({data:e.list(fi),params:qs});var Ms=e.object({ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional()});var Fs=e.object({data:e.list(Sr),params:Ms});var Is=e.object({ok:e.boolean()});var Ks=e.object({data:Is,params:e.record(e.string(),e.unknown())});var Gs=e.object({data:Re,params:e.record(e.string(),e.unknown())});var Ls=e.object({data:Sr,params:e.record(e.string(),e.unknown())});var B=e.enum_(["schematic","stripe"]);var Xo=e.object({companyId:e.property("company_id",e.string().optional()),defaultPaymentMethodId:e.property("default_payment_method_id",e.string().optional()),email:e.string(),externalId:e.property("external_id",e.string()),meta:e.record(e.string(),e.string()),name:e.string(),providerType:e.property("provider_type",B.optional())});var ke=e.enum_(["per_unit","tiered"]);var Z=e.enum_(["licensed","metered"]);var ie=e.enum_(["graduated","volume"]);var Ws=e.object({flatAmount:e.property("flat_amount",e.number().optional()),perUnitDecimal:e.property("per_unit_decimal",e.string().optional()),perUnitPrice:e.property("per_unit_price",e.number().optional()),priceExternalId:e.property("price_external_id",e.string()),providerType:e.property("provider_type",B.optional()),upTo:e.property("up_to",e.number().optional())});var et=e.object({billingScheme:e.property("billing_scheme",ke),currency:e.string(),externalAccountId:e.property("external_account_id",e.string()),interval:e.string(),isActive:e.property("is_active",e.boolean()),meterId:e.property("meter_id",e.string().optional()),packageSize:e.property("package_size",e.number().optional()),price:e.number(),priceDecimal:e.property("price_decimal",e.string().optional()),priceExternalId:e.property("price_external_id",e.string()),priceTiers:e.property("price_tiers",e.list(Ws)),productExternalId:e.property("product_external_id",e.string()),providerType:e.property("provider_type",B.optional()),tiersMode:e.property("tiers_mode",ie.optional()),usageType:e.property("usage_type",Z)});var rt=e.object({externalId:e.property("external_id",e.string()),isActive:e.property("is_active",e.boolean().optional()),name:e.string(),price:e.number(),providerType:e.property("provider_type",B.optional())});var Ns=e.object({billingThreshold:e.property("billing_threshold",e.number().optional()),currency:e.string(),interval:e.string(),meterId:e.property("meter_id",e.string().optional()),packageSize:e.property("package_size",e.number().optional()),price:e.number(),priceDecimal:e.property("price_decimal",e.string().optional()),priceExternalId:e.property("price_external_id",e.string()),productExternalId:e.property("product_external_id",e.string()),quantity:e.number(),subscriptionItemExternalId:e.property("subscription_item_external_id",e.string().optional()),usageType:e.property("usage_type",Z)});var Hs=e.object({couponExternalId:e.property("coupon_external_id",e.string()),customerFacingCode:e.property("customer_facing_code",e.string().optional()),endedAt:e.property("ended_at",e.date().optional()),externalId:e.property("external_id",e.string()),isActive:e.property("is_active",e.boolean()),promoCodeExternalId:e.property("promo_code_external_id",e.string().optional()),startedAt:e.property("started_at",e.date())});var Je=e.enum_(["cancel","subscribe"]);var it=e.object({applicationId:e.property("application_id",e.string().optional()),cancelAt:e.property("cancel_at",e.number().optional()),cancelAtPeriodEnd:e.property("cancel_at_period_end",e.boolean()),currency:e.string(),customerExternalId:e.property("customer_external_id",e.string()),defaultPaymentMethodExternalId:e.property("default_payment_method_external_id",e.string().optional()),defaultPaymentMethodId:e.property("default_payment_method_id",e.string().optional()),discounts:e.list(Hs),expiredAt:e.property("expired_at",e.date()),interval:e.string().optional(),metadata:e.record(e.string(),e.unknown()).optional(),periodEnd:e.property("period_end",e.number().optional()),periodStart:e.property("period_start",e.number().optional()),productExternalIds:e.property("product_external_ids",e.list(Ns)),status:e.string().optional(),subscriptionExternalId:e.property("subscription_external_id",e.string()),totalPrice:e.property("total_price",e.number()),trialEnd:e.property("trial_end",e.number().optional()),trialEndSetting:e.property("trial_end_setting",Je.optional())});var ot=e.object({amountOff:e.property("amount_off",e.number()),currency:e.string().optional(),duration:e.string(),durationInMonths:e.property("duration_in_months",e.number()),externalId:e.property("external_id",e.string()),maxRedemptions:e.property("max_redemptions",e.number()),name:e.string(),percentOff:e.property("percent_off",e.number()),timesRedeemed:e.property("times_redeemed",e.number())});var tt=e.object({amountDue:e.property("amount_due",e.number()),amountPaid:e.property("amount_paid",e.number()),amountRemaining:e.property("amount_remaining",e.number()),collectionMethod:e.property("collection_method",e.string()),currency:e.string(),customerExternalId:e.property("customer_external_id",e.string()),dueDate:e.property("due_date",e.date().optional()),externalId:e.property("external_id",e.string().optional()),paymentMethodExternalId:e.property("payment_method_external_id",e.string().optional()),subscriptionExternalId:e.property("subscription_external_id",e.string().optional()),subtotal:e.number(),url:e.string().optional()});var at=e.object({displayName:e.property("display_name",e.string()),eventName:e.property("event_name",e.string()),eventPayloadKey:e.property("event_payload_key",e.string()),externalId:e.property("external_id",e.string())});var st=e.object({accountLast4:e.property("account_last4",e.string().optional()),accountName:e.property("account_name",e.string().optional()),bankName:e.property("bank_name",e.string().optional()),billingEmail:e.property("billing_email",e.string().optional()),billingName:e.property("billing_name",e.string().optional()),cardBrand:e.property("card_brand",e.string().optional()),cardExpMonth:e.property("card_exp_month",e.number().optional()),cardExpYear:e.property("card_exp_year",e.number().optional()),cardLast4:e.property("card_last4",e.string().optional()),customerExternalId:e.property("customer_external_id",e.string()),externalId:e.property("external_id",e.string()),paymentMethodType:e.property("payment_method_type",e.string())});var $s=e.object({ids:e.list(e.string()).optional(),isActive:e.property("is_active",e.boolean().optional()),limit:e.number().optional(),name:e.string().optional(),offset:e.number().optional(),priceUsageType:e.property("price_usage_type",Z.optional()),providerType:e.property("provider_type",B.optional()),q:e.string().optional(),withOneTimeCharges:e.property("with_one_time_charges",e.boolean().optional()),withPricesOnly:e.property("with_prices_only",e.boolean().optional()),withZeroPrice:e.property("with_zero_price",e.boolean().optional()),withoutLinkedToPlan:e.property("without_linked_to_plan",e.boolean().optional())});var Zs=e.object({data:A,params:$s});var Js=e.object({companyIds:e.property("company_ids",e.list(e.string()).optional()),limit:e.number().optional(),name:e.string().optional(),offset:e.number().optional(),providerType:e.property("provider_type",B.optional()),q:e.string().optional()});var Qs=e.object({data:A,params:Js});var Ys=e.object({data:D,params:e.record(e.string(),e.unknown())});var Xs=e.object({data:D,params:e.record(e.string(),e.unknown())});var en=e.object({forInitialPlan:e.property("for_initial_plan",e.boolean().optional()),forTrialExpiryPlan:e.property("for_trial_expiry_plan",e.boolean().optional()),ids:e.list(e.string()).optional(),interval:e.string().optional(),isActive:e.property("is_active",e.boolean().optional()),limit:e.number().optional(),offset:e.number().optional(),price:e.number().optional(),productId:e.property("product_id",e.string().optional()),productIds:e.property("product_ids",e.list(e.string()).optional()),providerType:e.property("provider_type",B.optional()),q:e.string().optional(),tiersMode:e.property("tiers_mode",ie.optional()),usageType:e.property("usage_type",Z.optional()),withMeter:e.property("with_meter",e.boolean().optional())});var Pr=e.enum_(["day","month","one-time","year"]);var _i=e.object({flatAmount:e.property("flat_amount",e.number().optional()),perUnitPrice:e.property("per_unit_price",e.number().optional()),perUnitPriceDecimal:e.property("per_unit_price_decimal",e.string().optional()),upTo:e.property("up_to",e.number().optional())});var J=e.object({billingScheme:e.property("billing_scheme",ke),createdAt:e.property("created_at",e.date()),currency:e.string(),id:e.string(),interval:Pr,isActive:e.property("is_active",e.boolean()),meterEventName:e.property("meter_event_name",e.string().optional()),meterEventPayloadKey:e.property("meter_event_payload_key",e.string().optional()),meterId:e.property("meter_id",e.string().optional()),packageSize:e.property("package_size",e.number()),price:e.number(),priceDecimal:e.property("price_decimal",e.string().optional()),priceExternalId:e.property("price_external_id",e.string()),priceId:e.property("price_id",e.string()),priceTier:e.property("price_tier",e.list(_i)),productExternalId:e.property("product_external_id",e.string()),productId:e.property("product_id",e.string()),productName:e.property("product_name",e.string()),providerType:e.property("provider_type",B),tiersMode:e.property("tiers_mode",ie.optional()),updatedAt:e.property("updated_at",e.date()),usageType:e.property("usage_type",Z)});var rn=e.object({data:e.list(J),params:en});var on=e.object({forInitialPlan:e.property("for_initial_plan",e.boolean().optional()),forTrialExpiryPlan:e.property("for_trial_expiry_plan",e.boolean().optional()),ids:e.list(e.string()).optional(),interval:e.string().optional(),isActive:e.property("is_active",e.boolean().optional()),limit:e.number().optional(),offset:e.number().optional(),price:e.number().optional(),productId:e.property("product_id",e.string().optional()),productIds:e.property("product_ids",e.list(e.string()).optional()),providerType:e.property("provider_type",B.optional()),q:e.string().optional(),tiersMode:e.property("tiers_mode",ie.optional()),usageType:e.property("usage_type",Z.optional()),withMeter:e.property("with_meter",e.boolean().optional())});var tn=e.object({data:e.list(J),params:on});var an=e.object({ids:e.list(e.string()).optional(),isActive:e.property("is_active",e.boolean().optional()),limit:e.number().optional(),name:e.string().optional(),offset:e.number().optional(),priceUsageType:e.property("price_usage_type",Z.optional()),providerType:e.property("provider_type",B.optional()),q:e.string().optional(),withOneTimeCharges:e.property("with_one_time_charges",e.boolean().optional()),withPricesOnly:e.property("with_prices_only",e.boolean().optional()),withZeroPrice:e.property("with_zero_price",e.boolean().optional()),withoutLinkedToPlan:e.property("without_linked_to_plan",e.boolean().optional())});var Q=e.object({currency:e.string(),externalPriceId:e.property("external_price_id",e.string()),id:e.string(),interval:Pr,price:e.number(),priceDecimal:e.property("price_decimal",e.string().optional()),providerType:e.property("provider_type",B),scheme:ke});var Qe=e.object({accountId:e.property("account_id",e.string()),createdAt:e.property("created_at",e.date()),currency:e.string().optional(),environmentId:e.property("environment_id",e.string()),externalId:e.property("external_id",e.string()),isActive:e.property("is_active",e.boolean()),name:e.string(),price:e.number(),priceDecimal:e.property("price_decimal",e.string().optional()),prices:e.list(Q),productId:e.property("product_id",e.string()),providerType:e.property("provider_type",B),quantity:e.number(),subscriptionCount:e.property("subscription_count",e.number()),updatedAt:e.property("updated_at",e.date())});var sn=e.object({data:e.list(Qe),params:an});var nn=e.object({isActive:e.property("is_active",e.boolean().optional()),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var Si=e.object({accountId:e.property("account_id",e.string()),amountOff:e.property("amount_off",e.number().optional()),currency:e.string().optional(),duration:e.string().optional(),durationInMonths:e.property("duration_in_months",e.number().optional()),environmentId:e.property("environment_id",e.string()),externalId:e.property("external_id",e.string()),id:e.string(),isActive:e.property("is_active",e.boolean()),maxRedemptions:e.property("max_redemptions",e.number().optional()),metadata:e.record(e.string(),e.unknown()),name:e.string(),percentOff:e.property("percent_off",e.number().optional()),providerType:e.property("provider_type",B),timesRedeemed:e.property("times_redeemed",e.number()),validFrom:e.property("valid_from",e.date().optional()),validUntil:e.property("valid_until",e.date().optional())});var cn=e.object({data:e.list(Si),params:nn});var ln=e.object({companyIds:e.property("company_ids",e.list(e.string()).optional()),limit:e.number().optional(),name:e.string().optional(),offset:e.number().optional(),providerType:e.property("provider_type",B.optional()),q:e.string().optional()});var pn=e.object({currency:e.string(),expiredAt:e.property("expired_at",e.date().optional()),interval:e.string(),meteredUsage:e.property("metered_usage",e.boolean()),perUnitPrice:e.property("per_unit_price",e.number()),totalPrice:e.property("total_price",e.number())});var un=e.object({companyId:e.property("company_id",e.string().optional()),deletedAt:e.property("deleted_at",e.date().optional()),email:e.string(),externalId:e.property("external_id",e.string()),id:e.string(),name:e.string(),providerType:e.property("provider_type",B),subscriptions:e.list(pn),updatedAt:e.property("updated_at",e.date())});var dn=e.object({data:e.list(un),params:ln});var mn=e.object({companyId:e.property("company_id",e.string().optional()),customerExternalId:e.property("customer_external_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),subscriptionExternalId:e.property("subscription_external_id",e.string().optional())});var Oe=e.object({amountDue:e.property("amount_due",e.number()),amountPaid:e.property("amount_paid",e.number()),amountRemaining:e.property("amount_remaining",e.number()),collectionMethod:e.property("collection_method",e.string()),companyId:e.property("company_id",e.string().optional()),createdAt:e.property("created_at",e.date()),currency:e.string(),customerExternalId:e.property("customer_external_id",e.string()),dueDate:e.property("due_date",e.date().optional()),environmentId:e.property("environment_id",e.string()),externalId:e.property("external_id",e.string().optional()),id:e.string(),paymentMethodExternalId:e.property("payment_method_external_id",e.string().optional()),providerType:e.property("provider_type",B),subscriptionExternalId:e.property("subscription_external_id",e.string().optional()),subtotal:e.number(),updatedAt:e.property("updated_at",e.date()),url:e.string().optional()});var hn=e.object({data:e.list(Oe),params:mn});var gn=e.object({displayName:e.property("display_name",e.string().optional()),limit:e.number().optional(),offset:e.number().optional()});var Pi=e.object({dispalyName:e.property("dispaly_name",e.string()),eventName:e.property("event_name",e.string()),eventPayloadKey:e.property("event_payload_key",e.string()),externalPriceId:e.property("external_price_id",e.string()),id:e.string(),providerType:e.property("provider_type",B)});var yn=e.object({data:e.list(Pi),params:gn});var wn=e.object({companyId:e.property("company_id",e.string().optional()),customerExternalId:e.property("customer_external_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional()});var ge=e.object({accountLast4:e.property("account_last4",e.string().optional()),accountName:e.property("account_name",e.string().optional()),bankName:e.property("bank_name",e.string().optional()),billingEmail:e.property("billing_email",e.string().optional()),billingName:e.property("billing_name",e.string().optional()),cardBrand:e.property("card_brand",e.string().optional()),cardExpMonth:e.property("card_exp_month",e.number().optional()),cardExpYear:e.property("card_exp_year",e.number().optional()),cardLast4:e.property("card_last4",e.string().optional()),companyId:e.property("company_id",e.string().optional()),createdAt:e.property("created_at",e.date()),customerExternalId:e.property("customer_external_id",e.string()),environmentId:e.property("environment_id",e.string()),externalId:e.property("external_id",e.string()),id:e.string(),paymentMethodType:e.property("payment_method_type",e.string()),providerType:e.property("provider_type",B),updatedAt:e.property("updated_at",e.date())});var bn=e.object({data:e.list(ge),params:wn});var zn=e.object({data:Si,params:e.record(e.string(),e.unknown())});var Rn=e.object({companyId:e.property("company_id",e.string().optional()),deletedAt:e.property("deleted_at",e.date().optional()),email:e.string(),externalId:e.property("external_id",e.string()),id:e.string(),name:e.string(),providerType:e.property("provider_type",B),updatedAt:e.property("updated_at",e.date())});var fn=e.object({data:Rn,params:e.record(e.string(),e.unknown())});var _n=e.object({data:Pi,params:e.record(e.string(),e.unknown())});var Sn=e.object({data:Q,params:e.record(e.string(),e.unknown())});var xr=e.object({accountId:e.property("account_id",e.string()),createdAt:e.property("created_at",e.date()),currency:e.string().optional(),environmentId:e.property("environment_id",e.string()),externalId:e.property("external_id",e.string()),isActive:e.property("is_active",e.boolean()),name:e.string(),price:e.number(),priceDecimal:e.property("price_decimal",e.string().optional()),productId:e.property("product_id",e.string()),providerType:e.property("provider_type",B),quantity:e.number(),updatedAt:e.property("updated_at",e.date())});var Pn=e.object({data:xr,params:e.record(e.string(),e.unknown())});var xn=e.object({applicationId:e.property("application_id",e.string().optional()),cancelAt:e.property("cancel_at",e.number().optional()),cancelAtPeriodEnd:e.property("cancel_at_period_end",e.boolean()),companyId:e.property("company_id",e.string().optional()),createdAt:e.property("created_at",e.date()),currency:e.string(),customerExternalId:e.property("customer_external_id",e.string()),defaultPaymentMethodId:e.property("default_payment_method_id",e.string().optional()),expiredAt:e.property("expired_at",e.date().optional()),id:e.string(),interval:e.string(),metadata:e.record(e.string(),e.unknown()).optional(),periodEnd:e.property("period_end",e.number()),periodStart:e.property("period_start",e.number()),providerType:e.property("provider_type",B),status:e.string(),subscriptionExternalId:e.property("subscription_external_id",e.string()),totalPrice:e.property("total_price",e.number()),trialEnd:e.property("trial_end",e.number().optional()),trialEndSetting:e.property("trial_end_setting",Je.optional())});var En=e.object({data:xn,params:e.record(e.string(),e.unknown())});var Cn=e.object({data:Oe,params:e.record(e.string(),e.unknown())});var Un=e.object({data:ge,params:e.record(e.string(),e.unknown())});var nt=e.object({cancelImmediately:e.property("cancel_immediately",e.boolean().optional()),companyId:e.property("company_id",e.string()),prorate:e.boolean().optional()});var ct=e.object({companyId:e.property("company_id",e.string()),selectedPlanId:e.property("selected_plan_id",e.string().optional())});var lt=e.object({trialEnd:e.property("trial_end",e.date().optional())});var xi=e.object({billingScheme:e.property("billing_scheme",ke),billingThreshold:e.property("billing_threshold",e.number().optional()),createdAt:e.property("created_at",e.date()),currency:e.string(),environmentId:e.property("environment_id",e.string()),externalId:e.property("external_id",e.string()),id:e.string(),interval:e.string(),meterId:e.property("meter_id",e.string().optional()),name:e.string(),packageSize:e.property("package_size",e.number()),price:e.number(),priceDecimal:e.property("price_decimal",e.string().optional()),priceExternalId:e.property("price_external_id",e.string()),priceId:e.property("price_id",e.string()),priceTier:e.property("price_tier",e.list(_i)),providerType:e.property("provider_type",B),quantity:e.number(),subscriptionId:e.property("subscription_id",e.string()),subscriptionItemExternalId:e.property("subscription_item_external_id",e.string().optional()),updatedAt:e.property("updated_at",e.date()),usageType:e.property("usage_type",Z)});var Ei=e.object({amountOff:e.property("amount_off",e.number().optional()),couponId:e.property("coupon_id",e.string()),couponName:e.property("coupon_name",e.string()),currency:e.string().optional(),customerFacingCode:e.property("customer_facing_code",e.string().optional()),discountExternalId:e.property("discount_external_id",e.string()),duration:e.string(),durationInMonths:e.property("duration_in_months",e.number().optional()),endedAt:e.property("ended_at",e.date().optional()),isActive:e.property("is_active",e.boolean()),percentOff:e.property("percent_off",e.number().optional()),promoCodeExternalId:e.property("promo_code_external_id",e.string().optional()),startedAt:e.property("started_at",e.date()),subscriptionExternalId:e.property("subscription_external_id",e.string())});var Ye=e.object({applicationId:e.property("application_id",e.string().optional()),cancelAt:e.property("cancel_at",e.number().optional()),cancelAtPeriodEnd:e.property("cancel_at_period_end",e.boolean()),companyId:e.property("company_id",e.string().optional()),createdAt:e.property("created_at",e.date()),currency:e.string(),customerExternalId:e.property("customer_external_id",e.string()),defaultPaymentMethodId:e.property("default_payment_method_id",e.string().optional()),discounts:e.list(Ei),expiredAt:e.property("expired_at",e.date().optional()),id:e.string(),interval:e.string(),latestInvoice:e.property("latest_invoice",Oe.optional()),metadata:e.record(e.string(),e.unknown()).optional(),paymentMethod:e.property("payment_method",ge.optional()),periodEnd:e.property("period_end",e.number()),periodStart:e.property("period_start",e.number()),products:e.list(xi),providerType:e.property("provider_type",B),status:e.string(),subscriptionExternalId:e.property("subscription_external_id",e.string()),totalPrice:e.property("total_price",e.number()),trialEnd:e.property("trial_end",e.number().optional()),trialEndSetting:e.property("trial_end_setting",Je.optional())});var Ci=e.object({accountId:e.property("account_id",e.string()),capturedAtMax:e.property("captured_at_max",e.date()),capturedAtMin:e.property("captured_at_min",e.date()),companyId:e.property("company_id",e.string()),createdAt:e.property("created_at",e.date()),environmentId:e.property("environment_id",e.string()),eventSubtype:e.property("event_subtype",e.string()),monthReset:e.property("month_reset",e.string()),period:e.string(),validUntil:e.property("valid_until",e.date().optional()),value:e.number()});var N=e.enum_(["duration","end_of_billing_period","end_of_next_billing_period","end_of_trial","no_expiry"]);var G=e.enum_(["billing_periods","days"]);var fe=e.enum_(["daily","monthly","weekly","yearly"]);var Be=e.enum_(["billing_period","first_of_month"]);var Xe=e.enum_(["no_reset","plan_period"]);var Ui=e.object({billingCreditAutoTopupAmount:e.property("billing_credit_auto_topup_amount",e.number().optional()),billingCreditAutoTopupAmountType:e.property("billing_credit_auto_topup_amount_type",e.string().optional()),billingCreditAutoTopupEnabled:e.property("billing_credit_auto_topup_enabled",e.boolean()),billingCreditAutoTopupExpiryType:e.property("billing_credit_auto_topup_expiry_type",N.optional()),billingCreditAutoTopupExpiryUnit:e.property("billing_credit_auto_topup_expiry_unit",G.optional()),billingCreditAutoTopupExpiryUnitCount:e.property("billing_credit_auto_topup_expiry_unit_count",e.number().optional()),billingCreditAutoTopupThresholdPercent:e.property("billing_credit_auto_topup_threshold_percent",e.number().optional()),createdAt:e.property("created_at",e.date()),creditAmount:e.property("credit_amount",e.number()),creditDescription:e.property("credit_description",e.string()),creditIcon:e.property("credit_icon",e.string().optional()),creditId:e.property("credit_id",e.string()),creditName:e.property("credit_name",e.string()),expiryType:e.property("expiry_type",N.optional()),expiryUnit:e.property("expiry_unit",G.optional()),expiryUnitCount:e.property("expiry_unit_count",e.number().optional()),id:e.string(),planId:e.property("plan_id",e.string()),planName:e.property("plan_name",e.string()),pluralName:e.property("plural_name",e.string().optional()),resetCadence:e.property("reset_cadence",fe),resetStart:e.property("reset_start",Be),resetType:e.property("reset_type",Xe),singularName:e.property("singular_name",e.string().optional()),updatedAt:e.property("updated_at",e.date())});var Er=e.object({addedOn:e.property("added_on",e.date().optional()),billingProductExternalId:e.property("billing_product_external_id",e.string().optional()),billingProductId:e.property("billing_product_id",e.string().optional()),description:e.string().optional(),id:e.string(),imageUrl:e.property("image_url",e.string().optional()),includedCreditGrants:e.property("included_credit_grants",e.list(Ui)),name:e.string(),planPeriod:e.property("plan_period",e.string().optional()),planPrice:e.property("plan_price",e.number().optional()),planVersionId:e.property("plan_version_id",e.string().optional())});var W=e.enum_(["company","user"]);var Ti=e.object({createdAt:e.property("created_at",e.date()),entityType:e.property("entity_type",W),id:e.string(),key:e.string(),updatedAt:e.property("updated_at",e.date())});var Cr=e.object({createdAt:e.property("created_at",e.date()),definition:Ti.optional(),definitionId:e.property("definition_id",e.string()),entityId:e.property("entity_id",e.string()),entityType:e.property("entity_type",W),environmentId:e.property("environment_id",e.string()),id:e.string(),key:e.string(),updatedAt:e.property("updated_at",e.date()),value:e.string()});var X=e.enum_(["boolean","currency","date","number","string","url"]);var oe=e.object({createdAt:e.property("created_at",e.date()),displayName:e.property("display_name",e.string()),entityType:e.property("entity_type",W),hierarchy:e.list(e.string()),id:e.string(),traitType:e.property("trait_type",X),updatedAt:e.property("updated_at",e.date())});var Ur=e.object({createdAt:e.property("created_at",e.date()),definition:oe.optional(),definitionId:e.property("definition_id",e.string()),environmentId:e.property("environment_id",e.string()),id:e.string(),updatedAt:e.property("updated_at",e.date()),value:e.string()});var vi=e.object({description:e.string().optional(),id:e.string(),imageUrl:e.property("image_url",e.string().optional()),name:e.string()});var Tn=e.enum_(["base_plan","billing_product","company","credit","crm_product","metric","plan","trait","user"]);var vn=e.enum_(["all_time","current_day","current_month","current_week"]);var On=e.enum_(["first_of_month","billing_cycle"]);var jn=e.enum_(["eq","ne","gt","lt","gte","lte","is_empty","not_empty"]);var kn=e.enum_(["bool","date","int","string"]);var pt=e.object({comparableType:e.property("comparable_type",kn),entityType:e.property("entity_type",W),id:e.string()});var Oi=e.object({accountId:e.property("account_id",e.string()),comparisonTraitDefinition:e.property("comparison_trait_definition",pt.optional()),conditionType:e.property("condition_type",Tn),consumptionRate:e.property("consumption_rate",e.number().optional()),creditId:e.property("credit_id",e.string().optional()),environmentId:e.property("environment_id",e.string()),eventSubtype:e.property("event_subtype",e.string().optional()),id:e.string(),metricPeriod:e.property("metric_period",vn.optional()),metricPeriodMonthReset:e.property("metric_period_month_reset",On.optional()),metricValue:e.property("metric_value",e.number().optional()),operator:jn,resourceIds:e.property("resource_ids",e.list(e.string())),traitDefinition:e.property("trait_definition",pt.optional()),traitValue:e.property("trait_value",e.string())});var Bn=e.object({conditions:e.list(Oi)});var An=e.enum_(["default","global_override","company_override","company_override_usage_exceeded","plan_entitlement","plan_entitlement_usage_exceeded","standard"]);var ji=e.object({accountId:e.property("account_id",e.string()),conditionGroups:e.property("condition_groups",e.list(Bn)),conditions:e.list(Oi),environmentId:e.property("environment_id",e.string()),flagId:e.property("flag_id",e.string().optional()),id:e.string(),name:e.string(),priority:e.number(),ruleType:e.property("rule_type",An),value:e.boolean()});var L=e.object({addOns:e.property("add_ons",e.list(Er)),billingCreditBalances:e.property("billing_credit_balances",e.record(e.string(),e.number()).optional()),billingSubscription:e.property("billing_subscription",Ye.optional()),billingSubscriptions:e.property("billing_subscriptions",e.list(Ye)),createdAt:e.property("created_at",e.date()),defaultPaymentMethod:e.property("default_payment_method",ge.optional()),entityTraits:e.property("entity_traits",e.list(Ur)),environmentId:e.property("environment_id",e.string()),id:e.string(),keys:e.list(Cr),lastSeenAt:e.property("last_seen_at",e.date().optional()),logoUrl:e.property("logo_url",e.string().optional()),metrics:e.list(Ci),name:e.string(),paymentMethods:e.property("payment_methods",e.list(ge)),plan:Er.optional(),plans:e.list(vi),rules:e.list(ji),traits:e.record(e.string(),e.unknown()).optional(),updatedAt:e.property("updated_at",e.date()),userCount:e.property("user_count",e.number())});var ki=e.object({company:L.optional(),success:e.boolean()});var Vn=e.object({data:ki,params:e.record(e.string(),e.unknown())});var qn=e.object({applicationId:e.property("application_id",e.string().optional()),cancelAt:e.property("cancel_at",e.number().optional()),cancelAtPeriodEnd:e.property("cancel_at_period_end",e.boolean()),companyId:e.property("company_id",e.string().optional()),confirmPaymentIntentClientSecret:e.property("confirm_payment_intent_client_secret",e.string().optional()),confirmPaymentIntentId:e.property("confirm_payment_intent_id",e.string().optional()),createdAt:e.property("created_at",e.date()),currency:e.string(),customerExternalId:e.property("customer_external_id",e.string()),defaultPaymentMethodId:e.property("default_payment_method_id",e.string().optional()),expiredAt:e.property("expired_at",e.date().optional()),id:e.string(),interval:e.string(),metadata:e.record(e.string(),e.unknown()).optional(),periodEnd:e.property("period_end",e.number()),periodStart:e.property("period_start",e.number()),providerType:e.property("provider_type",B),status:e.string(),subscriptionExternalId:e.property("subscription_external_id",e.string()),totalPrice:e.property("total_price",e.number()),trialEnd:e.property("trial_end",e.number().optional()),trialEndSetting:e.property("trial_end_setting",Je.optional())});var Dn=e.object({data:qn,params:e.record(e.string(),e.unknown())});var ue=e.enum_(["active","inactive"]);var ze=e.stringLiteral("fixed");var _e=e.object({billingInvoiceId:e.property("billing_invoice_id",e.string().optional()),bundleType:e.property("bundle_type",ze),createdAt:e.property("created_at",e.date()),creditDescription:e.property("credit_description",e.string().optional()),creditIcon:e.property("credit_icon",e.string().optional()),creditId:e.property("credit_id",e.string()),creditName:e.property("credit_name",e.string()),expiryType:e.property("expiry_type",N),expiryUnit:e.property("expiry_unit",G),expiryUnitCount:e.property("expiry_unit_count",e.number().optional()),hasGrants:e.property("has_grants",e.boolean()),id:e.string(),name:e.string(),pluralName:e.property("plural_name",e.string().optional()),price:Q.optional(),quantity:e.number().optional(),singularName:e.property("singular_name",e.string().optional()),status:ue,unitPrice:e.property("unit_price",Q.optional()),updatedAt:e.property("updated_at",e.date())});var Tr=e.object({cancelAt:e.property("cancel_at",e.date().optional()),cancelAtPeriodEnd:e.property("cancel_at_period_end",e.boolean()),currency:e.string(),customerExternalId:e.property("customer_external_id",e.string()),discounts:e.list(Ei),expiredAt:e.property("expired_at",e.date().optional()),interval:e.string(),latestInvoice:e.property("latest_invoice",Oe.optional()),paymentMethod:e.property("payment_method",ge.optional()),products:e.list(xi),status:e.string(),subscriptionExternalId:e.property("subscription_external_id",e.string()),totalPrice:e.property("total_price",e.number()),trialEnd:e.property("trial_end",e.date().optional())});var Mn=e.object({bundle:_e.optional(),quantity:e.number(),total:e.number()});var Se=e.enum_(["billing_credit_auto_topup","free","plan","purchased"]);var Fn=e.object({createdAt:e.property("created_at",e.date()),externalUserId:e.property("external_user_id",e.string()),externalUserName:e.property("external_user_name",e.string()),id:e.string(),note:e.string(),updatedAt:e.property("updated_at",e.date())});var Y=e.enum_(["boolean","credit","numeric","trait","unknown","unlimited"]);var er=e.enum_(["add_on","alpha","beta","deprecated","ga","inactive","in_plan","internal_testing","legacy"]);var te=e.enum_(["boolean","event","trait"]);var vr=e.object({createdAt:e.property("created_at",e.date()),description:e.string(),eventSubtype:e.property("event_subtype",e.string().optional()),featureType:e.property("feature_type",te),icon:e.string(),id:e.string(),lifecyclePhase:e.property("lifecycle_phase",er.optional()),maintainerId:e.property("maintainer_id",e.string().optional()),name:e.string(),pluralName:e.property("plural_name",e.string().optional()),singularName:e.property("singular_name",e.string().optional()),traitId:e.property("trait_id",e.string().optional()),updatedAt:e.property("updated_at",e.date())});var Pe=e.object({company:L.optional(),companyId:e.property("company_id",e.string()),consumptionRate:e.property("consumption_rate",e.number().optional()),createdAt:e.property("created_at",e.date()),environmentId:e.property("environment_id",e.string()),expirationDate:e.property("expiration_date",e.date().optional()),feature:vr.optional(),featureId:e.property("feature_id",e.string()),id:e.string(),metricPeriod:e.property("metric_period",e.string().optional()),metricPeriodMonthReset:e.property("metric_period_month_reset",e.string().optional()),notes:e.list(Fn),ruleId:e.property("rule_id",e.string().optional()),ruleIdUsageExceeded:e.property("rule_id_usage_exceeded",e.string().optional()),updatedAt:e.property("updated_at",e.date()),valueBool:e.property("value_bool",e.boolean().optional()),valueNumeric:e.property("value_numeric",e.number().optional()),valueTrait:e.property("value_trait",oe.optional()),valueTraitId:e.property("value_trait_id",e.string().optional()),valueType:e.property("value_type",Y)});var rr=e.object({creditTypeIcon:e.property("credit_type_icon",e.string().optional()),expiresAt:e.property("expires_at",e.date().optional()),grantReason:e.property("grant_reason",Se),quantity:e.number()});var Or=e.object({usageThisBillingPeriod:e.property("usage_this_billing_period",e.number().optional()),usageThisCalendarMonth:e.property("usage_this_calendar_month",e.number().optional()),usageThisWeek:e.property("usage_this_week",e.number().optional()),usageToday:e.property("usage_today",e.number().optional())});var ye=e.enum_(["credit_burndown","overage","pay_as_you_go","pay_in_advance","tier"]);var jr=e.enum_(["company_override","plan_entitlement","unknown"]);var Bi=e.object({companyCount:e.property("company_count",e.number()),environmentId:e.property("environment_id",e.string()),eventCount:e.property("event_count",e.number()),eventSubtype:e.property("event_subtype",e.string()),lastSeenAt:e.property("last_seen_at",e.date().optional()),userCount:e.property("user_count",e.number())});var ir=e.stringLiteral("boolean");var In=e.object({description:e.string().optional(),id:e.string(),imageUrl:e.property("image_url",e.string().optional()),name:e.string()});var Ai=e.object({comparisonTrait:e.property("comparison_trait",oe.optional()),comparisonTraitId:e.property("comparison_trait_id",e.string().optional()),conditionGroupId:e.property("condition_group_id",e.string().optional()),conditionType:e.property("condition_type",e.string()),createdAt:e.property("created_at",e.date()),environmentId:e.property("environment_id",e.string()),eventSubtype:e.property("event_subtype",e.string().optional()),flagId:e.property("flag_id",e.string().optional()),id:e.string(),metricPeriod:e.property("metric_period",e.string().optional()),metricPeriodMonthReset:e.property("metric_period_month_reset",e.string().optional()),metricValue:e.property("metric_value",e.number().optional()),operator:e.string(),resourceIds:e.property("resource_ids",e.list(e.string())),resources:e.list(In),ruleId:e.property("rule_id",e.string()),trait:oe.optional(),traitEntityType:e.property("trait_entity_type",W.optional()),traitId:e.property("trait_id",e.string().optional()),traitValue:e.property("trait_value",e.string()),updatedAt:e.property("updated_at",e.date())});var Kn=e.object({conditions:e.list(Ai),createdAt:e.property("created_at",e.date()),environmentId:e.property("environment_id",e.string()),flagId:e.property("flag_id",e.string().optional()),id:e.string(),ruleId:e.property("rule_id",e.string()),updatedAt:e.property("updated_at",e.date())});var Vi=e.object({conditionGroups:e.property("condition_groups",e.list(Kn)),conditions:e.list(Ai),createdAt:e.property("created_at",e.date()),environmentId:e.property("environment_id",e.string()),flagId:e.property("flag_id",e.string().optional()),id:e.string(),name:e.string(),priority:e.number(),ruleType:e.property("rule_type",e.string()),updatedAt:e.property("updated_at",e.date()),value:e.boolean()});var Ae=e.object({createdAt:e.property("created_at",e.date()),defaultValue:e.property("default_value",e.boolean()),description:e.string(),feature:vr.optional(),featureId:e.property("feature_id",e.string().optional()),flagType:e.property("flag_type",ir),id:e.string(),key:e.string(),lastCheckedAt:e.property("last_checked_at",e.date().optional()),maintainerId:e.property("maintainer_id",e.string().optional()),name:e.string(),rules:e.list(Vi),updatedAt:e.property("updated_at",e.date())});var kr=e.object({description:e.string().optional(),id:e.string(),imageUrl:e.property("image_url",e.string().optional()),name:e.string()});var ee=e.object({createdAt:e.property("created_at",e.date()),description:e.string(),eventSubtype:e.property("event_subtype",e.string().optional()),eventSummary:e.property("event_summary",Bi.optional()),featureType:e.property("feature_type",te),flags:e.list(Ae),icon:e.string(),id:e.string(),lifecyclePhase:e.property("lifecycle_phase",er.optional()),maintainerId:e.property("maintainer_id",e.string().optional()),name:e.string(),plans:e.list(kr),pluralName:e.property("plural_name",e.string().optional()),singularName:e.property("singular_name",e.string().optional()),trait:oe.optional(),traitId:e.property("trait_id",e.string().optional()),updatedAt:e.property("updated_at",e.date())});var Br=e.enum_(["expiration_priority","first_in_first_out","last_in_first_out","plan_first_then_credit_bundles_first_in_first_out"]);var Ar=e.enum_(["expire","none","rollover"]);var Ve=e.object({burnStrategy:e.property("burn_strategy",Br),createdAt:e.property("created_at",e.date()),defaultExpiryUnit:e.property("default_expiry_unit",G),defaultExpiryUnitCount:e.property("default_expiry_unit_count",e.number().optional()),defaultRolloverPolicy:e.property("default_rollover_policy",Ar),description:e.string(),icon:e.string().optional(),id:e.string(),name:e.string(),pluralName:e.property("plural_name",e.string().optional()),price:Q.optional(),product:xr.optional(),singularName:e.property("singular_name",e.string().optional()),updatedAt:e.property("updated_at",e.date())});var ae=e.enum_(["plan","add_on"]);var qe=e.object({audienceType:e.property("audience_type",e.string().optional()),createdAt:e.property("created_at",e.date()),description:e.string(),icon:e.string(),id:e.string(),name:e.string(),planType:e.property("plan_type",ae),updatedAt:e.property("updated_at",e.date())});var re=e.object({billingThreshold:e.property("billing_threshold",e.number().optional()),consumptionRate:e.property("consumption_rate",e.number().optional()),createdAt:e.property("created_at",e.date()),environmentId:e.property("environment_id",e.string()),feature:vr.optional(),featureId:e.property("feature_id",e.string()),id:e.string(),meteredMonthlyPrice:e.property("metered_monthly_price",J.optional()),meteredYearlyPrice:e.property("metered_yearly_price",J.optional()),metricPeriod:e.property("metric_period",e.string().optional()),metricPeriodMonthReset:e.property("metric_period_month_reset",e.string().optional()),plan:qe.optional(),planId:e.property("plan_id",e.string()),priceBehavior:e.property("price_behavior",ye.optional()),ruleId:e.property("rule_id",e.string()),ruleIdUsageExceeded:e.property("rule_id_usage_exceeded",e.string().optional()),softLimit:e.property("soft_limit",e.number().optional()),updatedAt:e.property("updated_at",e.date()),usageBasedProduct:e.property("usage_based_product",xr.optional()),valueBool:e.property("value_bool",e.boolean().optional()),valueCredit:e.property("value_credit",Ve.optional()),valueNumeric:e.property("value_numeric",e.number().optional()),valueTrait:e.property("value_trait",oe.optional()),valueTraitId:e.property("value_trait_id",e.string().optional()),valueType:e.property("value_type",Y)});var or=e.object({access:e.boolean(),allocation:e.number().optional(),allocationType:e.property("allocation_type",Y),companyOverride:e.property("company_override",Pe.optional()),creditConsumptionRate:e.property("credit_consumption_rate",e.number().optional()),creditGrantCounts:e.property("credit_grant_counts",e.record(e.string(),e.number()).optional()),creditGrantDetails:e.property("credit_grant_details",e.list(rr).optional()),creditGrantReason:e.property("credit_grant_reason",Se.optional()),creditRemaining:e.property("credit_remaining",e.number().optional()),creditTotal:e.property("credit_total",e.number().optional()),creditTypeIcon:e.property("credit_type_icon",e.string().optional()),creditUsageAggregation:e.property("credit_usage_aggregation",Or.optional()),creditUsed:e.property("credit_used",e.number().optional()),effectiveLimit:e.property("effective_limit",e.number().optional()),effectivePrice:e.property("effective_price",e.number().optional()),entitlementExpirationDate:e.property("entitlement_expiration_date",e.date().optional()),entitlementId:e.property("entitlement_id",e.string()),entitlementSource:e.property("entitlement_source",e.string().optional()),entitlementType:e.property("entitlement_type",jr),feature:ee.optional(),hasValidAllocation:e.property("has_valid_allocation",e.boolean().optional()),isUnlimited:e.property("is_unlimited",e.boolean().optional()),metricResetAt:e.property("metric_reset_at",e.date().optional()),monthReset:e.property("month_reset",e.string().optional()),monthlyUsageBasedPrice:e.property("monthly_usage_based_price",J.optional()),overuse:e.number().optional(),percentUsed:e.property("percent_used",e.number().optional()),period:e.string().optional(),plan:qe.optional(),planEntitlement:e.property("plan_entitlement",re.optional()),priceBehavior:e.property("price_behavior",ye.optional()),softLimit:e.property("soft_limit",e.number().optional()),usage:e.number().optional(),yearlyUsageBasedPrice:e.property("yearly_usage_based_price",J.optional())});var Vr=e.object({features:e.list(or)});var xe=e.object({autoTopupAmount:e.property("auto_topup_amount",e.number().optional()),autoTopupAmountType:e.property("auto_topup_amount_type",e.string().optional()),autoTopupEnabled:e.property("auto_topup_enabled",e.boolean()),autoTopupExpiryType:e.property("auto_topup_expiry_type",N.optional()),autoTopupExpiryUnit:e.property("auto_topup_expiry_unit",G.optional()),autoTopupExpiryUnitCount:e.property("auto_topup_expiry_unit_count",e.number().optional()),autoTopupThresholdPercent:e.property("auto_topup_threshold_percent",e.number().optional()),createdAt:e.property("created_at",e.date()),creditAmount:e.property("credit_amount",e.number()),creditId:e.property("credit_id",e.string()),creditName:e.property("credit_name",e.string()),creditPluralName:e.property("credit_plural_name",e.string().optional()),creditSingularName:e.property("credit_singular_name",e.string().optional()),expiryType:e.property("expiry_type",N.optional()),expiryUnit:e.property("expiry_unit",G.optional()),expiryUnitCount:e.property("expiry_unit_count",e.number().optional()),id:e.string(),planId:e.property("plan_id",e.string()),planName:e.property("plan_name",e.string()),resetCadence:e.property("reset_cadence",fe),resetStart:e.property("reset_start",Be),resetType:e.property("reset_type",Xe.optional()),updatedAt:e.property("updated_at",e.date())});var De=e.enum_(["free","one_time","recurring"]);var tr=e.enum_(["schematic","stripe"]);var Gn=e.enum_(["published","draft","archived"]);var qr=e.object({createdAt:e.property("created_at",e.date()),description:e.string(),environmentId:e.property("environment_id",e.string()),icon:e.string(),id:e.string(),name:e.string(),originalPlanId:e.property("original_plan_id",e.string().optional()),planType:e.property("plan_type",ae),status:Gn,updatedAt:e.property("updated_at",e.date()),version:e.number()});var de=e.object({audienceType:e.property("audience_type",e.string().optional()),billingProduct:e.property("billing_product",Qe.optional()),chargeType:e.property("charge_type",De),companyCount:e.property("company_count",e.number()),controlledBy:e.property("controlled_by",tr),createdAt:e.property("created_at",e.date()),description:e.string(),features:e.list(ee),icon:e.string(),id:e.string(),includedCreditGrants:e.property("included_credit_grants",e.list(xe).optional()),isDefault:e.property("is_default",e.boolean()),isFree:e.property("is_free",e.boolean()),isTrialable:e.property("is_trialable",e.boolean()),monthlyPrice:e.property("monthly_price",Q.optional()),name:e.string(),oneTimePrice:e.property("one_time_price",Q.optional()),planType:e.property("plan_type",ae),trialDays:e.property("trial_days",e.number().optional()),updatedAt:e.property("updated_at",e.date()),versions:e.list(qr),yearlyPrice:e.property("yearly_price",Q.optional())});var ti=e.object({billingThreshold:e.property("billing_threshold",e.number().optional()),consumptionRate:e.property("consumption_rate",e.number().optional()),featureId:e.property("feature_id",e.string()),meteredPrice:e.property("metered_price",J.optional()),metricPeriod:e.property("metric_period",e.string().optional()),metricPeriodMonthReset:e.property("metric_period_month_reset",e.string().optional()),monthlyUsageBasedPrice:e.property("monthly_usage_based_price",J.optional()),priceBehavior:e.property("price_behavior",ye.optional()),valueBool:e.property("value_bool",e.boolean().optional()),valueNumeric:e.property("value_numeric",e.number().optional()),valueType:e.property("value_type",Y),yearlyUsageBasedPrice:e.property("yearly_usage_based_price",J.optional())});var Ln=e.object({activeAddOns:e.property("active_add_ons",e.list(de)),activePlan:e.property("active_plan",de.optional()),activeUsageBasedEntitlements:e.property("active_usage_based_entitlements",e.list(ti)),availableCreditBundles:e.property("available_credit_bundles",e.list(_e)),company:L.optional(),featureUsage:e.property("feature_usage",Vr.optional()),selectedCreditBundles:e.property("selected_credit_bundles",e.list(Mn)),selectedPlan:e.property("selected_plan",de.optional()),selectedUsageBasedEntitlements:e.property("selected_usage_based_entitlements",e.list(ti)),subscription:Tr.optional()});var Wn=e.object({data:Ln,params:e.record(e.string(),e.unknown())});var Nn=e.object({data:ki,params:e.record(e.string(),e.unknown())});var Hn=e.object({amount:e.number(),description:e.string(),priceId:e.property("price_id",e.string()),proration:e.boolean(),quantity:e.number()});var $n=e.object({amountOff:e.property("amount_off",e.number()),dueNow:e.property("due_now",e.number()),newCharges:e.property("new_charges",e.number()),percentOff:e.property("percent_off",e.number()),periodStart:e.property("period_start",e.date()),promoCodeApplied:e.property("promo_code_applied",e.boolean()),proration:e.number(),taxAmount:e.property("tax_amount",e.number().optional()),taxDisplayName:e.property("tax_display_name",e.string().optional()),taxRequireBillingDetails:e.property("tax_require_billing_details",e.boolean()),totalPerBillingPeriod:e.property("total_per_billing_period",e.number()),trialEnd:e.property("trial_end",e.date().optional()),upcomingInvoiceLineItems:e.property("upcoming_invoice_line_items",e.list(Hn))});var qi=e.object({amountOff:e.property("amount_off",e.number()),dueNow:e.property("due_now",e.number()),finance:$n.optional(),newCharges:e.property("new_charges",e.number()),paymentMethodRequired:e.property("payment_method_required",e.boolean()),percentOff:e.property("percent_off",e.number()),periodStart:e.property("period_start",e.date()),promoCodeApplied:e.property("promo_code_applied",e.boolean()),proration:e.number(),trialEnd:e.property("trial_end",e.date().optional()),usageViolations:e.property("usage_violations",e.list(or))});var Zn=e.object({data:qi,params:e.record(e.string(),e.unknown())});var Jn=e.object({subscriptionChangePreview:e.property("subscription_change_preview",qi.optional())});var Qn=e.object({data:Jn,params:e.record(e.string(),e.unknown())});var Yn=e.object({data:Ye,params:e.record(e.string(),e.unknown())});var ut=e.object({displayName:e.property("display_name",e.string().optional()),entityType:e.property("entity_type",W),hierarchy:e.list(e.string()),traitType:e.property("trait_type",X)});var dt=e.object({planId:e.property("plan_id",e.string()),traitId:e.property("trait_id",e.string()),traitValue:e.property("trait_value",e.string())});var mt=e.object({companyId:e.property("company_id",e.string()),userId:e.property("user_id",e.string())});var ht=e.object({displayName:e.property("display_name",e.string().optional()),traitType:e.property("trait_type",X)});var Dr=e.object({traitId:e.property("trait_id",e.string()),traitValue:e.property("trait_value",e.string())});var gt=e.object({applyToExistingCompanies:e.property("apply_to_existing_companies",e.boolean()),planId:e.property("plan_id",e.string()),traits:e.list(Dr)});var yt=e.object({planId:e.property("plan_id",e.string()),traitValue:e.property("trait_value",e.string())});var we=e.enum_(["asc","desc"]);var Le=e.enum_(["active","canceled","expired","incomplete","incomplete_expired","past_due","paused","trialing","unpaid"]);var We=e.enum_(["free","one_time","paid","trial"]);var Xn=e.object({creditTypeIds:e.property("credit_type_ids",e.list(e.string()).optional()),displayProperties:e.property("display_properties",e.list(e.string()).optional()),featureIds:e.property("feature_ids",e.list(e.string()).optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),monetizedSubscriptions:e.property("monetized_subscriptions",e.boolean().optional()),offset:e.number().optional(),planIds:e.property("plan_ids",e.list(e.string()).optional()),q:e.string().optional(),sortOrderColumn:e.property("sort_order_column",e.string().optional()),sortOrderDirection:e.property("sort_order_direction",we.optional()),subscriptionStatuses:e.property("subscription_statuses",e.list(Le).optional()),subscriptionTypes:e.property("subscription_types",e.list(We).optional()),withoutPlan:e.property("without_plan",e.boolean().optional()),withoutSubscription:e.property("without_subscription",e.boolean().optional())});var ec=e.object({data:A,params:Xn});var rc=e.object({ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),planId:e.property("plan_id",e.string().optional()),q:e.string().optional(),withSubscription:e.property("with_subscription",e.boolean().optional()),withoutFeatureOverrideFor:e.property("without_feature_override_for",e.string().optional()),withoutPlan:e.property("without_plan",e.boolean().optional())});var ic=e.object({data:A,params:rc});var oc=e.object({entityType:e.property("entity_type",W.optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var tc=e.object({data:A,params:oc});var ac=e.object({entityType:e.property("entity_type",W.optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional(),traitType:e.property("trait_type",X.optional()),traitTypes:e.property("trait_types",e.list(X).optional())});var sc=e.object({data:A,params:ac});var nc=e.object({ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),planId:e.property("plan_id",e.string().optional()),traitId:e.property("trait_id",e.string().optional()),traitIds:e.property("trait_ids",e.list(e.string()).optional())});var cc=e.object({data:A,params:nc});var lc=e.object({companyId:e.property("company_id",e.string().optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),planId:e.property("plan_id",e.string().optional()),q:e.string().optional()});var pc=e.object({data:A,params:lc});var uc=e.object({data:L,params:e.record(e.string(),e.unknown())});var Ee=e.object({accountId:e.property("account_id",e.string()),createdAt:e.property("created_at",e.date()),environmentId:e.property("environment_id",e.string()),id:e.string(),planId:e.property("plan_id",e.string()),planType:e.property("plan_type",e.string()),traitId:e.property("trait_id",e.string()),traitValue:e.property("trait_value",e.string()),updatedAt:e.property("updated_at",e.date())});var dc=e.object({data:Ee,params:e.record(e.string(),e.unknown())});var Mr=e.object({createdAt:e.property("created_at",e.date()),environmentId:e.property("environment_id",e.string()),id:e.string(),lastSeenAt:e.property("last_seen_at",e.date().optional()),logoUrl:e.property("logo_url",e.string().optional()),name:e.string(),updatedAt:e.property("updated_at",e.date())});var Fr=e.object({company:Mr.optional(),companyId:e.property("company_id",e.string()),createdAt:e.property("created_at",e.date()),id:e.string(),updatedAt:e.property("updated_at",e.date()),userId:e.property("user_id",e.string())});var Ce=e.object({companyMemberships:e.property("company_memberships",e.list(Fr)),createdAt:e.property("created_at",e.date()),entityTraits:e.property("entity_traits",e.list(Ur)),environmentId:e.property("environment_id",e.string()),id:e.string(),keys:e.list(Cr),lastSeenAt:e.property("last_seen_at",e.date().optional()),name:e.string(),traits:e.record(e.string(),e.unknown()).optional(),updatedAt:e.property("updated_at",e.date())});var mc=e.object({data:Ce,params:e.record(e.string(),e.unknown())});var hc=e.object({data:Mr,params:e.record(e.string(),e.unknown())});var gc=e.object({data:D,params:e.record(e.string(),e.unknown())});var yc=e.object({cancelSubscription:e.property("cancel_subscription",e.boolean().optional()),prorate:e.boolean().optional()});var wc=e.object({data:D,params:yc});var bc=e.object({data:D,params:e.record(e.string(),e.unknown())});var Di=e.object({createdAt:e.property("created_at",e.date()),environmentId:e.property("environment_id",e.string()),id:e.string(),lastSeenAt:e.property("last_seen_at",e.date().optional()),name:e.string(),updatedAt:e.property("updated_at",e.date())});var zc=e.object({data:Di,params:e.record(e.string(),e.unknown())});var Rc=e.object({data:D,params:e.record(e.string(),e.unknown())});var fc=e.object({companyId:e.property("company_id",e.string().optional()),companyIds:e.property("company_ids",e.list(e.string()).optional()),limit:e.number().optional(),offset:e.number().optional()});var _c=e.object({data:e.list(Tr),params:fc});var Sc=e.object({data:L,params:e.record(e.string(),e.unknown())});var Pc=e.object({data:oe,params:e.record(e.string(),e.unknown())});var xc=e.object({definitionId:e.property("definition_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var Ec=e.object({definitionId:e.property("definition_id",e.string()),value:e.string()});var Cc=e.object({data:e.list(Ec),params:xc});var Uc=e.object({data:Fr,params:e.record(e.string(),e.unknown())});var Tc=e.object({data:oe,params:e.record(e.string(),e.unknown())});var vc=e.enum_(["checkout","company_upsert","fallback_plan","manage_plan","migration","plan_billing_product_changed","plan_deleted","plan_trait_change","quickstart","subscription_change"]);var Oc=e.enum_(["api_key","app_user","system","temporary_access_token"]);var jc=e.enum_(["fallback","initial","trait","trial_expiry"]);var kc=e.enum_(["adjustment","downgrade","invalid","subscribe","unsubscribe","upgrade","upgrade_trial"]);var ai=e.object({deleted:e.boolean(),description:e.string(),icon:e.string(),id:e.string(),name:e.string()});var Bc=e.object({featureId:e.property("feature_id",e.string()),hierarchy:e.list(e.string()),reason:e.string(),traitId:e.property("trait_id",e.string()),traitName:e.property("trait_name",e.string()),traitType:e.property("trait_type",X),value:e.string()});var Mi=e.object({action:vc,actorType:e.property("actor_type",Oc),addOnsAdded:e.property("add_ons_added",e.list(ai)),addOnsRemoved:e.property("add_ons_removed",e.list(ai)),apiKey:e.property("api_key",Re.optional()),apiKeyRequest:e.property("api_key_request",fi.optional()),basePlan:e.property("base_plan",ai.optional()),basePlanAction:e.property("base_plan_action",jc.optional()),company:Mr.optional(),companyId:e.property("company_id",e.string()),createdAt:e.property("created_at",e.date()),environmentId:e.property("environment_id",e.string()),id:e.string(),previousBasePlan:e.property("previous_base_plan",ai.optional()),requestId:e.property("request_id",e.string().optional()),subscriptionChangeAction:e.property("subscription_change_action",kc.optional()),traitsUpdated:e.property("traits_updated",e.list(Bc)),updatedAt:e.property("updated_at",e.date()),userId:e.property("user_id",e.string().optional()),userName:e.property("user_name",e.string().optional())});var Ac=e.object({data:Mi,params:e.record(e.string(),e.unknown())});var Vc=e.object({data:Ee,params:e.record(e.string(),e.unknown())});var qc=e.object({data:Ce,params:e.record(e.string(),e.unknown())});var Dc=e.object({creditTypeIds:e.property("credit_type_ids",e.list(e.string()).optional()),displayProperties:e.property("display_properties",e.list(e.string()).optional()),featureIds:e.property("feature_ids",e.list(e.string()).optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),monetizedSubscriptions:e.property("monetized_subscriptions",e.boolean().optional()),offset:e.number().optional(),planIds:e.property("plan_ids",e.list(e.string()).optional()),q:e.string().optional(),sortOrderColumn:e.property("sort_order_column",e.string().optional()),sortOrderDirection:e.property("sort_order_direction",we.optional()),subscriptionStatuses:e.property("subscription_statuses",e.list(Le).optional()),subscriptionTypes:e.property("subscription_types",e.list(We).optional()),withoutPlan:e.property("without_plan",e.boolean().optional()),withoutSubscription:e.property("without_subscription",e.boolean().optional())});var Mc=e.object({creditConsumptionRate:e.property("credit_consumption_rate",e.number().optional()),creditGrantCounts:e.property("credit_grant_counts",e.record(e.string(),e.number()).optional()),creditGrantDetails:e.property("credit_grant_details",e.list(rr)),creditRemaining:e.property("credit_remaining",e.number().optional()),creditTotal:e.property("credit_total",e.number().optional()),creditTypeIcon:e.property("credit_type_icon",e.string().optional()),creditTypeName:e.property("credit_type_name",e.string().optional()),creditUsed:e.property("credit_used",e.number().optional())});var Fc=e.object({creditTypeId:e.property("credit_type_id",e.string().optional()),creditUsage:e.property("credit_usage",Mc.optional()),entitlementSource:e.property("entitlement_source",e.string()),entitlementValueType:e.property("entitlement_value_type",e.string()),featureId:e.property("feature_id",e.string()),featureName:e.property("feature_name",e.string()),featureType:e.property("feature_type",te),hardLimit:e.property("hard_limit",e.string()),hasAccess:e.property("has_access",e.boolean()),metricResetAt:e.property("metric_reset_at",e.date().optional()),monthlyUsageBasedPrice:e.property("monthly_usage_based_price",J.optional()),priceBehavior:e.property("price_behavior",e.string().optional()),softLimit:e.property("soft_limit",e.string()),usage:e.string(),valueNumeric:e.property("value_numeric",e.number().optional()),yearlyUsageBasedPrice:e.property("yearly_usage_based_price",J.optional())});var Ic=e.object({addOns:e.property("add_ons",e.list(Er)),billingCreditBalances:e.property("billing_credit_balances",e.record(e.string(),e.number()).optional()),billingSubscription:e.property("billing_subscription",Ye.optional()),billingSubscriptions:e.property("billing_subscriptions",e.list(Ye)),createdAt:e.property("created_at",e.date()),defaultPaymentMethod:e.property("default_payment_method",ge.optional()),entityTraits:e.property("entity_traits",e.list(Ur)),environmentId:e.property("environment_id",e.string()),featureUsage:e.property("feature_usage",e.list(Fc)),id:e.string(),keys:e.list(Cr),lastSeenAt:e.property("last_seen_at",e.date().optional()),logoUrl:e.property("logo_url",e.string().optional()),metrics:e.list(Ci),name:e.string(),paymentMethods:e.property("payment_methods",e.list(ge)),plan:Er.optional(),plans:e.list(vi),rules:e.list(ji),traits:e.record(e.string(),e.unknown()).optional(),updatedAt:e.property("updated_at",e.date()),userCount:e.property("user_count",e.number())});var Kc=e.object({data:e.list(Ic),params:Dc});var Gc=e.object({ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),planId:e.property("plan_id",e.string().optional()),q:e.string().optional(),withSubscription:e.property("with_subscription",e.boolean().optional()),withoutFeatureOverrideFor:e.property("without_feature_override_for",e.string().optional()),withoutPlan:e.property("without_plan",e.boolean().optional())});var Lc=e.object({data:e.list(L),params:Gc});var Wc=e.object({companyId:e.property("company_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),userId:e.property("user_id",e.string().optional())});var Nc=e.object({data:e.list(Fr),params:Wc});var Hc=e.object({entityType:e.property("entity_type",W.optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var $c=e.object({data:e.list(Ti),params:Hc});var Zc=e.object({entityType:e.property("entity_type",W.optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional(),traitType:e.property("trait_type",X.optional()),traitTypes:e.property("trait_types",e.list(X).optional())});var Jc=e.object({data:e.list(oe),params:Zc});var Qc=e.object({action:e.string().optional(),basePlanAction:e.property("base_plan_action",e.string().optional()),companyId:e.property("company_id",e.string().optional()),companyIds:e.property("company_ids",e.list(e.string()).optional()),limit:e.number().optional(),offset:e.number().optional(),planIds:e.property("plan_ids",e.list(e.string()).optional())});var Yc=e.object({data:e.list(Mi),params:Qc});var Xc=e.object({ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),planId:e.property("plan_id",e.string().optional()),traitId:e.property("trait_id",e.string().optional()),traitIds:e.property("trait_ids",e.list(e.string()).optional())});var el=e.object({data:e.list(Ee),params:Xc});var rl=e.object({companyId:e.property("company_id",e.string().optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),planId:e.property("plan_id",e.string().optional()),q:e.string().optional()});var il=e.object({data:e.list(Ce),params:rl});var ol=e.object({keys:e.record(e.string(),e.string()).optional()});var tl=e.object({data:L,params:ol});var al=e.object({keys:e.record(e.string(),e.string()).optional()});var sl=e.object({data:Ce,params:al});var nl=e.object({data:oe,params:e.record(e.string(),e.unknown())});var cl=e.object({data:Ee,params:e.record(e.string(),e.unknown())});var ll=e.object({data:e.list(Ee),params:e.record(e.string(),e.unknown())});var pl=e.object({data:L,params:e.record(e.string(),e.unknown())});var ul=e.object({data:L,params:e.record(e.string(),e.unknown())});var dl=e.object({data:Ce,params:e.record(e.string(),e.unknown())});var ml=e.object({data:Ce,params:e.record(e.string(),e.unknown())});var Ir=e.enum_(["billing","entitlement"]);var wt=e.object({ast:e.record(e.string(),e.number()).optional(),entityType:e.property("entity_type",Ir),name:e.string()});var Fi=e.enum_(["draft","live"]);var bt=e.object({ast:e.record(e.string(),e.number()).optional(),entityType:e.property("entity_type",Ir.optional()),name:e.string().optional(),state:Fi.optional()});var hl=e.object({limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var gl=e.object({data:A,params:hl});var Me=e.object({ast:e.record(e.string(),e.number()).optional(),createdAt:e.property("created_at",e.date()),id:e.string(),name:e.string(),state:Fi,type:Ir,updatedAt:e.property("updated_at",e.date())});var yl=e.object({data:Me,params:e.record(e.string(),e.unknown())});var wl=e.object({data:D,params:e.record(e.string(),e.unknown())});var bl=e.object({data:Me,params:e.record(e.string(),e.unknown())});var zl=e.object({limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var Rl=e.object({data:e.list(Me),params:zl});var fl=e.object({companyId:e.property("company_id",e.string().optional()),componentId:e.property("component_id",e.string().optional())});var si=e.object({billingScheme:e.property("billing_scheme",ke),createdAt:e.property("created_at",e.date()),currency:e.string(),id:e.string(),interval:Pr,isActive:e.property("is_active",e.boolean()),meterId:e.property("meter_id",e.string().optional()),packageSize:e.property("package_size",e.number()),price:e.number(),priceDecimal:e.property("price_decimal",e.string().optional()),priceExternalId:e.property("price_external_id",e.string()),productExternalId:e.property("product_external_id",e.string()),providerType:e.property("provider_type",B),tiersMode:e.property("tiers_mode",ie.optional()),updatedAt:e.property("updated_at",e.date()),usageType:e.property("usage_type",Z)});var _l=e.object({billingInvoiceId:e.property("billing_invoice_id",e.string().optional()),bundleType:e.property("bundle_type",ze),createdAt:e.property("created_at",e.date()),creditDescription:e.property("credit_description",e.string().optional()),creditIcon:e.property("credit_icon",e.string().optional()),creditId:e.property("credit_id",e.string()),creditName:e.property("credit_name",e.string()),expiryType:e.property("expiry_type",N),expiryUnit:e.property("expiry_unit",G),expiryUnitCount:e.property("expiry_unit_count",e.number().optional()),hasGrants:e.property("has_grants",e.boolean()),id:e.string(),name:e.string(),pluralName:e.property("plural_name",e.string().optional()),price:si.optional(),quantity:e.number().optional(),singularName:e.property("singular_name",e.string().optional()),status:ue,unitPrice:e.property("unit_price",si.optional()),updatedAt:e.property("updated_at",e.date())});var Sl=e.enum_(["downgrade_not_permitted","feature_usage_exceeded"]);var Kr=e.object({ctaText:e.property("cta_text",e.string()),ctaWebSite:e.property("cta_web_site",e.string()),priceText:e.property("price_text",e.string())});var zt=e.object({audienceType:e.property("audience_type",e.string().optional()),billingProduct:e.property("billing_product",Qe.optional()),chargeType:e.property("charge_type",De),companyCanTrial:e.property("company_can_trial",e.boolean()),companyCount:e.property("company_count",e.number()),compatiblePlanIds:e.property("compatible_plan_ids",e.list(e.string())),controlledBy:e.property("controlled_by",tr),createdAt:e.property("created_at",e.date()),current:e.boolean(),custom:e.boolean(),customPlanConfig:e.property("custom_plan_config",Kr.optional()),description:e.string(),entitlements:e.list(re),features:e.list(ee),icon:e.string(),id:e.string(),includedCreditGrants:e.property("included_credit_grants",e.list(Ui)),invalidReason:e.property("invalid_reason",Sl.optional()),isCustom:e.property("is_custom",e.boolean()),isDefault:e.property("is_default",e.boolean()),isFree:e.property("is_free",e.boolean()),isTrialable:e.property("is_trialable",e.boolean()),monthlyPrice:e.property("monthly_price",Q.optional()),name:e.string(),oneTimePrice:e.property("one_time_price",Q.optional()),planType:e.property("plan_type",ae),trialDays:e.property("trial_days",e.number().optional()),updatedAt:e.property("updated_at",e.date()),usageViolations:e.property("usage_violations",e.list(or)),valid:e.boolean(),versions:e.list(qr),yearlyPrice:e.property("yearly_price",Q.optional())});var Gr=e.object({compatiblePlanIds:e.property("compatible_plan_ids",e.list(e.string())),sourcePlanId:e.property("source_plan_id",e.string())});var Pl=e.object({badgeVisibility:e.property("badge_visibility",e.boolean()),checkout:e.boolean()});var xl=e.object({collectAddress:e.property("collect_address",e.boolean()),collectEmail:e.property("collect_email",e.boolean()),collectPhone:e.property("collect_phone",e.boolean()),taxCollectionEnabled:e.property("tax_collection_enabled",e.boolean())});var El=e.object({showAsMonthlyPrices:e.property("show_as_monthly_prices",e.boolean()),showCredits:e.property("show_credits",e.boolean()),showPeriodToggle:e.property("show_period_toggle",e.boolean()),showZeroPriceAsFree:e.property("show_zero_price_as_free",e.boolean())});var Lr=e.enum_(["expired","manual","plan_change","plan_period_reset"]);var Cl=e.object({amount:e.number(),createdAt:e.property("created_at",e.date()),direction:e.string(),id:e.string(),reason:e.string(),relatedGrantId:e.property("related_grant_id",e.string())});var Ul=e.object({billingCreditBundleId:e.property("billing_credit_bundle_id",e.string().optional()),billingCreditId:e.property("billing_credit_id",e.string()),companyId:e.property("company_id",e.string()),companyName:e.property("company_name",e.string()),createdAt:e.property("created_at",e.date()),creditDescription:e.property("credit_description",e.string()),creditIcon:e.property("credit_icon",e.string().optional()),creditName:e.property("credit_name",e.string()),exhaustedAt:e.property("exhausted_at",e.date().optional()),expiresAt:e.property("expires_at",e.date().optional()),expiryType:e.property("expiry_type",N.optional()),expiryUnit:e.property("expiry_unit",G.optional()),expiryUnitCount:e.property("expiry_unit_count",e.number().optional()),grantReason:e.property("grant_reason",Se),id:e.string(),planId:e.property("plan_id",e.string().optional()),planName:e.property("plan_name",e.string().optional()),pluralName:e.property("plural_name",e.string().optional()),price:si.optional(),quantity:e.number(),quantityRemaining:e.property("quantity_remaining",e.number()),quantityUsed:e.property("quantity_used",e.number()),renewalEnabled:e.property("renewal_enabled",e.boolean()),renewalPeriod:e.property("renewal_period",fe.optional()),singularName:e.property("singular_name",e.string().optional()),sourceLabel:e.property("source_label",e.string()),transfers:e.list(Cl).optional(),updatedAt:e.property("updated_at",e.date()),validFrom:e.property("valid_from",e.date().optional()),zeroedOutDate:e.property("zeroed_out_date",e.date().optional()),zeroedOutReason:e.property("zeroed_out_reason",Lr.optional())});var Tl=e.object({accountId:e.property("account_id",e.string().optional()),publishableKey:e.property("publishable_key",e.string().optional()),schematicPublishableKey:e.property("schematic_publishable_key",e.string()),setupIntentClientSecret:e.property("setup_intent_client_secret",e.string().optional())});var vl=e.object({activeAddOns:e.property("active_add_ons",e.list(zt)),activePlans:e.property("active_plans",e.list(zt)),activeUsageBasedEntitlements:e.property("active_usage_based_entitlements",e.list(ti)),addOnCompatibilities:e.property("add_on_compatibilities",e.list(Gr)),capabilities:Pl.optional(),checkoutSettings:e.property("checkout_settings",xl),company:L.optional(),component:Me.optional(),creditBundles:e.property("credit_bundles",e.list(_l)),creditGrants:e.property("credit_grants",e.list(Ul)),defaultPlan:e.property("default_plan",de.optional()),displaySettings:e.property("display_settings",El),featureUsage:e.property("feature_usage",Vr.optional()),invoices:e.list(Oe),postTrialPlan:e.property("post_trial_plan",de.optional()),preventSelfServiceDowngrade:e.property("prevent_self_service_downgrade",e.boolean()),preventSelfServiceDowngradeButtonText:e.property("prevent_self_service_downgrade_button_text",e.string().optional()),preventSelfServiceDowngradeUrl:e.property("prevent_self_service_downgrade_url",e.string().optional()),showAsMonthlyPrices:e.property("show_as_monthly_prices",e.boolean()),showCredits:e.property("show_credits",e.boolean()),showPeriodToggle:e.property("show_period_toggle",e.boolean()),showZeroPriceAsFree:e.property("show_zero_price_as_free",e.boolean()),stripeEmbed:e.property("stripe_embed",Tl.optional()),subscription:Tr.optional(),trialPaymentMethodRequired:e.property("trial_payment_method_required",e.boolean().optional()),upcomingInvoice:e.property("upcoming_invoice",Oe.optional())});var Ol=e.object({data:vl,params:fl});var jl=e.object({data:Me,params:e.record(e.string(),e.unknown())});var Rt=e.object({burnStrategy:e.property("burn_strategy",Br.optional()),currency:e.string(),defaultExpiryUnit:e.property("default_expiry_unit",G.optional()),defaultExpiryUnitCount:e.property("default_expiry_unit_count",e.number().optional()),defaultRolloverPolicy:e.property("default_rollover_policy",Ar.optional()),description:e.string(),icon:e.string().optional(),name:e.string(),perUnitPrice:e.property("per_unit_price",e.number().optional()),perUnitPriceDecimal:e.property("per_unit_price_decimal",e.string().optional()),pluralName:e.property("plural_name",e.string().optional()),singularName:e.property("singular_name",e.string().optional())});var ft=e.object({billingPeriodsCount:e.property("billing_periods_count",e.number().optional()),companyId:e.property("company_id",e.string()),creditId:e.property("credit_id",e.string()),expiresAt:e.property("expires_at",e.date().optional()),expiryType:e.property("expiry_type",N.optional()),expiryUnit:e.property("expiry_unit",G.optional()),expiryUnitCount:e.property("expiry_unit_count",e.number().optional()),quantity:e.number(),reason:Se,renewalEnabled:e.property("renewal_enabled",e.boolean().optional()),renewalPeriod:e.property("renewal_period",Be.optional())});var _t=e.object({bundleName:e.property("bundle_name",e.string()),bundleType:e.property("bundle_type",ze.optional()),creditId:e.property("credit_id",e.string()),currency:e.string(),expiryType:e.property("expiry_type",N.optional()),expiryUnit:e.property("expiry_unit",G.optional()),expiryUnitCount:e.property("expiry_unit_count",e.number().optional()),pricePerUnit:e.property("price_per_unit",e.number()),pricePerUnitDecimal:e.property("price_per_unit_decimal",e.string().optional()),quantity:e.number().optional(),status:ue.optional()});var St=e.object({burnStrategy:e.property("burn_strategy",Br.optional()),defaultExpiryUnit:e.property("default_expiry_unit",G.optional()),defaultExpiryUnitCount:e.property("default_expiry_unit_count",e.number().optional()),defaultRolloverPolicy:e.property("default_rollover_policy",Ar.optional()),description:e.string(),icon:e.string().optional(),name:e.string(),perUnitPrice:e.property("per_unit_price",e.number().optional()),perUnitPriceDecimal:e.property("per_unit_price_decimal",e.string().optional()),pluralName:e.property("plural_name",e.string().optional()),singularName:e.property("singular_name",e.string().optional())});var Pt=e.object({bundleName:e.property("bundle_name",e.string()),expiryType:e.property("expiry_type",N.optional()),expiryUnit:e.property("expiry_unit",G.optional()),expiryUnitCount:e.property("expiry_unit_count",e.number().optional()),pricePerUnit:e.property("price_per_unit",e.number()),pricePerUnitDecimal:e.property("price_per_unit_decimal",e.string().optional()),quantity:e.number().optional(),status:ue.optional()});var xt=e.object({reason:Lr.optional()});var kl=e.object({creditId:e.property("credit_id",e.string().optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional()});var Bl=e.object({data:A,params:kl});var Al=e.object({ids:e.list(e.string()).optional(),limit:e.number().optional(),name:e.string().optional(),offset:e.number().optional()});var Vl=e.object({data:A,params:Al});var ql=e.object({creditId:e.property("credit_id",e.string().optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),planId:e.property("plan_id",e.string().optional()),planIds:e.property("plan_ids",e.list(e.string()).optional())});var Dl=e.object({data:A,params:ql});var ur=e.enum_(["created_at","expires_at","quantity","quantity_remaining"]);var Ml=e.object({companyId:e.property("company_id",e.string().optional()),dir:we.optional(),limit:e.number().optional(),offset:e.number().optional(),order:ur.optional()});var Fl=e.object({data:A,params:Ml});var Il=e.object({bundleType:e.property("bundle_type",ze.optional()),creditId:e.property("credit_id",e.string().optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),status:ue.optional()});var Kl=e.object({data:A,params:Il});var dr=e.enum_(["daily","monthly","raw","weekly"]);var Gl=e.object({billingCreditId:e.property("billing_credit_id",e.string().optional()),companyId:e.property("company_id",e.string().optional()),endTime:e.property("end_time",e.string().optional()),featureId:e.property("feature_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),period:dr.optional(),startTime:e.property("start_time",e.string().optional())});var Ll=e.object({data:A,params:Gl});var Wl=e.object({data:Ve,params:e.record(e.string(),e.unknown())});var Nl=e.object({data:xe,params:e.record(e.string(),e.unknown())});var Hl=e.object({data:_e,params:e.record(e.string(),e.unknown())});var $l=e.object({applyToExisting:e.property("apply_to_existing",e.boolean().optional())});var Zl=e.object({data:D,params:$l});var Jl=e.object({data:D,params:e.record(e.string(),e.unknown())});var Ql=e.object({data:_e,params:e.record(e.string(),e.unknown())});var Yl=e.object({billingCreditId:e.property("billing_credit_id",e.string().optional()),companyId:e.property("company_id",e.string().optional()),endTime:e.property("end_time",e.string().optional()),featureId:e.property("feature_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),period:dr.optional(),startTime:e.property("start_time",e.string().optional())});var Xl=e.object({description:e.string().optional(),icon:e.string().optional(),id:e.string(),name:e.string(),pluralName:e.property("plural_name",e.string().optional()),singularName:e.property("singular_name",e.string().optional())});var ep=e.object({id:e.string(),logoUrl:e.property("logo_url",e.string().optional()),name:e.string()});var rp=e.object({description:e.string().optional(),icon:e.string().optional(),id:e.string(),name:e.string()});var ip=e.object({billingCreditAutoTopupGrantCount:e.property("billing_credit_auto_topup_grant_count",e.number()),billingCreditId:e.property("billing_credit_id",e.string()),company:ep.optional(),companyId:e.property("company_id",e.string()),credit:Xl.optional(),expiredGrantCount:e.property("expired_grant_count",e.number()),feature:rp.optional(),featureId:e.property("feature_id",e.string().optional()),firstTransactionAt:e.property("first_transaction_at",e.date()),freeGrantCount:e.property("free_grant_count",e.number()),grantCount:e.property("grant_count",e.number()),lastTransactionAt:e.property("last_transaction_at",e.date()),manuallyZeroedCount:e.property("manually_zeroed_count",e.number()),netChange:e.property("net_change",e.number()),planGrantCount:e.property("plan_grant_count",e.number()),purchasedGrantCount:e.property("purchased_grant_count",e.number()),timeBucket:e.property("time_bucket",e.date()),totalConsumed:e.property("total_consumed",e.number()),totalGranted:e.property("total_granted",e.number()),transactionCount:e.property("transaction_count",e.number()),usageCount:e.property("usage_count",e.number()),zeroedOutCount:e.property("zeroed_out_count",e.number())});var op=e.object({data:e.list(ip),params:Yl});var tp=e.object({data:Ve,params:e.record(e.string(),e.unknown())});var ap=e.object({amount:e.number(),createdAt:e.property("created_at",e.date()),direction:e.string(),id:e.string(),reason:e.string(),relatedGrantId:e.property("related_grant_id",e.string())});var ar=e.object({companyId:e.property("company_id",e.string()),companyName:e.property("company_name",e.string()),createdAt:e.property("created_at",e.date()),creditIcon:e.property("credit_icon",e.string().optional()),creditId:e.property("credit_id",e.string()),creditName:e.property("credit_name",e.string()),expiresAt:e.property("expires_at",e.date().optional()),grantReason:e.property("grant_reason",Se),id:e.string(),planId:e.property("plan_id",e.string().optional()),planName:e.property("plan_name",e.string().optional()),price:Q.optional(),quantity:e.number(),quantityRemaining:e.property("quantity_remaining",e.number()),quantityUsed:e.property("quantity_used",e.number()),renewalEnabled:e.property("renewal_enabled",e.boolean()),renewalPeriod:e.property("renewal_period",fe.optional()),sourceLabel:e.property("source_label",e.string()),transfers:e.list(ap).optional(),updatedAt:e.property("updated_at",e.date()),validFrom:e.property("valid_from",e.date().optional()),zeroedOutDate:e.property("zeroed_out_date",e.date().optional()),zeroedOutReason:e.property("zeroed_out_reason",Lr.optional())});var sp=e.object({data:ar,params:e.record(e.string(),e.unknown())});var np=e.object({ids:e.list(e.string()).optional(),limit:e.number().optional(),name:e.string().optional(),offset:e.number().optional()});var cp=e.object({data:e.list(Ve),params:np});var lp=e.object({creditId:e.property("credit_id",e.string().optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),planId:e.property("plan_id",e.string().optional()),planIds:e.property("plan_ids",e.list(e.string()).optional())});var pp=e.object({data:e.list(xe),params:lp});var up=e.object({companyId:e.property("company_id",e.string().optional()),dir:we.optional(),limit:e.number().optional(),offset:e.number().optional(),order:ur.optional()});var dp=e.object({data:e.list(ar),params:up});var mp=e.object({bundleType:e.property("bundle_type",ze.optional()),creditId:e.property("credit_id",e.string().optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),status:ue.optional()});var hp=e.object({data:e.list(_e),params:mp});var gp=e.object({creditId:e.property("credit_id",e.string().optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional()});var yp=e.object({data:e.list(ar),params:gp});var wp=e.object({data:D,params:e.record(e.string(),e.unknown())});var bp=e.object({data:Ve,params:e.record(e.string(),e.unknown())});var zp=e.object({data:xe,params:e.record(e.string(),e.unknown())});var Rp=e.object({data:_e,params:e.record(e.string(),e.unknown())});var fp=e.object({data:ar,params:e.record(e.string(),e.unknown())});var Et=e.object({metadata:e.string()});var _p=e.stringLiteral("csv");var Sp=e.enum_(["failure","pending","success"]);var Pp=e.stringLiteral("company-feature-usage");var xp=e.object({accountId:e.property("account_id",e.string()),createdAt:e.property("created_at",e.date()),environmentId:e.property("environment_id",e.string()),exportType:e.property("export_type",Pp),id:e.string(),metadata:e.string(),outputFileType:e.property("output_file_type",_p),status:Sp,updatedAt:e.property("updated_at",e.date())});var Ep=e.object({data:xp,params:e.record(e.string(),e.unknown())});var Cp=e.enum_(["all_time","current_month","current_week","current_day"]);var Up=e.enum_(["first_of_month","billing_cycle"]);var Ct=e.object({companyId:e.property("company_id",e.string()),creditConsumptionRate:e.property("credit_consumption_rate",e.number().optional()),expirationDate:e.property("expiration_date",e.date().optional()),featureId:e.property("feature_id",e.string()),metricPeriod:e.property("metric_period",Cp.optional()),metricPeriodMonthReset:e.property("metric_period_month_reset",Up.optional()),note:e.string().optional(),valueBool:e.property("value_bool",e.boolean().optional()),valueCreditId:e.property("value_credit_id",e.string().optional()),valueNumeric:e.property("value_numeric",e.number().optional()),valueTraitId:e.property("value_trait_id",e.string().optional()),valueType:e.property("value_type",Y)});var Ue=e.object({flatAmount:e.property("flat_amount",e.number().optional()),perUnitPrice:e.property("per_unit_price",e.number().optional()),perUnitPriceDecimal:e.property("per_unit_price_decimal",e.string().optional()),upTo:e.property("up_to",e.number().optional())});var Tp=e.enum_(["all_time","current_month","current_week","current_day"]);var vp=e.enum_(["first_of_month","billing_cycle"]);var Ut=e.object({billingProductId:e.property("billing_product_id",e.string().optional()),billingThreshold:e.property("billing_threshold",e.number().optional()),creditConsumptionRate:e.property("credit_consumption_rate",e.number().optional()),currency:e.string().optional(),featureId:e.property("feature_id",e.string()),metricPeriod:e.property("metric_period",Tp.optional()),metricPeriodMonthReset:e.property("metric_period_month_reset",vp.optional()),monthlyMeteredPriceId:e.property("monthly_metered_price_id",e.string().optional()),monthlyPriceTiers:e.property("monthly_price_tiers",e.list(Ue).optional()),monthlyUnitPrice:e.property("monthly_unit_price",e.number().optional()),monthlyUnitPriceDecimal:e.property("monthly_unit_price_decimal",e.string().optional()),overageBillingProductId:e.property("overage_billing_product_id",e.string().optional()),planId:e.property("plan_id",e.string()),priceBehavior:e.property("price_behavior",ye.optional()),priceTiers:e.property("price_tiers",e.list(Ue).optional()),softLimit:e.property("soft_limit",e.number().optional()),tierMode:e.property("tier_mode",ie.optional()),valueBool:e.property("value_bool",e.boolean().optional()),valueCreditId:e.property("value_credit_id",e.string().optional()),valueNumeric:e.property("value_numeric",e.number().optional()),valueTraitId:e.property("value_trait_id",e.string().optional()),valueType:e.property("value_type",Y),yearlyMeteredPriceId:e.property("yearly_metered_price_id",e.string().optional()),yearlyPriceTiers:e.property("yearly_price_tiers",e.list(Ue).optional()),yearlyUnitPrice:e.property("yearly_unit_price",e.number().optional()),yearlyUnitPriceDecimal:e.property("yearly_unit_price_decimal",e.string().optional())});var Tt=e.object({sourcePlanId:e.property("source_plan_id",e.string()),targetPlanId:e.property("target_plan_id",e.string())});var Op=e.enum_(["all_time","current_month","current_week","current_day"]);var jp=e.enum_(["first_of_month","billing_cycle"]);var vt=e.object({creditConsumptionRate:e.property("credit_consumption_rate",e.number().optional()),expirationDate:e.property("expiration_date",e.date().optional()),metricPeriod:e.property("metric_period",Op.optional()),metricPeriodMonthReset:e.property("metric_period_month_reset",jp.optional()),note:e.string().optional(),valueBool:e.property("value_bool",e.boolean().optional()),valueCreditId:e.property("value_credit_id",e.string().optional()),valueNumeric:e.property("value_numeric",e.number().optional()),valueTraitId:e.property("value_trait_id",e.string().optional()),valueType:e.property("value_type",Y)});var kp=e.enum_(["all_time","current_month","current_week","current_day"]);var Bp=e.enum_(["first_of_month","billing_cycle"]);var Ot=e.object({billingProductId:e.property("billing_product_id",e.string().optional()),billingThreshold:e.property("billing_threshold",e.number().optional()),creditConsumptionRate:e.property("credit_consumption_rate",e.number().optional()),currency:e.string().optional(),metricPeriod:e.property("metric_period",kp.optional()),metricPeriodMonthReset:e.property("metric_period_month_reset",Bp.optional()),monthlyMeteredPriceId:e.property("monthly_metered_price_id",e.string().optional()),monthlyPriceTiers:e.property("monthly_price_tiers",e.list(Ue).optional()),monthlyUnitPrice:e.property("monthly_unit_price",e.number().optional()),monthlyUnitPriceDecimal:e.property("monthly_unit_price_decimal",e.string().optional()),overageBillingProductId:e.property("overage_billing_product_id",e.string().optional()),priceBehavior:e.property("price_behavior",ye.optional()),priceTiers:e.property("price_tiers",e.list(Ue).optional()),softLimit:e.property("soft_limit",e.number().optional()),tierMode:e.property("tier_mode",ie.optional()),valueBool:e.property("value_bool",e.boolean().optional()),valueCreditId:e.property("value_credit_id",e.string().optional()),valueNumeric:e.property("value_numeric",e.number().optional()),valueTraitId:e.property("value_trait_id",e.string().optional()),valueType:e.property("value_type",Y),yearlyMeteredPriceId:e.property("yearly_metered_price_id",e.string().optional()),yearlyPriceTiers:e.property("yearly_price_tiers",e.list(Ue).optional()),yearlyUnitPrice:e.property("yearly_unit_price",e.number().optional()),yearlyUnitPriceDecimal:e.property("yearly_unit_price_decimal",e.string().optional())});var Ap=e.object({companyId:e.property("company_id",e.string().optional()),companyIds:e.property("company_ids",e.list(e.string()).optional()),featureId:e.property("feature_id",e.string().optional()),featureIds:e.property("feature_ids",e.list(e.string()).optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional(),withoutExpired:e.property("without_expired",e.boolean().optional())});var Vp=e.object({data:A,params:Ap});var qp=e.object({featureId:e.property("feature_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var Dp=e.object({data:A,params:qp});var Mp=e.object({companyId:e.property("company_id",e.string().optional()),companyKeys:e.property("company_keys",e.record(e.string(),e.string()).optional()),featureIds:e.property("feature_ids",e.list(e.string()).optional()),includeUsageAggregation:e.property("include_usage_aggregation",e.boolean().optional()),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional(),withoutNegativeEntitlements:e.property("without_negative_entitlements",e.boolean().optional())});var Fp=e.object({data:A,params:Mp});var Ip=e.object({featureId:e.property("feature_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var Kp=e.object({data:A,params:Ip});var Gp=e.object({featureId:e.property("feature_id",e.string().optional()),featureIds:e.property("feature_ids",e.list(e.string()).optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),planId:e.property("plan_id",e.string().optional()),planIds:e.property("plan_ids",e.list(e.string()).optional()),q:e.string().optional(),withMeteredProducts:e.property("with_metered_products",e.boolean().optional())});var Lp=e.object({data:A,params:Gp});var Wp=e.object({data:Pe,params:e.record(e.string(),e.unknown())});var Np=e.object({data:re,params:e.record(e.string(),e.unknown())});var Hp=e.object({data:D,params:e.record(e.string(),e.unknown())});var $p=e.object({data:D,params:e.record(e.string(),e.unknown())});var Zp=e.object({message:e.string()});var Jp=e.object({entitlementId:e.property("entitlement_id",e.string()),errors:e.list(Zp),featureId:e.property("feature_id",e.string()),featureName:e.property("feature_name",e.string())});var Qp=e.object({data:e.list(re),skipped:e.list(Jp)});var Yp=e.object({data:Qp,params:e.record(e.string(),e.unknown())});var Xp=e.object({data:Pe,params:e.record(e.string(),e.unknown())});var eu=e.object({keys:e.record(e.string(),e.string()).optional()});var ru=e.object({data:Vr,params:eu});var iu=e.object({data:re,params:e.record(e.string(),e.unknown())});var ou=e.object({companyId:e.property("company_id",e.string().optional()),companyIds:e.property("company_ids",e.list(e.string()).optional()),featureId:e.property("feature_id",e.string().optional()),featureIds:e.property("feature_ids",e.list(e.string()).optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional(),withoutExpired:e.property("without_expired",e.boolean().optional())});var tu=e.object({data:e.list(Pe),params:ou});var au=e.object({featureId:e.property("feature_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var su=e.object({creditConsumptionRate:e.property("credit_consumption_rate",e.number().optional()),creditGrantCounts:e.property("credit_grant_counts",e.record(e.string(),e.number()).optional()),creditGrantDetails:e.property("credit_grant_details",e.list(rr).optional()),creditRemaining:e.property("credit_remaining",e.number().optional()),creditTotal:e.property("credit_total",e.number().optional()),creditTypeIcon:e.property("credit_type_icon",e.string().optional()),creditTypeName:e.property("credit_type_name",e.string().optional()),creditUsed:e.property("credit_used",e.number().optional()),usageAggregation:e.property("usage_aggregation",Or.optional())});var nu=e.object({access:e.boolean(),allocation:e.number().optional(),allocationType:e.property("allocation_type",Y),company:L.optional(),companyOverride:e.property("company_override",Pe.optional()),creditConsumptionRate:e.property("credit_consumption_rate",e.number().optional()),creditGrantCounts:e.property("credit_grant_counts",e.record(e.string(),e.number()).optional()),creditGrantDetails:e.property("credit_grant_details",e.list(rr).optional()),creditGrantReason:e.property("credit_grant_reason",Se.optional()),creditRemaining:e.property("credit_remaining",e.number().optional()),creditTotal:e.property("credit_total",e.number().optional()),creditTypeIcon:e.property("credit_type_icon",e.string().optional()),creditUsage:e.property("credit_usage",su.optional()),creditUsageAggregation:e.property("credit_usage_aggregation",Or.optional()),creditUsed:e.property("credit_used",e.number().optional()),effectiveLimit:e.property("effective_limit",e.number().optional()),effectivePrice:e.property("effective_price",e.number().optional()),entitlementExpirationDate:e.property("entitlement_expiration_date",e.date().optional()),entitlementId:e.property("entitlement_id",e.string()),entitlementSource:e.property("entitlement_source",e.string().optional()),entitlementType:e.property("entitlement_type",jr),feature:ee.optional(),hasValidAllocation:e.property("has_valid_allocation",e.boolean().optional()),isUnlimited:e.property("is_unlimited",e.boolean().optional()),metricResetAt:e.property("metric_reset_at",e.date().optional()),monthReset:e.property("month_reset",e.string().optional()),monthlyUsageBasedPrice:e.property("monthly_usage_based_price",J.optional()),overuse:e.number().optional(),percentUsed:e.property("percent_used",e.number().optional()),period:e.string().optional(),plan:qe.optional(),planEntitlement:e.property("plan_entitlement",re.optional()),priceBehavior:e.property("price_behavior",ye.optional()),softLimit:e.property("soft_limit",e.number().optional()),usage:e.number().optional(),yearlyUsageBasedPrice:e.property("yearly_usage_based_price",J.optional())});var cu=e.object({data:e.list(nu),params:au});var lu=e.object({companyId:e.property("company_id",e.string().optional()),companyKeys:e.property("company_keys",e.record(e.string(),e.string()).optional()),featureIds:e.property("feature_ids",e.list(e.string()).optional()),includeUsageAggregation:e.property("include_usage_aggregation",e.boolean().optional()),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional(),withoutNegativeEntitlements:e.property("without_negative_entitlements",e.boolean().optional())});var pu=e.object({data:e.list(or),params:lu});var uu=e.object({featureId:e.property("feature_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var du=e.object({access:e.boolean(),allocation:e.number().optional(),allocationType:e.property("allocation_type",Y),company:L.optional(),entitlementId:e.property("entitlement_id",e.string()),entitlementType:e.property("entitlement_type",jr),feature:ee.optional(),metricResetAt:e.property("metric_reset_at",e.date().optional()),monthReset:e.property("month_reset",e.string().optional()),period:e.string().optional(),plan:qe.optional(),usage:e.number().optional(),user:Di.optional()});var mu=e.object({data:e.list(du),params:uu});var hu=e.object({featureId:e.property("feature_id",e.string().optional()),featureIds:e.property("feature_ids",e.list(e.string()).optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),planId:e.property("plan_id",e.string().optional()),planIds:e.property("plan_ids",e.list(e.string()).optional()),q:e.string().optional(),withMeteredProducts:e.property("with_metered_products",e.boolean().optional())});var gu=e.object({data:e.list(re),params:hu});var yu=e.object({data:Pe,params:e.record(e.string(),e.unknown())});var wu=e.object({data:re,params:e.record(e.string(),e.unknown())});var bu=e.object({companyId:e.property("company_id",e.string().optional()),error:e.string().optional(),flagId:e.property("flag_id",e.string().optional()),flagKey:e.property("flag_key",e.string()),reason:e.string(),reqCompany:e.property("req_company",e.record(e.string(),e.string()).optional()),reqUser:e.property("req_user",e.record(e.string(),e.string()).optional()),ruleId:e.property("rule_id",e.string().optional()),userId:e.property("user_id",e.string().optional()),value:e.boolean()});var zu=e.object({keys:e.record(e.string(),e.string()),name:e.string().optional(),traits:e.record(e.string(),e.unknown()).optional()});var Ru=e.object({company:zu.optional(),keys:e.record(e.string(),e.string()),name:e.string().optional(),traits:e.record(e.string(),e.unknown()).optional()});var fu=e.object({company:e.record(e.string(),e.string()).optional(),event:e.string(),quantity:e.number().optional(),traits:e.record(e.string(),e.unknown()).optional(),user:e.record(e.string(),e.string()).optional()});var _u=e.undiscriminatedUnion([fu,bu,Ru]);var Ne=e.enum_(["flag_check","identify","track"]);var Ii=e.object({body:_u.optional(),eventType:e.property("event_type",Ne),sentAt:e.property("sent_at",e.date().optional())});var jt=e.object({events:e.list(Ii)});var Ki=e.object({capturedAt:e.property("captured_at",e.date()),eventId:e.property("event_id",e.string().optional()),remoteAddr:e.property("remote_addr",e.string().optional()),remoteIp:e.property("remote_ip",e.string()),userAgent:e.property("user_agent",e.string())});var Su=e.object({events:e.list(Ki)});var Pu=e.object({data:Su,params:e.record(e.string(),e.unknown())});var xu=e.object({data:Ki,params:e.record(e.string(),e.unknown())});var Eu=e.enum_(["enriched","failed","pending","processed","unknown"]);var Gi=e.object({apiKey:e.property("api_key",e.string().optional()),body:e.record(e.string(),e.unknown()),bodyPreview:e.property("body_preview",e.string()),capturedAt:e.property("captured_at",e.date()),company:kr.optional(),companyId:e.property("company_id",e.string().optional()),enrichedAt:e.property("enriched_at",e.date().optional()),environmentId:e.property("environment_id",e.string().optional()),errorMessage:e.property("error_message",e.string().optional()),featureIds:e.property("feature_ids",e.list(e.string())),features:e.list(kr),id:e.string(),loadedAt:e.property("loaded_at",e.date().optional()),processedAt:e.property("processed_at",e.date().optional()),quantity:e.number(),sentAt:e.property("sent_at",e.date().optional()),status:Eu,subtype:e.string().optional(),type:Ne,updatedAt:e.property("updated_at",e.date().optional()),user:kr.optional(),userId:e.property("user_id",e.string().optional())});var Cu=e.object({data:Gi,params:e.record(e.string(),e.unknown())});var Uu=e.object({eventSubtypes:e.property("event_subtypes",e.list(e.string()).optional()),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var Tu=e.object({data:e.list(Bi),params:Uu});var vu=e.object({connected:e.boolean(),environmentId:e.property("environment_id",e.string()),lastEventAt:e.property("last_event_at",e.date().optional())});var Ou=e.object({data:vu,params:e.record(e.string(),e.unknown())});var ju=e.object({companyId:e.property("company_id",e.string().optional()),eventSubtype:e.property("event_subtype",e.string().optional()),eventTypes:e.property("event_types",e.list(Ne).optional()),flagId:e.property("flag_id",e.string().optional()),limit:e.number().optional(),offset:e.number().optional(),userId:e.property("user_id",e.string().optional())});var ku=e.object({data:e.list(Gi),params:ju});var ni=e.object({company:e.record(e.string(),e.string()).optional(),user:e.record(e.string(),e.string()).optional()});var kt=e.object({contexts:e.list(ni)});var Li=e.object({defaultValue:e.property("default_value",e.boolean()),description:e.string(),featureId:e.property("feature_id",e.string().optional()),flagType:e.property("flag_type",ir),id:e.string().optional(),key:e.string(),maintainerId:e.property("maintainer_id",e.string().optional()),name:e.string()});var Bt=e.object({description:e.string(),eventSubtype:e.property("event_subtype",e.string().optional()),featureType:e.property("feature_type",te),flag:Li.optional(),icon:e.string().optional(),lifecyclePhase:e.property("lifecycle_phase",er.optional()),maintainerId:e.property("maintainer_id",e.string().optional()),name:e.string(),pluralName:e.property("plural_name",e.string().optional()),singularName:e.property("singular_name",e.string().optional()),traitId:e.property("trait_id",e.string().optional())});var At=e.object({description:e.string().optional(),eventSubtype:e.property("event_subtype",e.string().optional()),featureType:e.property("feature_type",te.optional()),flag:Li.optional(),icon:e.string().optional(),lifecyclePhase:e.property("lifecycle_phase",er.optional()),maintainerId:e.property("maintainer_id",e.string().optional()),name:e.string().optional(),pluralName:e.property("plural_name",e.string().optional()),singularName:e.property("singular_name",e.string().optional()),traitId:e.property("trait_id",e.string().optional())});var Bu=e.enum_(["company","metric","trait","user","plan","billing_product","base_plan"]);var Au=e.enum_(["all_time","current_month","current_week","current_day"]);var Vu=e.enum_(["first_of_month","billing_cycle"]);var qu=e.enum_(["eq","ne","gt","gte","lt","lte","is_empty","not_empty"]);var Wi=e.object({comparisonTraitId:e.property("comparison_trait_id",e.string().optional()),conditionType:e.property("condition_type",Bu),creditCost:e.property("credit_cost",e.number().optional()),creditId:e.property("credit_id",e.string().optional()),eventSubtype:e.property("event_subtype",e.string().optional()),id:e.string().optional(),metricPeriod:e.property("metric_period",Au.optional()),metricPeriodMonthReset:e.property("metric_period_month_reset",Vu.optional()),metricValue:e.property("metric_value",e.number().optional()),operator:qu,resourceIds:e.property("resource_ids",e.list(e.string())),traitId:e.property("trait_id",e.string().optional()),traitValue:e.property("trait_value",e.string().optional())});var Du=e.object({conditions:e.list(Wi),flagId:e.property("flag_id",e.string().optional()),id:e.string().optional()});var Mu=e.enum_(["global_override","company_override","plan_entitlement","standard","default"]);var Fu=e.object({conditionGroups:e.property("condition_groups",e.list(Du)),conditions:e.list(Wi),id:e.string().optional(),name:e.string(),priority:e.number(),ruleType:e.property("rule_type",Mu.optional()),value:e.boolean()});var Vt=e.object({rules:e.list(Fu)});var Ni=e.object({companyId:e.property("company_id",e.string().optional()),error:e.string().optional(),featureAllocation:e.property("feature_allocation",e.number().optional()),featureUsage:e.property("feature_usage",e.number().optional()),featureUsageEvent:e.property("feature_usage_event",e.string().optional()),featureUsagePeriod:e.property("feature_usage_period",e.string().optional()),featureUsageResetAt:e.property("feature_usage_reset_at",e.date().optional()),flag:e.string(),flagId:e.property("flag_id",e.string().optional()),reason:e.string(),ruleId:e.property("rule_id",e.string().optional()),ruleType:e.property("rule_type",e.string().optional()),userId:e.property("user_id",e.string().optional()),value:e.boolean()});var Iu=e.object({data:Ni,params:e.record(e.string(),e.unknown())});var Hi=e.object({flags:e.list(Ni)});var Ku=e.object({data:e.list(Hi)});var Gu=e.object({data:Ku,params:e.record(e.string(),e.unknown())});var Lu=e.object({data:Hi,params:e.record(e.string(),e.unknown())});var Wu=e.object({booleanRequireEvent:e.property("boolean_require_event",e.boolean().optional()),featureType:e.property("feature_type",e.list(te).optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional(),withoutCompanyOverrideFor:e.property("without_company_override_for",e.string().optional()),withoutPlanEntitlementFor:e.property("without_plan_entitlement_for",e.string().optional())});var Nu=e.object({data:A,params:Wu});var Hu=e.object({featureId:e.property("feature_id",e.string().optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var $u=e.object({data:A,params:Hu});var Zu=e.object({data:ee,params:e.record(e.string(),e.unknown())});var Ju=e.object({data:Ae,params:e.record(e.string(),e.unknown())});var Qu=e.object({data:D,params:e.record(e.string(),e.unknown())});var Yu=e.object({data:D,params:e.record(e.string(),e.unknown())});var Xu=e.object({data:ee,params:e.record(e.string(),e.unknown())});var ed=e.object({data:Ae,params:e.record(e.string(),e.unknown())});var rd=e.object({booleanRequireEvent:e.property("boolean_require_event",e.boolean().optional()),featureType:e.property("feature_type",e.list(te).optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional(),withoutCompanyOverrideFor:e.property("without_company_override_for",e.string().optional()),withoutPlanEntitlementFor:e.property("without_plan_entitlement_for",e.string().optional())});var id=e.object({data:e.list(ee),params:rd});var od=e.object({featureId:e.property("feature_id",e.string().optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var td=e.object({data:e.list(Ae),params:od});var ad=e.object({data:ee,params:e.record(e.string(),e.unknown())});var sd=e.object({data:Ae,params:e.record(e.string(),e.unknown())});var nd=e.object({createdAt:e.property("created_at",e.date()),defaultValue:e.property("default_value",e.boolean()),description:e.string(),featureId:e.property("feature_id",e.string().optional()),flagType:e.property("flag_type",ir),id:e.string(),key:e.string(),maintainerId:e.property("maintainer_id",e.string().optional()),name:e.string(),updatedAt:e.property("updated_at",e.date())});var cd=e.object({flag:nd.optional(),rules:e.list(Vi)});var ld=e.object({data:cd,params:e.record(e.string(),e.unknown())});var $i=e.object({description:e.string(),icon:e.string().optional(),name:e.string(),planType:e.property("plan_type",ae)});var Zi=e.stringLiteral("credit");var Ji=e.object({applyToExisting:e.property("apply_to_existing",e.boolean().optional()),autoTopupAmount:e.property("auto_topup_amount",e.number().optional()),autoTopupAmountType:e.property("auto_topup_amount_type",Zi.optional()),autoTopupEnabled:e.property("auto_topup_enabled",e.boolean().optional()),autoTopupExpiryType:e.property("auto_topup_expiry_type",N.optional()),autoTopupExpiryUnit:e.property("auto_topup_expiry_unit",G.optional()),autoTopupExpiryUnitCount:e.property("auto_topup_expiry_unit_count",e.number().optional()),autoTopupThresholdPercent:e.property("auto_topup_threshold_percent",e.number().optional()),creditAmount:e.property("credit_amount",e.number()),creditId:e.property("credit_id",e.string()),expiryType:e.property("expiry_type",N.optional()),expiryUnit:e.property("expiry_unit",G.optional()),expiryUnitCount:e.property("expiry_unit_count",e.number().optional()),planId:e.property("plan_id",e.string()),resetCadence:e.property("reset_cadence",fe),resetStart:e.property("reset_start",Be),resetType:e.property("reset_type",Xe.optional())});var pd=e.object({applyToExisting:e.property("apply_to_existing",e.boolean().optional())});var Qi=e.enum_(["create","update","delete"]);var Yi=e.object({applyToExisting:e.property("apply_to_existing",e.boolean().optional()),autoTopupAmount:e.property("auto_topup_amount",e.number().optional()),autoTopupAmountType:e.property("auto_topup_amount_type",Zi.optional()),autoTopupEnabled:e.property("auto_topup_enabled",e.boolean().optional()),autoTopupExpiryType:e.property("auto_topup_expiry_type",N.optional()),autoTopupExpiryUnit:e.property("auto_topup_expiry_unit",G.optional()),autoTopupExpiryUnitCount:e.property("auto_topup_expiry_unit_count",e.number().optional()),autoTopupThresholdPercent:e.property("auto_topup_threshold_percent",e.number().optional()),creditAmount:e.property("credit_amount",e.number().optional()),expiryType:e.property("expiry_type",N.optional()),expiryUnit:e.property("expiry_unit",G.optional()),expiryUnitCount:e.property("expiry_unit_count",e.number().optional()),resetCadence:e.property("reset_cadence",fe),resetStart:e.property("reset_start",Be),resetType:e.property("reset_type",Xe.optional())});var Xi=e.object({action:Qi,createReq:e.property("create_req",Ji.optional()),creditGrantId:e.property("credit_grant_id",e.string().optional()),deleteReq:e.property("delete_req",pd.optional()),updateReq:e.property("update_req",Yi.optional())});var ud=e.enum_(["all_time","current_month","current_week","current_day"]);var dd=e.enum_(["first_of_month","billing_cycle"]);var md=e.object({billingProductId:e.property("billing_product_id",e.string().optional()),billingThreshold:e.property("billing_threshold",e.number().optional()),creditConsumptionRate:e.property("credit_consumption_rate",e.number().optional()),currency:e.string().optional(),featureId:e.property("feature_id",e.string()),metricPeriod:e.property("metric_period",ud.optional()),metricPeriodMonthReset:e.property("metric_period_month_reset",dd.optional()),monthlyMeteredPriceId:e.property("monthly_metered_price_id",e.string().optional()),monthlyPriceTiers:e.property("monthly_price_tiers",e.list(Ue).optional()),monthlyUnitPrice:e.property("monthly_unit_price",e.number().optional()),monthlyUnitPriceDecimal:e.property("monthly_unit_price_decimal",e.string().optional()),overageBillingProductId:e.property("overage_billing_product_id",e.string().optional()),priceBehavior:e.property("price_behavior",ye.optional()),priceTiers:e.property("price_tiers",e.list(Ue).optional()),softLimit:e.property("soft_limit",e.number().optional()),tierMode:e.property("tier_mode",ie.optional()),valueBool:e.property("value_bool",e.boolean().optional()),valueCreditId:e.property("value_credit_id",e.string().optional()),valueNumeric:e.property("value_numeric",e.number().optional()),valueTraitId:e.property("value_trait_id",e.string().optional()),valueType:e.property("value_type",Y),yearlyMeteredPriceId:e.property("yearly_metered_price_id",e.string().optional()),yearlyPriceTiers:e.property("yearly_price_tiers",e.list(Ue).optional()),yearlyUnitPrice:e.property("yearly_unit_price",e.number().optional()),yearlyUnitPriceDecimal:e.property("yearly_unit_price_decimal",e.string().optional())});var eo=e.object({action:Qi,entitlementId:e.property("entitlement_id",e.string().optional()),req:md.optional()});var Wr=e.object({billingProductId:e.property("billing_product_id",e.string().optional()),chargeType:e.property("charge_type",De),currency:e.string().optional(),isTrialable:e.property("is_trialable",e.boolean()),monthlyPrice:e.property("monthly_price",e.number().optional()),monthlyPriceId:e.property("monthly_price_id",e.string().optional()),oneTimePrice:e.property("one_time_price",e.number().optional()),oneTimePriceId:e.property("one_time_price_id",e.string().optional()),trialDays:e.property("trial_days",e.number().optional()),yearlyPrice:e.property("yearly_price",e.number().optional()),yearlyPriceId:e.property("yearly_price_id",e.string().optional())});var qt=e.object({billingProduct:e.property("billing_product",Wr.optional()),creditGrants:e.property("credit_grants",e.list(Xi).optional()),entitlements:e.list(eo),plan:$i.optional(),traits:e.list(Dr).optional()});var ro=e.object({description:e.string().optional(),icon:e.string().optional(),name:e.string()});var Dt=e.object({billingProduct:e.property("billing_product",Wr.optional()),creditGrants:e.property("credit_grants",e.list(Xi).optional()),entitlements:e.list(eo),plan:ro.optional(),traits:e.list(Dr).optional()});var io=e.object({accountId:e.property("account_id",e.string()),billingProductId:e.property("billing_product_id",e.string()),chargeType:e.property("charge_type",De),controlledBy:e.property("controlled_by",tr),environmentId:e.property("environment_id",e.string()),isTrialable:e.property("is_trialable",e.boolean()),monthlyPriceId:e.property("monthly_price_id",e.string().optional()),oneTimePriceId:e.property("one_time_price_id",e.string().optional()),planId:e.property("plan_id",e.string()),trialDays:e.property("trial_days",e.number().optional()),yearlyPriceId:e.property("yearly_price_id",e.string().optional())});var oo=e.object({billingProduct:e.property("billing_product",io.optional()),creditGrants:e.property("credit_grants",e.list(xe).optional()),entitlements:e.list(re).optional(),plan:qe.optional(),traits:e.list(Ee).optional()});var hd=e.object({data:oo,params:e.record(e.string(),e.unknown())});var gd=e.object({data:oo,params:e.record(e.string(),e.unknown())});var yd=e.object({entitlementId:e.property("entitlement_id",e.string()),visible:e.boolean().optional()});var He=e.object({entitlements:e.list(yd).optional(),planId:e.property("plan_id",e.string())});var Nr=e.object({bundleId:e.string()});var to=e.enum_(["create_prorations","invoice_immediately"]);var Mt=e.object({addOnCompatibilities:e.property("add_on_compatibilities",e.list(Gr).optional()),addOnIds:e.property("add_on_ids",e.list(e.string())),checkoutCollectAddress:e.property("checkout_collect_address",e.boolean()),checkoutCollectEmail:e.property("checkout_collect_email",e.boolean()),checkoutCollectPhone:e.property("checkout_collect_phone",e.boolean()),customPlanConfig:e.property("custom_plan_config",Kr.optional()),customPlanId:e.property("custom_plan_id",e.string().optional()),enableTaxCollection:e.property("enable_tax_collection",e.boolean()),fallbackPlanId:e.property("fallback_plan_id",e.string().optional()),initialPlanId:e.property("initial_plan_id",e.string().optional()),initialPlanPriceId:e.property("initial_plan_price_id",e.string().optional()),orderedAddOns:e.property("ordered_add_ons",e.list(He)),orderedBundleList:e.property("ordered_bundle_list",e.list(Nr)),orderedPlans:e.property("ordered_plans",e.list(He)),preventDowngradesWhenOverLimit:e.property("prevent_downgrades_when_over_limit",e.boolean()),preventSelfServiceDowngrade:e.property("prevent_self_service_downgrade",e.boolean()),preventSelfServiceDowngradeButtonText:e.property("prevent_self_service_downgrade_button_text",e.string().optional()),preventSelfServiceDowngradeUrl:e.property("prevent_self_service_downgrade_url",e.string().optional()),prorationBehavior:e.property("proration_behavior",to),showAsMonthlyPrices:e.property("show_as_monthly_prices",e.boolean()),showCredits:e.property("show_credits",e.boolean()),showPeriodToggle:e.property("show_period_toggle",e.boolean()),showZeroPriceAsFree:e.property("show_zero_price_as_free",e.boolean()),syncCustomerBillingDetails:e.property("sync_customer_billing_details",e.boolean()),trialDays:e.property("trial_days",e.number().optional()),trialExpiryPlanId:e.property("trial_expiry_plan_id",e.string().optional()),trialExpiryPlanPriceId:e.property("trial_expiry_plan_price_id",e.string().optional()),trialPaymentMethodRequired:e.property("trial_payment_method_required",e.boolean().optional())});var Ft=e.object({addOnCompatibilities:e.property("add_on_compatibilities",e.list(Gr).optional()),addOnIds:e.property("add_on_ids",e.list(e.string())),checkoutCollectAddress:e.property("checkout_collect_address",e.boolean()),checkoutCollectEmail:e.property("checkout_collect_email",e.boolean()),checkoutCollectPhone:e.property("checkout_collect_phone",e.boolean()),customPlanConfig:e.property("custom_plan_config",Kr.optional()),customPlanId:e.property("custom_plan_id",e.string().optional()),enableTaxCollection:e.property("enable_tax_collection",e.boolean()),fallbackPlanId:e.property("fallback_plan_id",e.string().optional()),initialPlanId:e.property("initial_plan_id",e.string().optional()),initialPlanPriceId:e.property("initial_plan_price_id",e.string().optional()),orderedAddOns:e.property("ordered_add_ons",e.list(He)),orderedBundleList:e.property("ordered_bundle_list",e.list(Nr)),orderedPlans:e.property("ordered_plans",e.list(He)),preventDowngradesWhenOverLimit:e.property("prevent_downgrades_when_over_limit",e.boolean()),preventSelfServiceDowngrade:e.property("prevent_self_service_downgrade",e.boolean()),preventSelfServiceDowngradeButtonText:e.property("prevent_self_service_downgrade_button_text",e.string().optional()),preventSelfServiceDowngradeUrl:e.property("prevent_self_service_downgrade_url",e.string().optional()),prorationBehavior:e.property("proration_behavior",to),showAsMonthlyPrices:e.property("show_as_monthly_prices",e.boolean()),showCredits:e.property("show_credits",e.boolean()),showPeriodToggle:e.property("show_period_toggle",e.boolean()),showZeroPriceAsFree:e.property("show_zero_price_as_free",e.boolean()),syncCustomerBillingDetails:e.property("sync_customer_billing_details",e.boolean()),trialDays:e.property("trial_days",e.number().optional()),trialExpiryPlanId:e.property("trial_expiry_plan_id",e.string().optional()),trialExpiryPlanPriceId:e.property("trial_expiry_plan_price_id",e.string().optional()),trialPaymentMethodRequired:e.property("trial_payment_method_required",e.boolean().optional())});var ao=e.object({collectAddress:e.property("collect_address",e.boolean()),collectEmail:e.property("collect_email",e.boolean()),collectPhone:e.property("collect_phone",e.boolean())});var wd=e.object({compatiblePlanIds:e.property("compatible_plan_ids",e.list(e.string())),sourcePlanId:e.property("source_plan_id",e.string())});var so=e.object({showAsMonthlyPrices:e.property("show_as_monthly_prices",e.boolean()),showCredits:e.property("show_credits",e.boolean()),showPeriodToggle:e.property("show_period_toggle",e.boolean()),showZeroPriceAsFree:e.property("show_zero_price_as_free",e.boolean())});var no=e.object({addOnCompatibilities:e.property("add_on_compatibilities",e.list(wd)),addOnIds:e.property("add_on_ids",e.list(e.string())),checkoutSettings:e.property("checkout_settings",ao),componentSettings:e.property("component_settings",so),defaultPlanId:e.property("default_plan_id",e.string().optional()),fallbackPlanId:e.property("fallback_plan_id",e.string().optional()),id:e.string(),initialPlanId:e.property("initial_plan_id",e.string().optional()),initialPlanPriceId:e.property("initial_plan_price_id",e.string().optional()),orderedAddOnIds:e.property("ordered_add_on_ids",e.list(He)),planIds:e.property("plan_ids",e.list(He)),preventDowngradesWhenOverLimit:e.property("prevent_downgrades_when_over_limit",e.boolean()),preventSelfServiceDowngrade:e.property("prevent_self_service_downgrade",e.boolean()),preventSelfServiceDowngradeButtonText:e.property("prevent_self_service_downgrade_button_text",e.string().optional()),preventSelfServiceDowngradeUrl:e.property("prevent_self_service_downgrade_url",e.string().optional()),prorationBehavior:e.property("proration_behavior",e.string()),showAsMonthlyPrices:e.property("show_as_monthly_prices",e.boolean()),showCredits:e.property("show_credits",e.boolean()),showPeriodToggle:e.property("show_period_toggle",e.boolean()),showZeroPriceAsFree:e.property("show_zero_price_as_free",e.boolean()),syncCustomerBillingDetails:e.property("sync_customer_billing_details",e.boolean()),taxCollectionEnabled:e.property("tax_collection_enabled",e.boolean()),trialDays:e.property("trial_days",e.number().optional()),trialExpiryPlanId:e.property("trial_expiry_plan_id",e.string().optional()),trialExpiryPlanPriceId:e.property("trial_expiry_plan_price_id",e.string().optional()),trialPaymentMethodRequired:e.property("trial_payment_method_required",e.boolean().optional())});var bd=e.object({data:no,params:e.record(e.string(),e.unknown())});var co=e.object({ctaText:e.property("cta_text",e.string()),ctaWebSite:e.property("cta_web_site",e.string()),priceText:e.property("price_text",e.string())});var mr=e.object({audienceType:e.property("audience_type",e.string().optional()),billingProduct:e.property("billing_product",Qe.optional()),chargeType:e.property("charge_type",De),companyCount:e.property("company_count",e.number()),compatiblePlanIds:e.property("compatible_plan_ids",e.list(e.string())),controlledBy:e.property("controlled_by",tr),createdAt:e.property("created_at",e.date()),customPlanConfig:e.property("custom_plan_config",co.optional()),description:e.string(),entitlements:e.list(re),features:e.list(ee),icon:e.string(),id:e.string(),includedCreditGrants:e.property("included_credit_grants",e.list(xe).optional()),isCustom:e.property("is_custom",e.boolean()),isDefault:e.property("is_default",e.boolean()),isFree:e.property("is_free",e.boolean()),isTrialable:e.property("is_trialable",e.boolean()),monthlyPrice:e.property("monthly_price",Q.optional()),name:e.string(),oneTimePrice:e.property("one_time_price",Q.optional()),planType:e.property("plan_type",ae),trialDays:e.property("trial_days",e.number().optional()),updatedAt:e.property("updated_at",e.date()),versions:e.list(qr),yearlyPrice:e.property("yearly_price",Q.optional())});var zd=e.object({planEntitlementId:e.property("plan_entitlement_id",e.string()),visible:e.boolean().optional()});var It=e.object({entitlements:e.list(zd).optional(),planId:e.property("plan_id",e.string())});var Rd=e.object({addOns:e.property("add_ons",e.list(mr)),checkoutSettings:e.property("checkout_settings",ao),componentSettings:e.property("component_settings",so),customPlanConfig:e.property("custom_plan_config",co.optional()),customPlanId:e.property("custom_plan_id",e.string().optional()),defaultPlan:e.property("default_plan",mr.optional()),defaultPlanId:e.property("default_plan_id",e.string().optional()),fallbackPlan:e.property("fallback_plan",mr.optional()),fallbackPlanId:e.property("fallback_plan_id",e.string().optional()),id:e.string(),initialPlan:e.property("initial_plan",mr.optional()),initialPlanId:e.property("initial_plan_id",e.string().optional()),initialPlanPrice:e.property("initial_plan_price",J.optional()),initialPlanPriceId:e.property("initial_plan_price_id",e.string().optional()),orderedAddOnList:e.property("ordered_add_on_list",e.list(It)),orderedBundleList:e.property("ordered_bundle_list",e.list(Nr)),orderedPlanList:e.property("ordered_plan_list",e.list(It)),plans:e.list(mr),preventDowngradesWhenOverLimit:e.property("prevent_downgrades_when_over_limit",e.boolean()),preventSelfServiceDowngrade:e.property("prevent_self_service_downgrade",e.boolean()),preventSelfServiceDowngradeButtonText:e.property("prevent_self_service_downgrade_button_text",e.string().optional()),preventSelfServiceDowngradeUrl:e.property("prevent_self_service_downgrade_url",e.string().optional()),prorationBehavior:e.property("proration_behavior",e.string()),showAsMonthlyPrices:e.property("show_as_monthly_prices",e.boolean()),showCredits:e.property("show_credits",e.boolean()),showPeriodToggle:e.property("show_period_toggle",e.boolean()),showZeroPriceAsFree:e.property("show_zero_price_as_free",e.boolean()),syncCustomerBillingDetails:e.property("sync_customer_billing_details",e.boolean()),taxCollectionEnabled:e.property("tax_collection_enabled",e.boolean()),trialDays:e.property("trial_days",e.number().optional()),trialExpiryPlan:e.property("trial_expiry_plan",mr.optional()),trialExpiryPlanId:e.property("trial_expiry_plan_id",e.string().optional()),trialExpiryPlanPrice:e.property("trial_expiry_plan_price",J.optional()),trialExpiryPlanPriceId:e.property("trial_expiry_plan_price_id",e.string().optional()),trialPaymentMethodRequired:e.property("trial_payment_method_required",e.boolean().optional())});var fd=e.object({data:Rd,params:e.record(e.string(),e.unknown())});var _d=e.object({data:no,params:e.record(e.string(),e.unknown())});var Kt=e.object({addOnIds:e.property("add_on_ids",e.list(e.string())),basePlanId:e.property("base_plan_id",e.string().optional())});var Sd=e.object({companyId:e.property("company_id",e.string().optional()),forFallbackPlan:e.property("for_fallback_plan",e.boolean().optional()),forInitialPlan:e.property("for_initial_plan",e.boolean().optional()),forTrialExpiryPlan:e.property("for_trial_expiry_plan",e.boolean().optional()),hasProductId:e.property("has_product_id",e.boolean().optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),planType:e.property("plan_type",ae.optional()),q:e.string().optional(),withoutEntitlementFor:e.property("without_entitlement_for",e.string().optional()),withoutPaidProductId:e.property("without_paid_product_id",e.boolean().optional())});var Pd=e.object({data:A,params:Sd});var xd=e.object({data:de,params:e.record(e.string(),e.unknown())});var Ed=e.object({data:D,params:e.record(e.string(),e.unknown())});var Cd=e.object({data:de,params:e.record(e.string(),e.unknown())});var Ud=e.object({planId:e.property("plan_id",e.string().optional())});var Td=e.object({code:e.string(),description:e.string(),detail:e.string().optional(),id:e.string().optional()});var vd=e.object({data:e.list(Td),params:Ud});var Od=e.object({companyId:e.property("company_id",e.string().optional()),forFallbackPlan:e.property("for_fallback_plan",e.boolean().optional()),forInitialPlan:e.property("for_initial_plan",e.boolean().optional()),forTrialExpiryPlan:e.property("for_trial_expiry_plan",e.boolean().optional()),hasProductId:e.property("has_product_id",e.boolean().optional()),ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),planType:e.property("plan_type",ae.optional()),q:e.string().optional(),withoutEntitlementFor:e.property("without_entitlement_for",e.string().optional()),withoutPaidProductId:e.property("without_paid_product_id",e.boolean().optional())});var jd=e.object({data:e.list(de),params:Od});var kd=e.object({data:L,params:e.record(e.string(),e.unknown())});var Bd=e.object({data:de,params:e.record(e.string(),e.unknown())});var Ad=e.object({data:io,params:e.record(e.string(),e.unknown())});var Hr=e.object({creditId:e.property("credit_id",e.string())});var $r=e.object({featureId:e.property("feature_id",e.string())});var sr=e.enum_(["subscription.trial.ended","company.created","company.deleted","company.override.created","company.override.deleted","company.override.expired","company.override.updated","company.plan_changed","company.updated","credit.limit.reached","credit.limit.warning","entitlement.limit.reached","entitlement.limit.warning","entitlement.soft_limit.reached","entitlement.soft_limit.warning","entitlement.tier_limit.reached","entitlement.tier_limit.warning","feature.created","feature.deleted","feature.updated","flag.created","flag.deleted","flag_rules.updated","flag.updated","plan.created","plan.deleted","plan.entitlement.created","plan.entitlement.deleted","plan.entitlement.updated","plan.updated","rule.deleted","test.send","user.created","user.deleted","user.updated","auto.topup.hard.failure","auto.topup.retry.exceeded"]);var Gt=e.object({creditTriggerConfigs:e.property("credit_trigger_configs",e.list(Hr).optional()),entitlementTriggerConfigs:e.property("entitlement_trigger_configs",e.list($r).optional()),name:e.string(),requestTypes:e.property("request_types",e.list(sr)),url:e.string()});var lo=e.enum_(["active","inactive"]);var Lt=e.object({creditTriggerConfigs:e.property("credit_trigger_configs",e.list(Hr).optional()),entitlementTriggerConfigs:e.property("entitlement_trigger_configs",e.list($r).optional()),name:e.string().optional(),requestTypes:e.property("request_types",e.list(sr).optional()),status:lo.optional(),url:e.string().optional()});var Vd=e.object({ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional(),webhookId:e.property("webhook_id",e.string().optional())});var qd=e.object({data:A,params:Vd});var Dd=e.object({limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var Md=e.object({data:A,params:Dd});var Fe=e.object({createdAt:e.property("created_at",e.date()),creditTriggerConfigs:e.property("credit_trigger_configs",e.list(Hr).optional()),entitlementTriggerConfigs:e.property("entitlement_trigger_configs",e.list($r).optional()),id:e.string(),name:e.string(),requestTypes:e.property("request_types",e.list(sr)),secret:e.string(),status:lo,updatedAt:e.property("updated_at",e.date()),url:e.string()});var Fd=e.object({data:Fe,params:e.record(e.string(),e.unknown())});var Id=e.object({data:D,params:e.record(e.string(),e.unknown())});var Kd=e.enum_(["failure","pending","success"]);var po=e.object({createdAt:e.property("created_at",e.date()),id:e.string(),payload:e.string().optional(),requestType:e.property("request_type",sr),responseCode:e.property("response_code",e.number().optional()),sentAt:e.property("sent_at",e.date().optional()),status:Kd,updatedAt:e.property("updated_at",e.date()),webhook:Fe.optional(),webhookId:e.property("webhook_id",e.string())});var Gd=e.object({data:po,params:e.record(e.string(),e.unknown())});var Ld=e.object({data:Fe,params:e.record(e.string(),e.unknown())});var Wd=e.object({ids:e.list(e.string()).optional(),limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional(),webhookId:e.property("webhook_id",e.string().optional())});var Nd=e.object({data:e.list(po),params:Wd});var Hd=e.object({limit:e.number().optional(),offset:e.number().optional(),q:e.string().optional()});var $d=e.object({data:e.list(Fe),params:Hd});var Zd=e.object({data:Fe,params:e.record(e.string(),e.unknown())});var t=e.object({error:e.string()});var Jd=e.object({addOnId:e.property("add_on_id",e.string()),priceId:e.property("price_id",e.string())});var uo=e.object({bundleId:e.property("bundle_id",e.string()),quantity:e.number()});var mo=e.object({priceId:e.property("price_id",e.string()),quantity:e.number()});var Wt=e.object({addOnIds:e.property("add_on_ids",e.list(Jd)),companyId:e.property("company_id",e.string()),couponExternalId:e.property("coupon_external_id",e.string().optional()),creditBundles:e.property("credit_bundles",e.list(uo)),newPlanId:e.property("new_plan_id",e.string()),newPriceId:e.property("new_price_id",e.string()),payInAdvance:e.property("pay_in_advance",e.list(mo)),paymentMethodId:e.property("payment_method_id",e.string().optional()),promoCode:e.property("promo_code",e.string().optional()),skipTrial:e.property("skip_trial",e.boolean())});var Nt=e.object({defaultValue:e.property("default_value",e.boolean()),description:e.string(),featureId:e.property("feature_id",e.string().optional()),flagType:e.property("flag_type",ir),key:e.string(),maintainerId:e.property("maintainer_id",e.string().optional()),name:e.string()});var Ht=e.object({keys:e.record(e.string(),e.string())});var Qd=e.object({planId:e.property("plan_id",e.string()),priceId:e.property("price_id",e.string().optional())});var $t=e.object({addOnSelections:e.property("add_on_selections",e.list(Qd)),basePlanId:e.property("base_plan_id",e.string().optional()),basePlanPriceId:e.property("base_plan_price_id",e.string().optional()),cancelImmediately:e.property("cancel_immediately",e.boolean().optional()),companyId:e.property("company_id",e.string()),couponExternalId:e.property("coupon_external_id",e.string().optional()),creditBundles:e.property("credit_bundles",e.list(uo)),payInAdvanceEntitlements:e.property("pay_in_advance_entitlements",e.list(mo)),paymentMethodExternalId:e.property("payment_method_external_id",e.string().optional()),promoCode:e.property("promo_code",e.string().optional()),prorate:e.boolean().optional(),trialEnd:e.property("trial_end",e.date().optional())});var Zt=e.object({id:e.string().optional(),keys:e.record(e.string(),e.string()),lastSeenAt:e.property("last_seen_at",e.date().optional()),name:e.string().optional(),traits:e.record(e.string(),e.unknown()).optional(),updateOnly:e.property("update_only",e.boolean().optional())});var Jt=e.object({incr:e.number().optional(),keys:e.record(e.string(),e.string()),set:e.string().optional(),trait:e.string(),updateOnly:e.property("update_only",e.boolean().optional())});var Qt=e.object({companies:e.list(e.record(e.string(),e.string())).optional(),company:e.record(e.string(),e.string()).optional(),companyId:e.property("company_id",e.string().optional()),companyIds:e.property("company_ids",e.list(e.string()).optional()),id:e.string().optional(),keys:e.record(e.string(),e.string()),lastSeenAt:e.property("last_seen_at",e.date().optional()),name:e.string().optional(),traits:e.record(e.string(),e.unknown()).optional(),updateOnly:e.property("update_only",e.boolean().optional())});var ho=class{constructor(o){this._options=K(o)}issueTemporaryAccessToken(o,i){return R.fromPromise(this.__issueTemporaryAccessToken(o,i))}async __issueTemporaryAccessToken(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"temporary-access-tokens"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:{...$o.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),resource_type:"company"},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Rs.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/temporary-access-tokens")}};var go=class{constructor(o){this._options=K(o)}listApiKeys(o,i){return R.fromPromise(this.__listApiKeys(o,i))}async __listApiKeys(o,i){let{environmentId:a,requireEnvironment:n,limit:r,offset:s}=o,u={};a!=null&&(u.environment_id=a),u.require_environment=n.toString(),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"api-keys"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:Vs.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/api-keys")}createApiKey(o,i){return R.fromPromise(this.__createApiKey(o,i))}async __createApiKey(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"api-keys"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Zo.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Es.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/api-keys")}getApiKey(o,i){return R.fromPromise(this.__getApiKey(o,i))}async __getApiKey(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`api-keys/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Os.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/api-keys/{api_key_id}")}updateApiKey(o,i={},a){return R.fromPromise(this.__updateApiKey(o,i,a))}async __updateApiKey(o,i={},a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`api-keys/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:Qo.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:Gs.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/api-keys/{api_key_id}")}deleteApiKey(o,i){return R.fromPromise(this.__deleteApiKey(o,i))}async __deleteApiKey(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`api-keys/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Ts.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/api-keys/{api_key_id}")}countApiKeys(o,i){return R.fromPromise(this.__countApiKeys(o,i))}async __countApiKeys(o,i){let{environmentId:a,requireEnvironment:n,limit:r,offset:s}=o,u={};a!=null&&(u.environment_id=a),u.require_environment=n.toString(),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"api-keys/count"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:_s.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/api-keys/count")}listApiRequests(o={},i){return R.fromPromise(this.__listApiRequests(o,i))}async __listApiRequests(o={},i){let{q:a,requestType:n,environmentId:r,limit:s,offset:u}=o,g={};a!=null&&(g.q=a),n!=null&&(g.request_type=n),r!=null&&(g.environment_id=r),s!=null&&(g.limit=s.toString()),u!=null&&(g.offset=u.toString());let d=await this._options.authProvider.getAuthRequest(),l=f(d.headers,this._options?.headers,i?.headers),m=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"api-requests"),method:"GET",headers:l,queryParameters:{...g,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(m.ok)return{data:Ds.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new v(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 401:throw new C(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 403:throw new P(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 404:throw new E(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 500:throw new x(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new z({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return U(m.error,m.rawResponse,"GET","/api-requests")}getApiRequest(o,i){return R.fromPromise(this.__getApiRequest(o,i))}async __getApiRequest(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`api-requests/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:ks.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/api-requests/{api_request_id}")}countApiRequests(o={},i){return R.fromPromise(this.__countApiRequests(o,i))}async __countApiRequests(o={},i){let{q:a,requestType:n,environmentId:r,limit:s,offset:u}=o,g={};a!=null&&(g.q=a),n!=null&&(g.request_type=n),r!=null&&(g.environment_id=r),s!=null&&(g.limit=s.toString()),u!=null&&(g.offset=u.toString());let d=await this._options.authProvider.getAuthRequest(),l=f(d.headers,this._options?.headers,i?.headers),m=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"api-requests/count"),method:"GET",headers:l,queryParameters:{...g,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(m.ok)return{data:Ps.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new v(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 401:throw new C(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 403:throw new P(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 404:throw new E(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 500:throw new x(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new z({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return U(m.error,m.rawResponse,"GET","/api-requests/count")}listEnvironments(o={},i){return R.fromPromise(this.__listEnvironments(o,i))}async __listEnvironments(o={},i){let{ids:a,limit:n,offset:r}=o,s={};a!=null&&(Array.isArray(a)?s.ids=a.map(l=>l):s.ids=a),n!=null&&(s.limit=n.toString()),r!=null&&(s.offset=r.toString());let u=await this._options.authProvider.getAuthRequest(),g=f(u.headers,this._options?.headers,i?.headers),d=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"environments"),method:"GET",headers:g,queryParameters:{...s,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(d.ok)return{data:Fs.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:d.rawResponse};if(d.error.reason==="status-code")switch(d.error.statusCode){case 400:throw new v(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 401:throw new C(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 403:throw new P(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 404:throw new E(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 500:throw new x(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);default:throw new z({statusCode:d.error.statusCode,body:d.error.body,rawResponse:d.rawResponse})}return U(d.error,d.rawResponse,"GET","/environments")}createEnvironment(o,i){return R.fromPromise(this.__createEnvironment(o,i))}async __createEnvironment(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"environments"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Jo.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Us.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/environments")}getEnvironment(o,i){return R.fromPromise(this.__getEnvironment(o,i))}async __getEnvironment(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`environments/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Bs.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/environments/{environment_id}")}updateEnvironment(o,i={},a){return R.fromPromise(this.__updateEnvironment(o,i,a))}async __updateEnvironment(o,i={},a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`environments/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:Yo.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:Ls.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/environments/{environment_id}")}deleteEnvironment(o,i){return R.fromPromise(this.__deleteEnvironment(o,i))}async __deleteEnvironment(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`environments/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:vs.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/environments/{environment_id}")}quickstart(o){return R.fromPromise(this.__quickstart(o))}async __quickstart(o){let i=await this._options.authProvider.getAuthRequest(),a=f(i.headers,this._options?.headers,o?.headers),n=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"quickstart"),method:"POST",headers:a,queryParameters:o?.queryParams,timeoutMs:(o?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:o?.maxRetries??this._options?.maxRetries,abortSignal:o?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(n.ok)return{data:Ks.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.statusCode){case 400:throw new v(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);case 401:throw new C(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);case 403:throw new P(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);case 404:throw new E(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);case 500:throw new x(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);default:throw new z({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse})}return U(n.error,n.rawResponse,"POST","/quickstart")}};var yo=class{constructor(o){this._options=K(o)}listCoupons(o={},i){return R.fromPromise(this.__listCoupons(o,i))}async __listCoupons(o={},i){let{isActive:a,q:n,limit:r,offset:s}=o,u={};a!=null&&(u.is_active=a.toString()),n!=null&&(u.q=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/coupons"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:cn.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/billing/coupons")}upsertBillingCoupon(o,i){return R.fromPromise(this.__upsertBillingCoupon(o,i))}async __upsertBillingCoupon(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/coupons"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:ot.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:zn.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/billing/coupons")}upsertBillingCustomer(o,i){return R.fromPromise(this.__upsertBillingCustomer(o,i))}async __upsertBillingCustomer(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/customer/upsert"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Xo.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:fn.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/billing/customer/upsert")}listCustomersWithSubscriptions(o={},i){return R.fromPromise(this.__listCustomersWithSubscriptions(o,i))}async __listCustomersWithSubscriptions(o={},i){let{companyIds:a,name:n,providerType:r,q:s,limit:u,offset:g}=o,d={};a!=null&&(Array.isArray(a)?d.company_ids=a.map(j=>j):d.company_ids=a),n!=null&&(d.name=n),r!=null&&(d.provider_type=B.jsonOrThrow(r,{unrecognizedObjectKeys:"strip"})),s!=null&&(d.q=s),u!=null&&(d.limit=u.toString()),g!=null&&(d.offset=g.toString());let l=await this._options.authProvider.getAuthRequest(),m=f(l.headers,this._options?.headers,i?.headers),y=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/customers"),method:"GET",headers:m,queryParameters:{...d,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(y.ok)return{data:dn.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 400:throw new v(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 401:throw new C(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 403:throw new P(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 404:throw new E(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 500:throw new x(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);default:throw new z({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return U(y.error,y.rawResponse,"GET","/billing/customers")}countCustomers(o={},i){return R.fromPromise(this.__countCustomers(o,i))}async __countCustomers(o={},i){let{companyIds:a,name:n,providerType:r,q:s,limit:u,offset:g}=o,d={};a!=null&&(Array.isArray(a)?d.company_ids=a.map(j=>j):d.company_ids=a),n!=null&&(d.name=n),r!=null&&(d.provider_type=B.jsonOrThrow(r,{unrecognizedObjectKeys:"strip"})),s!=null&&(d.q=s),u!=null&&(d.limit=u.toString()),g!=null&&(d.offset=g.toString());let l=await this._options.authProvider.getAuthRequest(),m=f(l.headers,this._options?.headers,i?.headers),y=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/customers/count"),method:"GET",headers:m,queryParameters:{...d,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(y.ok)return{data:Qs.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 400:throw new v(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 401:throw new C(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 403:throw new P(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 404:throw new E(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 500:throw new x(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);default:throw new z({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return U(y.error,y.rawResponse,"GET","/billing/customers/count")}listInvoices(o,i){return R.fromPromise(this.__listInvoices(o,i))}async __listInvoices(o,i){let{companyId:a,customerExternalId:n,subscriptionExternalId:r,limit:s,offset:u}=o,g={};a!=null&&(g.company_id=a),g.customer_external_id=n,g.subscription_external_id=r,s!=null&&(g.limit=s.toString()),u!=null&&(g.offset=u.toString());let d=await this._options.authProvider.getAuthRequest(),l=f(d.headers,this._options?.headers,i?.headers),m=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/invoices"),method:"GET",headers:l,queryParameters:{...g,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(m.ok)return{data:hn.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new v(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 401:throw new C(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 403:throw new P(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 404:throw new E(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 500:throw new x(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new z({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return U(m.error,m.rawResponse,"GET","/billing/invoices")}upsertInvoice(o,i){return R.fromPromise(this.__upsertInvoice(o,i))}async __upsertInvoice(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/invoices"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:tt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Cn.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/billing/invoices")}listMeters(o={},i){return R.fromPromise(this.__listMeters(o,i))}async __listMeters(o={},i){let{displayName:a,limit:n,offset:r}=o,s={};a!=null&&(s.display_name=a),n!=null&&(s.limit=n.toString()),r!=null&&(s.offset=r.toString());let u=await this._options.authProvider.getAuthRequest(),g=f(u.headers,this._options?.headers,i?.headers),d=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/meter"),method:"GET",headers:g,queryParameters:{...s,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(d.ok)return{data:yn.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:d.rawResponse};if(d.error.reason==="status-code")switch(d.error.statusCode){case 400:throw new v(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 401:throw new C(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 403:throw new P(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 404:throw new E(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 500:throw new x(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);default:throw new z({statusCode:d.error.statusCode,body:d.error.body,rawResponse:d.rawResponse})}return U(d.error,d.rawResponse,"GET","/billing/meter")}upsertBillingMeter(o,i){return R.fromPromise(this.__upsertBillingMeter(o,i))}async __upsertBillingMeter(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/meter/upsert"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:at.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:_n.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/billing/meter/upsert")}listPaymentMethods(o,i){return R.fromPromise(this.__listPaymentMethods(o,i))}async __listPaymentMethods(o,i){let{companyId:a,customerExternalId:n,limit:r,offset:s}=o,u={};a!=null&&(u.company_id=a),u.customer_external_id=n,r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/payment-methods"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:bn.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/billing/payment-methods")}upsertPaymentMethod(o,i){return R.fromPromise(this.__upsertPaymentMethod(o,i))}async __upsertPaymentMethod(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/payment-methods"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:st.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Un.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/billing/payment-methods")}listBillingPrices(o={},i){return R.fromPromise(this.__listBillingPrices(o,i))}async __listBillingPrices(o={},i){let{forInitialPlan:a,forTrialExpiryPlan:n,ids:r,interval:s,isActive:u,price:g,productId:d,productIds:l,providerType:m,q:y,tiersMode:j,usageType:b,withMeter:T,limit:V,offset:H}=o,O={};a!=null&&(O.for_initial_plan=a.toString()),n!=null&&(O.for_trial_expiry_plan=n.toString()),r!=null&&(Array.isArray(r)?O.ids=r.map(M=>M):O.ids=r),s!=null&&(O.interval=s),u!=null&&(O.is_active=u.toString()),g!=null&&(O.price=g.toString()),d!=null&&(O.product_id=d),l!=null&&(Array.isArray(l)?O.product_ids=l.map(M=>M):O.product_ids=l),m!=null&&(O.provider_type=B.jsonOrThrow(m,{unrecognizedObjectKeys:"strip"})),y!=null&&(O.q=y),j!=null&&(O.tiers_mode=ie.jsonOrThrow(j,{unrecognizedObjectKeys:"strip"})),b!=null&&(O.usage_type=Z.jsonOrThrow(b,{unrecognizedObjectKeys:"strip"})),T!=null&&(O.with_meter=T.toString()),V!=null&&(O.limit=V.toString()),H!=null&&(O.offset=H.toString());let pe=await this._options.authProvider.getAuthRequest(),nr=f(pe.headers,this._options?.headers,i?.headers),k=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/price"),method:"GET",headers:nr,queryParameters:{...O,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(k.ok)return{data:rn.parseOrThrow(k.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:k.rawResponse};if(k.error.reason==="status-code")switch(k.error.statusCode){case 400:throw new v(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 401:throw new C(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 403:throw new P(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 404:throw new E(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 500:throw new x(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);default:throw new z({statusCode:k.error.statusCode,body:k.error.body,rawResponse:k.rawResponse})}return U(k.error,k.rawResponse,"GET","/billing/price")}upsertBillingPrice(o,i){return R.fromPromise(this.__upsertBillingPrice(o,i))}async __upsertBillingPrice(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/price/upsert"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:et.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Sn.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/billing/price/upsert")}deleteBillingProduct(o,i){return R.fromPromise(this.__deleteBillingProduct(o,i))}async __deleteBillingProduct(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`billing/product/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Ys.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/billing/product/{billing_id}")}listBillingProductPrices(o={},i){return R.fromPromise(this.__listBillingProductPrices(o,i))}async __listBillingProductPrices(o={},i){let{forInitialPlan:a,forTrialExpiryPlan:n,ids:r,interval:s,isActive:u,price:g,productId:d,productIds:l,providerType:m,q:y,tiersMode:j,usageType:b,withMeter:T,limit:V,offset:H}=o,O={};a!=null&&(O.for_initial_plan=a.toString()),n!=null&&(O.for_trial_expiry_plan=n.toString()),r!=null&&(Array.isArray(r)?O.ids=r.map(M=>M):O.ids=r),s!=null&&(O.interval=s),u!=null&&(O.is_active=u.toString()),g!=null&&(O.price=g.toString()),d!=null&&(O.product_id=d),l!=null&&(Array.isArray(l)?O.product_ids=l.map(M=>M):O.product_ids=l),m!=null&&(O.provider_type=B.jsonOrThrow(m,{unrecognizedObjectKeys:"strip"})),y!=null&&(O.q=y),j!=null&&(O.tiers_mode=ie.jsonOrThrow(j,{unrecognizedObjectKeys:"strip"})),b!=null&&(O.usage_type=Z.jsonOrThrow(b,{unrecognizedObjectKeys:"strip"})),T!=null&&(O.with_meter=T.toString()),V!=null&&(O.limit=V.toString()),H!=null&&(O.offset=H.toString());let pe=await this._options.authProvider.getAuthRequest(),nr=f(pe.headers,this._options?.headers,i?.headers),k=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/product/prices"),method:"GET",headers:nr,queryParameters:{...O,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(k.ok)return{data:tn.parseOrThrow(k.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:k.rawResponse};if(k.error.reason==="status-code")switch(k.error.statusCode){case 400:throw new v(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 401:throw new C(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 403:throw new P(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 404:throw new E(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 500:throw new x(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);default:throw new z({statusCode:k.error.statusCode,body:k.error.body,rawResponse:k.rawResponse})}return U(k.error,k.rawResponse,"GET","/billing/product/prices")}deleteProductPrice(o,i){return R.fromPromise(this.__deleteProductPrice(o,i))}async __deleteProductPrice(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`billing/product/prices/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Xs.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/billing/product/prices/{billing_id}")}upsertBillingProduct(o,i){return R.fromPromise(this.__upsertBillingProduct(o,i))}async __upsertBillingProduct(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/product/upsert"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:rt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Pn.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/billing/product/upsert")}listBillingProducts(o={},i){return R.fromPromise(this.__listBillingProducts(o,i))}async __listBillingProducts(o={},i){let{ids:a,isActive:n,name:r,priceUsageType:s,providerType:u,q:g,withOneTimeCharges:d,withPricesOnly:l,withZeroPrice:m,withoutLinkedToPlan:y,limit:j,offset:b}=o,T={};a!=null&&(Array.isArray(a)?T.ids=a.map(pe=>pe):T.ids=a),n!=null&&(T.is_active=n.toString()),r!=null&&(T.name=r),s!=null&&(T.price_usage_type=Z.jsonOrThrow(s,{unrecognizedObjectKeys:"strip"})),u!=null&&(T.provider_type=B.jsonOrThrow(u,{unrecognizedObjectKeys:"strip"})),g!=null&&(T.q=g),d!=null&&(T.with_one_time_charges=d.toString()),l!=null&&(T.with_prices_only=l.toString()),m!=null&&(T.with_zero_price=m.toString()),y!=null&&(T.without_linked_to_plan=y.toString()),j!=null&&(T.limit=j.toString()),b!=null&&(T.offset=b.toString());let V=await this._options.authProvider.getAuthRequest(),H=f(V.headers,this._options?.headers,i?.headers),O=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/products"),method:"GET",headers:H,queryParameters:{...T,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(O.ok)return{data:sn.parseOrThrow(O.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:O.rawResponse};if(O.error.reason==="status-code")switch(O.error.statusCode){case 400:throw new v(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 401:throw new C(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 403:throw new P(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 404:throw new E(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 500:throw new x(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);default:throw new z({statusCode:O.error.statusCode,body:O.error.body,rawResponse:O.rawResponse})}return U(O.error,O.rawResponse,"GET","/billing/products")}countBillingProducts(o={},i){return R.fromPromise(this.__countBillingProducts(o,i))}async __countBillingProducts(o={},i){let{ids:a,isActive:n,name:r,priceUsageType:s,providerType:u,q:g,withOneTimeCharges:d,withPricesOnly:l,withZeroPrice:m,withoutLinkedToPlan:y,limit:j,offset:b}=o,T={};a!=null&&(Array.isArray(a)?T.ids=a.map(pe=>pe):T.ids=a),n!=null&&(T.is_active=n.toString()),r!=null&&(T.name=r),s!=null&&(T.price_usage_type=Z.jsonOrThrow(s,{unrecognizedObjectKeys:"strip"})),u!=null&&(T.provider_type=B.jsonOrThrow(u,{unrecognizedObjectKeys:"strip"})),g!=null&&(T.q=g),d!=null&&(T.with_one_time_charges=d.toString()),l!=null&&(T.with_prices_only=l.toString()),m!=null&&(T.with_zero_price=m.toString()),y!=null&&(T.without_linked_to_plan=y.toString()),j!=null&&(T.limit=j.toString()),b!=null&&(T.offset=b.toString());let V=await this._options.authProvider.getAuthRequest(),H=f(V.headers,this._options?.headers,i?.headers),O=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/products/count"),method:"GET",headers:H,queryParameters:{...T,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(O.ok)return{data:Zs.parseOrThrow(O.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:O.rawResponse};if(O.error.reason==="status-code")switch(O.error.statusCode){case 400:throw new v(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 401:throw new C(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 403:throw new P(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 404:throw new E(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 500:throw new x(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);default:throw new z({statusCode:O.error.statusCode,body:O.error.body,rawResponse:O.rawResponse})}return U(O.error,O.rawResponse,"GET","/billing/products/count")}upsertBillingSubscription(o,i){return R.fromPromise(this.__upsertBillingSubscription(o,i))}async __upsertBillingSubscription(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/subscription/upsert"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:it.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:En.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/billing/subscription/upsert")}};var wo=class{constructor(o){this._options=K(o)}internal(o,i){return R.fromPromise(this.__internal(o,i))}async __internal(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"checkout-internal"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Wt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Dn.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/checkout-internal")}getCheckoutData(o,i){return R.fromPromise(this.__getCheckoutData(o,i))}async __getCheckoutData(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"checkout-internal/data"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:ct.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Wn.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/checkout-internal/data")}previewCheckoutInternal(o,i){return R.fromPromise(this.__previewCheckoutInternal(o,i))}async __previewCheckoutInternal(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"checkout-internal/preview"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Wt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Zn.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/checkout-internal/preview")}managePlan(o,i){return R.fromPromise(this.__managePlan(o,i))}async __managePlan(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"manage-plan"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:$t.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Nn.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/manage-plan")}previewManagePlan(o,i){return R.fromPromise(this.__previewManagePlan(o,i))}async __previewManagePlan(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"manage-plan/preview"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:$t.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Qn.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/manage-plan/preview")}cancelSubscription(o,i){return R.fromPromise(this.__cancelSubscription(o,i))}async __cancelSubscription(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"manage-plan/subscription/cancel"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:nt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Vn.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/manage-plan/subscription/cancel")}updateCustomerSubscriptionTrialEnd(o,i={},a){return R.fromPromise(this.__updateCustomerSubscriptionTrialEnd(o,i,a))}async __updateCustomerSubscriptionTrialEnd(o,i={},a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`subscription/${w.encodePathParam(o)}/edit-trial-end`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:lt.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:Yn.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/subscription/{subscription_id}/edit-trial-end")}};var bo=class{constructor(o){this._options=K(o)}listCompanies(o={},i){return R.fromPromise(this.__listCompanies(o,i))}async __listCompanies(o={},i){let{ids:a,planId:n,q:r,withoutFeatureOverrideFor:s,withoutPlan:u,withSubscription:g,limit:d,offset:l}=o,m={};a!=null&&(Array.isArray(a)?m.ids=a.map(T=>T):m.ids=a),n!=null&&(m.plan_id=n),r!=null&&(m.q=r),s!=null&&(m.without_feature_override_for=s),u!=null&&(m.without_plan=u.toString()),g!=null&&(m.with_subscription=g.toString()),d!=null&&(m.limit=d.toString()),l!=null&&(m.offset=l.toString());let y=await this._options.authProvider.getAuthRequest(),j=f(y.headers,this._options?.headers,i?.headers),b=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"companies"),method:"GET",headers:j,queryParameters:{...m,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(b.ok)return{data:Lc.parseOrThrow(b.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:b.rawResponse};if(b.error.reason==="status-code")switch(b.error.statusCode){case 400:throw new v(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 401:throw new C(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 403:throw new P(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 404:throw new E(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 500:throw new x(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);default:throw new z({statusCode:b.error.statusCode,body:b.error.body,rawResponse:b.rawResponse})}return U(b.error,b.rawResponse,"GET","/companies")}upsertCompany(o,i){return R.fromPromise(this.__upsertCompany(o,i))}async __upsertCompany(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"companies"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Zt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:pl.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/companies")}getCompany(o,i){return R.fromPromise(this.__getCompany(o,i))}async __getCompany(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`companies/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Sc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/companies/{company_id}")}deleteCompany(o,i={},a){return R.fromPromise(this.__deleteCompany(o,i,a))}async __deleteCompany(o,i={},a){let{cancelSubscription:n,prorate:r}=i,s={};n!=null&&(s.cancel_subscription=n.toString()),r!=null&&(s.prorate=r.toString());let u=await this._options.authProvider.getAuthRequest(),g=f(u.headers,this._options?.headers,a?.headers),d=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`companies/${w.encodePathParam(o)}`),method:"DELETE",headers:g,queryParameters:{...s,...a?.queryParams},timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(d.ok)return{data:wc.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:d.rawResponse};if(d.error.reason==="status-code")switch(d.error.statusCode){case 400:throw new v(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 401:throw new C(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 403:throw new P(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 404:throw new E(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 500:throw new x(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);default:throw new z({statusCode:d.error.statusCode,body:d.error.body,rawResponse:d.rawResponse})}return U(d.error,d.rawResponse,"DELETE","/companies/{company_id}")}countCompanies(o={},i){return R.fromPromise(this.__countCompanies(o,i))}async __countCompanies(o={},i){let{ids:a,planId:n,q:r,withoutFeatureOverrideFor:s,withoutPlan:u,withSubscription:g,limit:d,offset:l}=o,m={};a!=null&&(Array.isArray(a)?m.ids=a.map(T=>T):m.ids=a),n!=null&&(m.plan_id=n),r!=null&&(m.q=r),s!=null&&(m.without_feature_override_for=s),u!=null&&(m.without_plan=u.toString()),g!=null&&(m.with_subscription=g.toString()),d!=null&&(m.limit=d.toString()),l!=null&&(m.offset=l.toString());let y=await this._options.authProvider.getAuthRequest(),j=f(y.headers,this._options?.headers,i?.headers),b=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"companies/count"),method:"GET",headers:j,queryParameters:{...m,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(b.ok)return{data:ic.parseOrThrow(b.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:b.rawResponse};if(b.error.reason==="status-code")switch(b.error.statusCode){case 400:throw new v(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 401:throw new C(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 403:throw new P(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 404:throw new E(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 500:throw new x(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);default:throw new z({statusCode:b.error.statusCode,body:b.error.body,rawResponse:b.rawResponse})}return U(b.error,b.rawResponse,"GET","/companies/count")}countCompaniesForAdvancedFilter(o={},i){return R.fromPromise(this.__countCompaniesForAdvancedFilter(o,i))}async __countCompaniesForAdvancedFilter(o={},i){let{ids:a,planIds:n,featureIds:r,creditTypeIds:s,subscriptionStatuses:u,subscriptionTypes:g,monetizedSubscriptions:d,q:l,withoutPlan:m,withoutSubscription:y,sortOrderColumn:j,sortOrderDirection:b,displayProperties:T,limit:V,offset:H}=o,O={};a!=null&&(Array.isArray(a)?O.ids=a.map(M=>M):O.ids=a),n!=null&&(Array.isArray(n)?O.plan_ids=n.map(M=>M):O.plan_ids=n),r!=null&&(Array.isArray(r)?O.feature_ids=r.map(M=>M):O.feature_ids=r),s!=null&&(Array.isArray(s)?O.credit_type_ids=s.map(M=>M):O.credit_type_ids=s),u!=null&&(Array.isArray(u)?O.subscription_statuses=u.map(M=>Le.jsonOrThrow(M,{unrecognizedObjectKeys:"strip"})):O.subscription_statuses=Le.jsonOrThrow(u,{unrecognizedObjectKeys:"strip"})),g!=null&&(Array.isArray(g)?O.subscription_types=g.map(M=>We.jsonOrThrow(M,{unrecognizedObjectKeys:"strip"})):O.subscription_types=We.jsonOrThrow(g,{unrecognizedObjectKeys:"strip"})),d!=null&&(O.monetized_subscriptions=d.toString()),l!=null&&(O.q=l),m!=null&&(O.without_plan=m.toString()),y!=null&&(O.without_subscription=y.toString()),j!=null&&(O.sort_order_column=j),b!=null&&(O.sort_order_direction=we.jsonOrThrow(b,{unrecognizedObjectKeys:"strip"})),T!=null&&(Array.isArray(T)?O.display_properties=T.map(M=>M):O.display_properties=T),V!=null&&(O.limit=V.toString()),H!=null&&(O.offset=H.toString());let pe=await this._options.authProvider.getAuthRequest(),nr=f(pe.headers,this._options?.headers,i?.headers),k=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"companies/count2"),method:"GET",headers:nr,queryParameters:{...O,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(k.ok)return{data:ec.parseOrThrow(k.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:k.rawResponse};if(k.error.reason==="status-code")switch(k.error.statusCode){case 400:throw new v(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 401:throw new C(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 403:throw new P(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 404:throw new E(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 500:throw new x(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);default:throw new z({statusCode:k.error.statusCode,body:k.error.body,rawResponse:k.rawResponse})}return U(k.error,k.rawResponse,"GET","/companies/count2")}createCompany(o,i){return R.fromPromise(this.__createCompany(o,i))}async __createCompany(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"companies/create"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Zt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:uc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/companies/create")}deleteCompanyByKeys(o,i){return R.fromPromise(this.__deleteCompanyByKeys(o,i))}async __deleteCompanyByKeys(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"companies/delete"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Ht.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:hc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/companies/delete")}listCompaniesForAdvancedFilter(o={},i){return R.fromPromise(this.__listCompaniesForAdvancedFilter(o,i))}async __listCompaniesForAdvancedFilter(o={},i){let{ids:a,planIds:n,featureIds:r,creditTypeIds:s,subscriptionStatuses:u,subscriptionTypes:g,monetizedSubscriptions:d,q:l,withoutPlan:m,withoutSubscription:y,sortOrderColumn:j,sortOrderDirection:b,displayProperties:T,limit:V,offset:H}=o,O={};a!=null&&(Array.isArray(a)?O.ids=a.map(M=>M):O.ids=a),n!=null&&(Array.isArray(n)?O.plan_ids=n.map(M=>M):O.plan_ids=n),r!=null&&(Array.isArray(r)?O.feature_ids=r.map(M=>M):O.feature_ids=r),s!=null&&(Array.isArray(s)?O.credit_type_ids=s.map(M=>M):O.credit_type_ids=s),u!=null&&(Array.isArray(u)?O.subscription_statuses=u.map(M=>Le.jsonOrThrow(M,{unrecognizedObjectKeys:"strip"})):O.subscription_statuses=Le.jsonOrThrow(u,{unrecognizedObjectKeys:"strip"})),g!=null&&(Array.isArray(g)?O.subscription_types=g.map(M=>We.jsonOrThrow(M,{unrecognizedObjectKeys:"strip"})):O.subscription_types=We.jsonOrThrow(g,{unrecognizedObjectKeys:"strip"})),d!=null&&(O.monetized_subscriptions=d.toString()),l!=null&&(O.q=l),m!=null&&(O.without_plan=m.toString()),y!=null&&(O.without_subscription=y.toString()),j!=null&&(O.sort_order_column=j),b!=null&&(O.sort_order_direction=we.jsonOrThrow(b,{unrecognizedObjectKeys:"strip"})),T!=null&&(Array.isArray(T)?O.display_properties=T.map(M=>M):O.display_properties=T),V!=null&&(O.limit=V.toString()),H!=null&&(O.offset=H.toString());let pe=await this._options.authProvider.getAuthRequest(),nr=f(pe.headers,this._options?.headers,i?.headers),k=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"companies/list2"),method:"GET",headers:nr,queryParameters:{...O,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(k.ok)return{data:Kc.parseOrThrow(k.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:k.rawResponse};if(k.error.reason==="status-code")switch(k.error.statusCode){case 400:throw new v(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 401:throw new C(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 403:throw new P(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 404:throw new E(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);case 500:throw new x(t.parseOrThrow(k.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),k.rawResponse);default:throw new z({statusCode:k.error.statusCode,body:k.error.body,rawResponse:k.rawResponse})}return U(k.error,k.rawResponse,"GET","/companies/list2")}lookupCompany(o,i){return R.fromPromise(this.__lookupCompany(o,i))}async __lookupCompany(o,i){let{keys:a}=o,n={};n.keys=me(a);let r=await this._options.authProvider.getAuthRequest(),s=f(r.headers,this._options?.headers,i?.headers),u=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"companies/lookup"),method:"GET",headers:s,queryParameters:{...n,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(u.ok)return{data:tl.parseOrThrow(u.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")switch(u.error.statusCode){case 401:throw new C(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 403:throw new P(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 404:throw new E(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 500:throw new x(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);default:throw new z({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse})}return U(u.error,u.rawResponse,"GET","/companies/lookup")}listCompanyMemberships(o={},i){return R.fromPromise(this.__listCompanyMemberships(o,i))}async __listCompanyMemberships(o={},i){let{companyId:a,userId:n,limit:r,offset:s}=o,u={};a!=null&&(u.company_id=a),n!=null&&(u.user_id=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"company-memberships"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:Nc.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/company-memberships")}getOrCreateCompanyMembership(o,i){return R.fromPromise(this.__getOrCreateCompanyMembership(o,i))}async __getOrCreateCompanyMembership(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"company-memberships"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:mt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Uc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/company-memberships")}deleteCompanyMembership(o,i){return R.fromPromise(this.__deleteCompanyMembership(o,i))}async __deleteCompanyMembership(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`company-memberships/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:gc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/company-memberships/{company_membership_id}")}getActiveCompanySubscription(o={},i){return R.fromPromise(this.__getActiveCompanySubscription(o,i))}async __getActiveCompanySubscription(o={},i){let{companyId:a,companyIds:n,limit:r,offset:s}=o,u={};a!=null&&(u.company_id=a),n!=null&&(Array.isArray(n)?u.company_ids=n.map(m=>m):u.company_ids=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"company-subscriptions"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:_c.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/company-subscriptions")}upsertCompanyTrait(o,i){return R.fromPromise(this.__upsertCompanyTrait(o,i))}async __upsertCompanyTrait(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"company-traits"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Jt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:ul.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/company-traits")}listEntityKeyDefinitions(o={},i){return R.fromPromise(this.__listEntityKeyDefinitions(o,i))}async __listEntityKeyDefinitions(o={},i){let{entityType:a,ids:n,q:r,limit:s,offset:u}=o,g={};a!=null&&(g.entity_type=W.jsonOrThrow(a,{unrecognizedObjectKeys:"strip"})),n!=null&&(Array.isArray(n)?g.ids=n.map(y=>y):g.ids=n),r!=null&&(g.q=r),s!=null&&(g.limit=s.toString()),u!=null&&(g.offset=u.toString());let d=await this._options.authProvider.getAuthRequest(),l=f(d.headers,this._options?.headers,i?.headers),m=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"entity-key-definitions"),method:"GET",headers:l,queryParameters:{...g,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(m.ok)return{data:$c.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new v(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 401:throw new C(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 403:throw new P(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 404:throw new E(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 500:throw new x(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new z({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return U(m.error,m.rawResponse,"GET","/entity-key-definitions")}countEntityKeyDefinitions(o={},i){return R.fromPromise(this.__countEntityKeyDefinitions(o,i))}async __countEntityKeyDefinitions(o={},i){let{entityType:a,ids:n,q:r,limit:s,offset:u}=o,g={};a!=null&&(g.entity_type=W.jsonOrThrow(a,{unrecognizedObjectKeys:"strip"})),n!=null&&(Array.isArray(n)?g.ids=n.map(y=>y):g.ids=n),r!=null&&(g.q=r),s!=null&&(g.limit=s.toString()),u!=null&&(g.offset=u.toString());let d=await this._options.authProvider.getAuthRequest(),l=f(d.headers,this._options?.headers,i?.headers),m=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"entity-key-definitions/count"),method:"GET",headers:l,queryParameters:{...g,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(m.ok)return{data:tc.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new v(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 401:throw new C(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 403:throw new P(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 404:throw new E(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 500:throw new x(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new z({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return U(m.error,m.rawResponse,"GET","/entity-key-definitions/count")}listEntityTraitDefinitions(o={},i){return R.fromPromise(this.__listEntityTraitDefinitions(o,i))}async __listEntityTraitDefinitions(o={},i){let{entityType:a,ids:n,q:r,traitType:s,traitTypes:u,limit:g,offset:d}=o,l={};a!=null&&(l.entity_type=W.jsonOrThrow(a,{unrecognizedObjectKeys:"strip"})),n!=null&&(Array.isArray(n)?l.ids=n.map(b=>b):l.ids=n),r!=null&&(l.q=r),s!=null&&(l.trait_type=X.jsonOrThrow(s,{unrecognizedObjectKeys:"strip"})),u!=null&&(Array.isArray(u)?l.trait_types=u.map(b=>X.jsonOrThrow(b,{unrecognizedObjectKeys:"strip"})):l.trait_types=X.jsonOrThrow(u,{unrecognizedObjectKeys:"strip"})),g!=null&&(l.limit=g.toString()),d!=null&&(l.offset=d.toString());let m=await this._options.authProvider.getAuthRequest(),y=f(m.headers,this._options?.headers,i?.headers),j=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"entity-trait-definitions"),method:"GET",headers:y,queryParameters:{...l,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(j.ok)return{data:Jc.parseOrThrow(j.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:j.rawResponse};if(j.error.reason==="status-code")switch(j.error.statusCode){case 400:throw new v(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 401:throw new C(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 403:throw new P(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 404:throw new E(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 500:throw new x(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);default:throw new z({statusCode:j.error.statusCode,body:j.error.body,rawResponse:j.rawResponse})}return U(j.error,j.rawResponse,"GET","/entity-trait-definitions")}getOrCreateEntityTraitDefinition(o,i){return R.fromPromise(this.__getOrCreateEntityTraitDefinition(o,i))}async __getOrCreateEntityTraitDefinition(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"entity-trait-definitions"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:ut.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Tc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/entity-trait-definitions")}getEntityTraitDefinition(o,i){return R.fromPromise(this.__getEntityTraitDefinition(o,i))}async __getEntityTraitDefinition(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`entity-trait-definitions/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Pc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/entity-trait-definitions/{entity_trait_definition_id}")}updateEntityTraitDefinition(o,i,a){return R.fromPromise(this.__updateEntityTraitDefinition(o,i,a))}async __updateEntityTraitDefinition(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`entity-trait-definitions/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:ht.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:nl.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/entity-trait-definitions/{entity_trait_definition_id}")}countEntityTraitDefinitions(o={},i){return R.fromPromise(this.__countEntityTraitDefinitions(o,i))}async __countEntityTraitDefinitions(o={},i){let{entityType:a,ids:n,q:r,traitType:s,traitTypes:u,limit:g,offset:d}=o,l={};a!=null&&(l.entity_type=W.jsonOrThrow(a,{unrecognizedObjectKeys:"strip"})),n!=null&&(Array.isArray(n)?l.ids=n.map(b=>b):l.ids=n),r!=null&&(l.q=r),s!=null&&(l.trait_type=X.jsonOrThrow(s,{unrecognizedObjectKeys:"strip"})),u!=null&&(Array.isArray(u)?l.trait_types=u.map(b=>X.jsonOrThrow(b,{unrecognizedObjectKeys:"strip"})):l.trait_types=X.jsonOrThrow(u,{unrecognizedObjectKeys:"strip"})),g!=null&&(l.limit=g.toString()),d!=null&&(l.offset=d.toString());let m=await this._options.authProvider.getAuthRequest(),y=f(m.headers,this._options?.headers,i?.headers),j=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"entity-trait-definitions/count"),method:"GET",headers:y,queryParameters:{...l,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(j.ok)return{data:sc.parseOrThrow(j.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:j.rawResponse};if(j.error.reason==="status-code")switch(j.error.statusCode){case 400:throw new v(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 401:throw new C(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 403:throw new P(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 404:throw new E(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 500:throw new x(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);default:throw new z({statusCode:j.error.statusCode,body:j.error.body,rawResponse:j.rawResponse})}return U(j.error,j.rawResponse,"GET","/entity-trait-definitions/count")}getEntityTraitValues(o,i){return R.fromPromise(this.__getEntityTraitValues(o,i))}async __getEntityTraitValues(o,i){let{definitionId:a,q:n,limit:r,offset:s}=o,u={};u.definition_id=a,n!=null&&(u.q=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"entity-trait-values"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:Cc.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/entity-trait-values")}listPlanChanges(o={},i){return R.fromPromise(this.__listPlanChanges(o,i))}async __listPlanChanges(o={},i){let{action:a,basePlanAction:n,companyId:r,companyIds:s,planIds:u,limit:g,offset:d}=o,l={};a!=null&&(l.action=a),n!=null&&(l.base_plan_action=n),r!=null&&(l.company_id=r),s!=null&&(Array.isArray(s)?l.company_ids=s.map(b=>b):l.company_ids=s),u!=null&&(Array.isArray(u)?l.plan_ids=u.map(b=>b):l.plan_ids=u),g!=null&&(l.limit=g.toString()),d!=null&&(l.offset=d.toString());let m=await this._options.authProvider.getAuthRequest(),y=f(m.headers,this._options?.headers,i?.headers),j=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plan-changes"),method:"GET",headers:y,queryParameters:{...l,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(j.ok)return{data:Yc.parseOrThrow(j.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:j.rawResponse};if(j.error.reason==="status-code")switch(j.error.statusCode){case 400:throw new v(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 401:throw new C(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 403:throw new P(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 404:throw new E(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 500:throw new x(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);default:throw new z({statusCode:j.error.statusCode,body:j.error.body,rawResponse:j.rawResponse})}return U(j.error,j.rawResponse,"GET","/plan-changes")}getPlanChange(o,i){return R.fromPromise(this.__getPlanChange(o,i))}async __getPlanChange(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plan-changes/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Ac.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/plan-changes/{plan_change_id}")}listPlanTraits(o={},i){return R.fromPromise(this.__listPlanTraits(o,i))}async __listPlanTraits(o={},i){let{ids:a,planId:n,traitId:r,traitIds:s,limit:u,offset:g}=o,d={};a!=null&&(Array.isArray(a)?d.ids=a.map(j=>j):d.ids=a),n!=null&&(d.plan_id=n),r!=null&&(d.trait_id=r),s!=null&&(Array.isArray(s)?d.trait_ids=s.map(j=>j):d.trait_ids=s),u!=null&&(d.limit=u.toString()),g!=null&&(d.offset=g.toString());let l=await this._options.authProvider.getAuthRequest(),m=f(l.headers,this._options?.headers,i?.headers),y=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plan-traits"),method:"GET",headers:m,queryParameters:{...d,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(y.ok)return{data:el.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 400:throw new v(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 401:throw new C(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 403:throw new P(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 404:throw new E(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 500:throw new x(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);default:throw new z({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return U(y.error,y.rawResponse,"GET","/plan-traits")}createPlanTrait(o,i){return R.fromPromise(this.__createPlanTrait(o,i))}async __createPlanTrait(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plan-traits"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:dt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:dc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/plan-traits")}getPlanTrait(o,i){return R.fromPromise(this.__getPlanTrait(o,i))}async __getPlanTrait(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plan-traits/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Vc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/plan-traits/{plan_trait_id}")}updatePlanTrait(o,i,a){return R.fromPromise(this.__updatePlanTrait(o,i,a))}async __updatePlanTrait(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plan-traits/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:yt.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:cl.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/plan-traits/{plan_trait_id}")}deletePlanTrait(o,i){return R.fromPromise(this.__deletePlanTrait(o,i))}async __deletePlanTrait(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plan-traits/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:bc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/plan-traits/{plan_trait_id}")}updatePlanTraitsBulk(o,i){return R.fromPromise(this.__updatePlanTraitsBulk(o,i))}async __updatePlanTraitsBulk(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plan-traits/bulk"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:gt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:ll.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/plan-traits/bulk")}countPlanTraits(o={},i){return R.fromPromise(this.__countPlanTraits(o,i))}async __countPlanTraits(o={},i){let{ids:a,planId:n,traitId:r,traitIds:s,limit:u,offset:g}=o,d={};a!=null&&(Array.isArray(a)?d.ids=a.map(j=>j):d.ids=a),n!=null&&(d.plan_id=n),r!=null&&(d.trait_id=r),s!=null&&(Array.isArray(s)?d.trait_ids=s.map(j=>j):d.trait_ids=s),u!=null&&(d.limit=u.toString()),g!=null&&(d.offset=g.toString());let l=await this._options.authProvider.getAuthRequest(),m=f(l.headers,this._options?.headers,i?.headers),y=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plan-traits/count"),method:"GET",headers:m,queryParameters:{...d,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(y.ok)return{data:cc.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 400:throw new v(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 401:throw new C(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 403:throw new P(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 404:throw new E(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 500:throw new x(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);default:throw new z({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return U(y.error,y.rawResponse,"GET","/plan-traits/count")}upsertUserTrait(o,i){return R.fromPromise(this.__upsertUserTrait(o,i))}async __upsertUserTrait(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"user-traits"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Jt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:ml.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/user-traits")}listUsers(o={},i){return R.fromPromise(this.__listUsers(o,i))}async __listUsers(o={},i){let{companyId:a,ids:n,planId:r,q:s,limit:u,offset:g}=o,d={};a!=null&&(d.company_id=a),n!=null&&(Array.isArray(n)?d.ids=n.map(j=>j):d.ids=n),r!=null&&(d.plan_id=r),s!=null&&(d.q=s),u!=null&&(d.limit=u.toString()),g!=null&&(d.offset=g.toString());let l=await this._options.authProvider.getAuthRequest(),m=f(l.headers,this._options?.headers,i?.headers),y=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"users"),method:"GET",headers:m,queryParameters:{...d,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(y.ok)return{data:il.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 400:throw new v(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 401:throw new C(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 403:throw new P(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 404:throw new E(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 500:throw new x(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);default:throw new z({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return U(y.error,y.rawResponse,"GET","/users")}upsertUser(o,i){return R.fromPromise(this.__upsertUser(o,i))}async __upsertUser(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"users"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Qt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:dl.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/users")}getUser(o,i){return R.fromPromise(this.__getUser(o,i))}async __getUser(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`users/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:qc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/users/{user_id}")}deleteUser(o,i){return R.fromPromise(this.__deleteUser(o,i))}async __deleteUser(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`users/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Rc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/users/{user_id}")}countUsers(o={},i){return R.fromPromise(this.__countUsers(o,i))}async __countUsers(o={},i){let{companyId:a,ids:n,planId:r,q:s,limit:u,offset:g}=o,d={};a!=null&&(d.company_id=a),n!=null&&(Array.isArray(n)?d.ids=n.map(j=>j):d.ids=n),r!=null&&(d.plan_id=r),s!=null&&(d.q=s),u!=null&&(d.limit=u.toString()),g!=null&&(d.offset=g.toString());let l=await this._options.authProvider.getAuthRequest(),m=f(l.headers,this._options?.headers,i?.headers),y=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"users/count"),method:"GET",headers:m,queryParameters:{...d,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(y.ok)return{data:pc.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 400:throw new v(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 401:throw new C(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 403:throw new P(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 404:throw new E(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 500:throw new x(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);default:throw new z({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return U(y.error,y.rawResponse,"GET","/users/count")}createUser(o,i){return R.fromPromise(this.__createUser(o,i))}async __createUser(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"users/create"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Qt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:mc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/users/create")}deleteUserByKeys(o,i){return R.fromPromise(this.__deleteUserByKeys(o,i))}async __deleteUserByKeys(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"users/delete"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Ht.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:zc.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/users/delete")}lookupUser(o,i){return R.fromPromise(this.__lookupUser(o,i))}async __lookupUser(o,i){let{keys:a}=o,n={};n.keys=me(a);let r=await this._options.authProvider.getAuthRequest(),s=f(r.headers,this._options?.headers,i?.headers),u=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"users/lookup"),method:"GET",headers:s,queryParameters:{...n,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(u.ok)return{data:sl.parseOrThrow(u.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")switch(u.error.statusCode){case 401:throw new C(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 403:throw new P(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 404:throw new E(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 500:throw new x(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);default:throw new z({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse})}return U(u.error,u.rawResponse,"GET","/users/lookup")}};var zo=class{constructor(o){this._options=K(o)}listComponents(o={},i){return R.fromPromise(this.__listComponents(o,i))}async __listComponents(o={},i){let{q:a,limit:n,offset:r}=o,s={};a!=null&&(s.q=a),n!=null&&(s.limit=n.toString()),r!=null&&(s.offset=r.toString());let u=await this._options.authProvider.getAuthRequest(),g=f(u.headers,this._options?.headers,i?.headers),d=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"components"),method:"GET",headers:g,queryParameters:{...s,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(d.ok)return{data:Rl.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:d.rawResponse};if(d.error.reason==="status-code")switch(d.error.statusCode){case 400:throw new v(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 401:throw new C(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 403:throw new P(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 404:throw new E(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 500:throw new x(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);default:throw new z({statusCode:d.error.statusCode,body:d.error.body,rawResponse:d.rawResponse})}return U(d.error,d.rawResponse,"GET","/components")}createComponent(o,i){return R.fromPromise(this.__createComponent(o,i))}async __createComponent(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"components"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:wt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:yl.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/components")}getComponent(o,i){return R.fromPromise(this.__getComponent(o,i))}async __getComponent(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`components/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:bl.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/components/{component_id}")}updateComponent(o,i={},a){return R.fromPromise(this.__updateComponent(o,i,a))}async __updateComponent(o,i={},a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`components/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:bt.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:jl.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/components/{component_id}")}deleteComponent(o,i){return R.fromPromise(this.__deleteComponent(o,i))}async __deleteComponent(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`components/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:wl.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/components/{component_id}")}countComponents(o={},i){return R.fromPromise(this.__countComponents(o,i))}async __countComponents(o={},i){let{q:a,limit:n,offset:r}=o,s={};a!=null&&(s.q=a),n!=null&&(s.limit=n.toString()),r!=null&&(s.offset=r.toString());let u=await this._options.authProvider.getAuthRequest(),g=f(u.headers,this._options?.headers,i?.headers),d=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"components/count"),method:"GET",headers:g,queryParameters:{...s,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(d.ok)return{data:gl.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:d.rawResponse};if(d.error.reason==="status-code")switch(d.error.statusCode){case 400:throw new v(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 401:throw new C(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 403:throw new P(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 404:throw new E(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 500:throw new x(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);default:throw new z({statusCode:d.error.statusCode,body:d.error.body,rawResponse:d.rawResponse})}return U(d.error,d.rawResponse,"GET","/components/count")}previewComponentData(o={},i){return R.fromPromise(this.__previewComponentData(o,i))}async __previewComponentData(o={},i){let{companyId:a,componentId:n}=o,r={};a!=null&&(r.company_id=a),n!=null&&(r.component_id=n);let s=await this._options.authProvider.getAuthRequest(),u=f(s.headers,this._options?.headers,i?.headers),g=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"components/preview-data"),method:"GET",headers:u,queryParameters:{...r,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(g.ok)return{data:Ol.parseOrThrow(g.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:g.rawResponse};if(g.error.reason==="status-code")switch(g.error.statusCode){case 401:throw new C(t.parseOrThrow(g.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),g.rawResponse);case 403:throw new P(t.parseOrThrow(g.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),g.rawResponse);case 404:throw new E(t.parseOrThrow(g.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),g.rawResponse);case 500:throw new x(t.parseOrThrow(g.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),g.rawResponse);default:throw new z({statusCode:g.error.statusCode,body:g.error.body,rawResponse:g.rawResponse})}return U(g.error,g.rawResponse,"GET","/components/preview-data")}};var Ro=class{constructor(o){this._options=K(o)}listBillingCredits(o={},i){return R.fromPromise(this.__listBillingCredits(o,i))}async __listBillingCredits(o={},i){let{ids:a,name:n,limit:r,offset:s}=o,u={};a!=null&&(Array.isArray(a)?u.ids=a.map(m=>m):u.ids=a),n!=null&&(u.name=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:cp.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/billing/credits")}createBillingCredit(o,i){return R.fromPromise(this.__createBillingCredit(o,i))}async __createBillingCredit(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Rt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Wl.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/billing/credits")}getSingleBillingCredit(o,i){return R.fromPromise(this.__getSingleBillingCredit(o,i))}async __getSingleBillingCredit(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`billing/credits/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:tp.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/billing/credits/{credit_id}")}updateBillingCredit(o,i,a){return R.fromPromise(this.__updateBillingCredit(o,i,a))}async __updateBillingCredit(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`billing/credits/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:St.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:bp.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/billing/credits/{credit_id}")}softDeleteBillingCredit(o,i){return R.fromPromise(this.__softDeleteBillingCredit(o,i))}async __softDeleteBillingCredit(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`billing/credits/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:wp.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/billing/credits/{credit_id}")}listCreditBundles(o={},i){return R.fromPromise(this.__listCreditBundles(o,i))}async __listCreditBundles(o={},i){let{ids:a,creditId:n,status:r,bundleType:s,limit:u,offset:g}=o,d={};a!=null&&(Array.isArray(a)?d.ids=a.map(j=>j):d.ids=a),n!=null&&(d.credit_id=n),r!=null&&(d.status=ue.jsonOrThrow(r,{unrecognizedObjectKeys:"strip"})),s!=null&&(d.bundle_type=ze.jsonOrThrow(s,{unrecognizedObjectKeys:"strip"})),u!=null&&(d.limit=u.toString()),g!=null&&(d.offset=g.toString());let l=await this._options.authProvider.getAuthRequest(),m=f(l.headers,this._options?.headers,i?.headers),y=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/bundles"),method:"GET",headers:m,queryParameters:{...d,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(y.ok)return{data:hp.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 400:throw new v(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 401:throw new C(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 403:throw new P(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 404:throw new E(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 500:throw new x(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);default:throw new z({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return U(y.error,y.rawResponse,"GET","/billing/credits/bundles")}createCreditBundle(o,i){return R.fromPromise(this.__createCreditBundle(o,i))}async __createCreditBundle(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/bundles"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:_t.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Hl.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/billing/credits/bundles")}getCreditBundle(o,i){return R.fromPromise(this.__getCreditBundle(o,i))}async __getCreditBundle(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`billing/credits/bundles/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Ql.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/billing/credits/bundles/{bundle_id}")}updateCreditBundleDetails(o,i,a){return R.fromPromise(this.__updateCreditBundleDetails(o,i,a))}async __updateCreditBundleDetails(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`billing/credits/bundles/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:Pt.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:Rp.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/billing/credits/bundles/{bundle_id}")}deleteCreditBundle(o,i){return R.fromPromise(this.__deleteCreditBundle(o,i))}async __deleteCreditBundle(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`billing/credits/bundles/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Jl.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/billing/credits/bundles/{bundle_id}")}countCreditBundles(o={},i){return R.fromPromise(this.__countCreditBundles(o,i))}async __countCreditBundles(o={},i){let{ids:a,creditId:n,status:r,bundleType:s,limit:u,offset:g}=o,d={};a!=null&&(Array.isArray(a)?d.ids=a.map(j=>j):d.ids=a),n!=null&&(d.credit_id=n),r!=null&&(d.status=ue.jsonOrThrow(r,{unrecognizedObjectKeys:"strip"})),s!=null&&(d.bundle_type=ze.jsonOrThrow(s,{unrecognizedObjectKeys:"strip"})),u!=null&&(d.limit=u.toString()),g!=null&&(d.offset=g.toString());let l=await this._options.authProvider.getAuthRequest(),m=f(l.headers,this._options?.headers,i?.headers),y=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/bundles/count"),method:"GET",headers:m,queryParameters:{...d,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(y.ok)return{data:Kl.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 400:throw new v(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 401:throw new C(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 403:throw new P(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 404:throw new E(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 500:throw new x(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);default:throw new z({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return U(y.error,y.rawResponse,"GET","/billing/credits/bundles/count")}countBillingCredits(o={},i){return R.fromPromise(this.__countBillingCredits(o,i))}async __countBillingCredits(o={},i){let{ids:a,name:n,limit:r,offset:s}=o,u={};a!=null&&(Array.isArray(a)?u.ids=a.map(m=>m):u.ids=a),n!=null&&(u.name=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/count"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:Vl.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/billing/credits/count")}zeroOutGrant(o,i={},a){return R.fromPromise(this.__zeroOutGrant(o,i,a))}async __zeroOutGrant(o,i={},a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`billing/credits/grants/${w.encodePathParam(o)}/zero-out`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:xt.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:fp.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/billing/credits/grants/{grant_id}/zero-out")}grantBillingCreditsToCompany(o,i){return R.fromPromise(this.__grantBillingCreditsToCompany(o,i))}async __grantBillingCreditsToCompany(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/grants/company"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:ft.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:sp.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/billing/credits/grants/company")}countCompanyGrants(o={},i){return R.fromPromise(this.__countCompanyGrants(o,i))}async __countCompanyGrants(o={},i){let{companyId:a,order:n,dir:r,limit:s,offset:u}=o,g={};a!=null&&(g.company_id=a),n!=null&&(g.order=ur.jsonOrThrow(n,{unrecognizedObjectKeys:"strip"})),r!=null&&(g.dir=we.jsonOrThrow(r,{unrecognizedObjectKeys:"strip"})),s!=null&&(g.limit=s.toString()),u!=null&&(g.offset=u.toString());let d=await this._options.authProvider.getAuthRequest(),l=f(d.headers,this._options?.headers,i?.headers),m=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/grants/company/count"),method:"GET",headers:l,queryParameters:{...g,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(m.ok)return{data:Fl.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new v(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 401:throw new C(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 403:throw new P(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 404:throw new E(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 500:throw new x(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new z({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return U(m.error,m.rawResponse,"GET","/billing/credits/grants/company/count")}listCompanyGrants(o={},i){return R.fromPromise(this.__listCompanyGrants(o,i))}async __listCompanyGrants(o={},i){let{companyId:a,order:n,dir:r,limit:s,offset:u}=o,g={};a!=null&&(g.company_id=a),n!=null&&(g.order=ur.jsonOrThrow(n,{unrecognizedObjectKeys:"strip"})),r!=null&&(g.dir=we.jsonOrThrow(r,{unrecognizedObjectKeys:"strip"})),s!=null&&(g.limit=s.toString()),u!=null&&(g.offset=u.toString());let d=await this._options.authProvider.getAuthRequest(),l=f(d.headers,this._options?.headers,i?.headers),m=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/grants/company/list"),method:"GET",headers:l,queryParameters:{...g,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(m.ok)return{data:dp.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new v(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 401:throw new C(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 403:throw new P(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 404:throw new E(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 500:throw new x(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new z({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return U(m.error,m.rawResponse,"GET","/billing/credits/grants/company/list")}countBillingCreditsGrants(o={},i){return R.fromPromise(this.__countBillingCreditsGrants(o,i))}async __countBillingCreditsGrants(o={},i){let{creditId:a,ids:n,limit:r,offset:s}=o,u={};a!=null&&(u.credit_id=a),n!=null&&(Array.isArray(n)?u.ids=n.map(m=>m):u.ids=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/grants/count"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:Bl.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/billing/credits/grants/count")}listGrantsForCredit(o={},i){return R.fromPromise(this.__listGrantsForCredit(o,i))}async __listGrantsForCredit(o={},i){let{creditId:a,ids:n,limit:r,offset:s}=o,u={};a!=null&&(u.credit_id=a),n!=null&&(Array.isArray(n)?u.ids=n.map(m=>m):u.ids=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/grants/list"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:yp.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/billing/credits/grants/list")}getEnrichedCreditLedger(o,i){return R.fromPromise(this.__getEnrichedCreditLedger(o,i))}async __getEnrichedCreditLedger(o,i){let{companyId:a,billingCreditId:n,featureId:r,period:s,startTime:u,endTime:g,limit:d,offset:l}=o,m={};m.company_id=a,n!=null&&(m.billing_credit_id=n),r!=null&&(m.feature_id=r),m.period=dr.jsonOrThrow(s,{unrecognizedObjectKeys:"strip"}),u!=null&&(m.start_time=u),g!=null&&(m.end_time=g),d!=null&&(m.limit=d.toString()),l!=null&&(m.offset=l.toString());let y=await this._options.authProvider.getAuthRequest(),j=f(y.headers,this._options?.headers,i?.headers),b=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/ledger"),method:"GET",headers:j,queryParameters:{...m,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(b.ok)return{data:op.parseOrThrow(b.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:b.rawResponse};if(b.error.reason==="status-code")switch(b.error.statusCode){case 400:throw new v(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 401:throw new C(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 403:throw new P(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 404:throw new E(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 500:throw new x(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);default:throw new z({statusCode:b.error.statusCode,body:b.error.body,rawResponse:b.rawResponse})}return U(b.error,b.rawResponse,"GET","/billing/credits/ledger")}countCreditLedger(o,i){return R.fromPromise(this.__countCreditLedger(o,i))}async __countCreditLedger(o,i){let{companyId:a,billingCreditId:n,featureId:r,period:s,startTime:u,endTime:g,limit:d,offset:l}=o,m={};m.company_id=a,n!=null&&(m.billing_credit_id=n),r!=null&&(m.feature_id=r),m.period=dr.jsonOrThrow(s,{unrecognizedObjectKeys:"strip"}),u!=null&&(m.start_time=u),g!=null&&(m.end_time=g),d!=null&&(m.limit=d.toString()),l!=null&&(m.offset=l.toString());let y=await this._options.authProvider.getAuthRequest(),j=f(y.headers,this._options?.headers,i?.headers),b=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/ledger/count"),method:"GET",headers:j,queryParameters:{...m,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(b.ok)return{data:Ll.parseOrThrow(b.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:b.rawResponse};if(b.error.reason==="status-code")switch(b.error.statusCode){case 400:throw new v(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 401:throw new C(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 403:throw new P(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 404:throw new E(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 500:throw new x(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);default:throw new z({statusCode:b.error.statusCode,body:b.error.body,rawResponse:b.rawResponse})}return U(b.error,b.rawResponse,"GET","/billing/credits/ledger/count")}listBillingPlanCreditGrants(o={},i){return R.fromPromise(this.__listBillingPlanCreditGrants(o,i))}async __listBillingPlanCreditGrants(o={},i){let{creditId:a,planId:n,planIds:r,ids:s,limit:u,offset:g}=o,d={};a!=null&&(d.credit_id=a),n!=null&&(d.plan_id=n),r!=null&&(Array.isArray(r)?d.plan_ids=r.map(j=>j):d.plan_ids=r),s!=null&&(Array.isArray(s)?d.ids=s.map(j=>j):d.ids=s),u!=null&&(d.limit=u.toString()),g!=null&&(d.offset=g.toString());let l=await this._options.authProvider.getAuthRequest(),m=f(l.headers,this._options?.headers,i?.headers),y=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/plan-grants"),method:"GET",headers:m,queryParameters:{...d,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(y.ok)return{data:pp.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 400:throw new v(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 401:throw new C(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 403:throw new P(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 404:throw new E(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 500:throw new x(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);default:throw new z({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return U(y.error,y.rawResponse,"GET","/billing/credits/plan-grants")}createBillingPlanCreditGrant(o,i){return R.fromPromise(this.__createBillingPlanCreditGrant(o,i))}async __createBillingPlanCreditGrant(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/plan-grants"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Ji.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Nl.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/billing/credits/plan-grants")}updateBillingPlanCreditGrant(o,i,a){return R.fromPromise(this.__updateBillingPlanCreditGrant(o,i,a))}async __updateBillingPlanCreditGrant(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`billing/credits/plan-grants/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:Yi.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:zp.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/billing/credits/plan-grants/{plan_grant_id}")}deleteBillingPlanCreditGrant(o,i={},a){return R.fromPromise(this.__deleteBillingPlanCreditGrant(o,i,a))}async __deleteBillingPlanCreditGrant(o,i={},a){let{applyToExisting:n}=i,r={};n!=null&&(r.apply_to_existing=n.toString());let s=await this._options.authProvider.getAuthRequest(),u=f(s.headers,this._options?.headers,a?.headers),g=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`billing/credits/plan-grants/${w.encodePathParam(o)}`),method:"DELETE",headers:u,queryParameters:{...r,...a?.queryParams},timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(g.ok)return{data:Zl.parseOrThrow(g.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:g.rawResponse};if(g.error.reason==="status-code")switch(g.error.statusCode){case 400:throw new v(t.parseOrThrow(g.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),g.rawResponse);case 401:throw new C(t.parseOrThrow(g.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),g.rawResponse);case 403:throw new P(t.parseOrThrow(g.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),g.rawResponse);case 404:throw new E(t.parseOrThrow(g.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),g.rawResponse);case 500:throw new x(t.parseOrThrow(g.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),g.rawResponse);default:throw new z({statusCode:g.error.statusCode,body:g.error.body,rawResponse:g.rawResponse})}return U(g.error,g.rawResponse,"DELETE","/billing/credits/plan-grants/{plan_grant_id}")}countBillingPlanCreditGrants(o={},i){return R.fromPromise(this.__countBillingPlanCreditGrants(o,i))}async __countBillingPlanCreditGrants(o={},i){let{creditId:a,planId:n,planIds:r,ids:s,limit:u,offset:g}=o,d={};a!=null&&(d.credit_id=a),n!=null&&(d.plan_id=n),r!=null&&(Array.isArray(r)?d.plan_ids=r.map(j=>j):d.plan_ids=r),s!=null&&(Array.isArray(s)?d.ids=s.map(j=>j):d.ids=s),u!=null&&(d.limit=u.toString()),g!=null&&(d.offset=g.toString());let l=await this._options.authProvider.getAuthRequest(),m=f(l.headers,this._options?.headers,i?.headers),y=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"billing/credits/plan-grants/count"),method:"GET",headers:m,queryParameters:{...d,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(y.ok)return{data:Dl.parseOrThrow(y.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:y.rawResponse};if(y.error.reason==="status-code")switch(y.error.statusCode){case 400:throw new v(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 401:throw new C(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 403:throw new P(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 404:throw new E(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);case 500:throw new x(t.parseOrThrow(y.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),y.rawResponse);default:throw new z({statusCode:y.error.statusCode,body:y.error.body,rawResponse:y.rawResponse})}return U(y.error,y.rawResponse,"GET","/billing/credits/plan-grants/count")}};var fo=class{constructor(o){this._options=K(o)}createDataExport(o,i){return R.fromPromise(this.__createDataExport(o,i))}async __createDataExport(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"data-exports"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:{...Et.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),export_type:"company-feature-usage",output_file_type:"csv"},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Ep.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/data-exports")}getDataExportArtifact(o,i){return R.fromPromise(this.__getDataExportArtifact(o,i))}async __getDataExportArtifact(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`data-exports/${w.encodePathParam(o)}/artifact`),method:"GET",headers:n,queryParameters:i?.queryParams,responseType:"streaming",timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:r.body,rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/data-exports/{data_export_id}/artifact")}};var _o=class{constructor(o){this._options=K(o)}listCompanyOverrides(o={},i){return R.fromPromise(this.__listCompanyOverrides(o,i))}async __listCompanyOverrides(o={},i){let{companyId:a,companyIds:n,featureId:r,featureIds:s,ids:u,withoutExpired:g,q:d,limit:l,offset:m}=o,y={};a!=null&&(y.company_id=a),n!=null&&(Array.isArray(n)?y.company_ids=n.map(V=>V):y.company_ids=n),r!=null&&(y.feature_id=r),s!=null&&(Array.isArray(s)?y.feature_ids=s.map(V=>V):y.feature_ids=s),u!=null&&(Array.isArray(u)?y.ids=u.map(V=>V):y.ids=u),g!=null&&(y.without_expired=g.toString()),d!=null&&(y.q=d),l!=null&&(y.limit=l.toString()),m!=null&&(y.offset=m.toString());let j=await this._options.authProvider.getAuthRequest(),b=f(j.headers,this._options?.headers,i?.headers),T=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"company-overrides"),method:"GET",headers:b,queryParameters:{...y,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(T.ok)return{data:tu.parseOrThrow(T.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:T.rawResponse};if(T.error.reason==="status-code")switch(T.error.statusCode){case 400:throw new v(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 401:throw new C(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 403:throw new P(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 404:throw new E(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 500:throw new x(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);default:throw new z({statusCode:T.error.statusCode,body:T.error.body,rawResponse:T.rawResponse})}return U(T.error,T.rawResponse,"GET","/company-overrides")}createCompanyOverride(o,i){return R.fromPromise(this.__createCompanyOverride(o,i))}async __createCompanyOverride(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"company-overrides"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Ct.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Wp.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/company-overrides")}getCompanyOverride(o,i){return R.fromPromise(this.__getCompanyOverride(o,i))}async __getCompanyOverride(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`company-overrides/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Xp.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/company-overrides/{company_override_id}")}updateCompanyOverride(o,i,a){return R.fromPromise(this.__updateCompanyOverride(o,i,a))}async __updateCompanyOverride(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`company-overrides/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:vt.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:yu.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/company-overrides/{company_override_id}")}deleteCompanyOverride(o,i){return R.fromPromise(this.__deleteCompanyOverride(o,i))}async __deleteCompanyOverride(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`company-overrides/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Hp.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/company-overrides/{company_override_id}")}countCompanyOverrides(o={},i){return R.fromPromise(this.__countCompanyOverrides(o,i))}async __countCompanyOverrides(o={},i){let{companyId:a,companyIds:n,featureId:r,featureIds:s,ids:u,withoutExpired:g,q:d,limit:l,offset:m}=o,y={};a!=null&&(y.company_id=a),n!=null&&(Array.isArray(n)?y.company_ids=n.map(V=>V):y.company_ids=n),r!=null&&(y.feature_id=r),s!=null&&(Array.isArray(s)?y.feature_ids=s.map(V=>V):y.feature_ids=s),u!=null&&(Array.isArray(u)?y.ids=u.map(V=>V):y.ids=u),g!=null&&(y.without_expired=g.toString()),d!=null&&(y.q=d),l!=null&&(y.limit=l.toString()),m!=null&&(y.offset=m.toString());let j=await this._options.authProvider.getAuthRequest(),b=f(j.headers,this._options?.headers,i?.headers),T=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"company-overrides/count"),method:"GET",headers:b,queryParameters:{...y,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(T.ok)return{data:Vp.parseOrThrow(T.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:T.rawResponse};if(T.error.reason==="status-code")switch(T.error.statusCode){case 400:throw new v(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 401:throw new C(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 403:throw new P(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 404:throw new E(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 500:throw new x(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);default:throw new z({statusCode:T.error.statusCode,body:T.error.body,rawResponse:T.rawResponse})}return U(T.error,T.rawResponse,"GET","/company-overrides/count")}listFeatureCompanies(o,i){return R.fromPromise(this.__listFeatureCompanies(o,i))}async __listFeatureCompanies(o,i){let{featureId:a,q:n,limit:r,offset:s}=o,u={};u.feature_id=a,n!=null&&(u.q=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"feature-companies"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:cu.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/feature-companies")}countFeatureCompanies(o,i){return R.fromPromise(this.__countFeatureCompanies(o,i))}async __countFeatureCompanies(o,i){let{featureId:a,q:n,limit:r,offset:s}=o,u={};u.feature_id=a,n!=null&&(u.q=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"feature-companies/count"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:Dp.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/feature-companies/count")}listFeatureUsage(o={},i){return R.fromPromise(this.__listFeatureUsage(o,i))}async __listFeatureUsage(o={},i){let{companyId:a,companyKeys:n,featureIds:r,includeUsageAggregation:s,q:u,withoutNegativeEntitlements:g,limit:d,offset:l}=o,m={};a!=null&&(m.company_id=a),n!=null&&(m.company_keys=me(n)),r!=null&&(Array.isArray(r)?m.feature_ids=r.map(T=>T):m.feature_ids=r),s!=null&&(m.include_usage_aggregation=s.toString()),u!=null&&(m.q=u),g!=null&&(m.without_negative_entitlements=g.toString()),d!=null&&(m.limit=d.toString()),l!=null&&(m.offset=l.toString());let y=await this._options.authProvider.getAuthRequest(),j=f(y.headers,this._options?.headers,i?.headers),b=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"feature-usage"),method:"GET",headers:j,queryParameters:{...m,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(b.ok)return{data:pu.parseOrThrow(b.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:b.rawResponse};if(b.error.reason==="status-code")switch(b.error.statusCode){case 400:throw new v(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 401:throw new C(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 403:throw new P(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 404:throw new E(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 500:throw new x(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);default:throw new z({statusCode:b.error.statusCode,body:b.error.body,rawResponse:b.rawResponse})}return U(b.error,b.rawResponse,"GET","/feature-usage")}countFeatureUsage(o={},i){return R.fromPromise(this.__countFeatureUsage(o,i))}async __countFeatureUsage(o={},i){let{companyId:a,companyKeys:n,featureIds:r,includeUsageAggregation:s,q:u,withoutNegativeEntitlements:g,limit:d,offset:l}=o,m={};a!=null&&(m.company_id=a),n!=null&&(m.company_keys=me(n)),r!=null&&(Array.isArray(r)?m.feature_ids=r.map(T=>T):m.feature_ids=r),s!=null&&(m.include_usage_aggregation=s.toString()),u!=null&&(m.q=u),g!=null&&(m.without_negative_entitlements=g.toString()),d!=null&&(m.limit=d.toString()),l!=null&&(m.offset=l.toString());let y=await this._options.authProvider.getAuthRequest(),j=f(y.headers,this._options?.headers,i?.headers),b=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"feature-usage/count"),method:"GET",headers:j,queryParameters:{...m,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(b.ok)return{data:Fp.parseOrThrow(b.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:b.rawResponse};if(b.error.reason==="status-code")switch(b.error.statusCode){case 400:throw new v(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 401:throw new C(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 403:throw new P(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 404:throw new E(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 500:throw new x(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);default:throw new z({statusCode:b.error.statusCode,body:b.error.body,rawResponse:b.rawResponse})}return U(b.error,b.rawResponse,"GET","/feature-usage/count")}listFeatureUsers(o,i){return R.fromPromise(this.__listFeatureUsers(o,i))}async __listFeatureUsers(o,i){let{featureId:a,q:n,limit:r,offset:s}=o,u={};u.feature_id=a,n!=null&&(u.q=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"feature-users"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:mu.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/feature-users")}countFeatureUsers(o,i){return R.fromPromise(this.__countFeatureUsers(o,i))}async __countFeatureUsers(o,i){let{featureId:a,q:n,limit:r,offset:s}=o,u={};u.feature_id=a,n!=null&&(u.q=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"feature-users/count"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:Kp.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/feature-users/count")}listPlanEntitlements(o={},i){return R.fromPromise(this.__listPlanEntitlements(o,i))}async __listPlanEntitlements(o={},i){let{featureId:a,featureIds:n,ids:r,planId:s,planIds:u,q:g,withMeteredProducts:d,limit:l,offset:m}=o,y={};a!=null&&(y.feature_id=a),n!=null&&(Array.isArray(n)?y.feature_ids=n.map(V=>V):y.feature_ids=n),r!=null&&(Array.isArray(r)?y.ids=r.map(V=>V):y.ids=r),s!=null&&(y.plan_id=s),u!=null&&(Array.isArray(u)?y.plan_ids=u.map(V=>V):y.plan_ids=u),g!=null&&(y.q=g),d!=null&&(y.with_metered_products=d.toString()),l!=null&&(y.limit=l.toString()),m!=null&&(y.offset=m.toString());let j=await this._options.authProvider.getAuthRequest(),b=f(j.headers,this._options?.headers,i?.headers),T=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plan-entitlements"),method:"GET",headers:b,queryParameters:{...y,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(T.ok)return{data:gu.parseOrThrow(T.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:T.rawResponse};if(T.error.reason==="status-code")switch(T.error.statusCode){case 400:throw new v(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 401:throw new C(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 403:throw new P(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 404:throw new E(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 500:throw new x(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);default:throw new z({statusCode:T.error.statusCode,body:T.error.body,rawResponse:T.rawResponse})}return U(T.error,T.rawResponse,"GET","/plan-entitlements")}createPlanEntitlement(o,i){return R.fromPromise(this.__createPlanEntitlement(o,i))}async __createPlanEntitlement(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plan-entitlements"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Ut.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Np.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/plan-entitlements")}getPlanEntitlement(o,i){return R.fromPromise(this.__getPlanEntitlement(o,i))}async __getPlanEntitlement(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plan-entitlements/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:iu.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/plan-entitlements/{plan_entitlement_id}")}updatePlanEntitlement(o,i,a){return R.fromPromise(this.__updatePlanEntitlement(o,i,a))}async __updatePlanEntitlement(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plan-entitlements/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:Ot.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:wu.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/plan-entitlements/{plan_entitlement_id}")}deletePlanEntitlement(o,i){return R.fromPromise(this.__deletePlanEntitlement(o,i))}async __deletePlanEntitlement(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plan-entitlements/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:$p.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/plan-entitlements/{plan_entitlement_id}")}countPlanEntitlements(o={},i){return R.fromPromise(this.__countPlanEntitlements(o,i))}async __countPlanEntitlements(o={},i){let{featureId:a,featureIds:n,ids:r,planId:s,planIds:u,q:g,withMeteredProducts:d,limit:l,offset:m}=o,y={};a!=null&&(y.feature_id=a),n!=null&&(Array.isArray(n)?y.feature_ids=n.map(V=>V):y.feature_ids=n),r!=null&&(Array.isArray(r)?y.ids=r.map(V=>V):y.ids=r),s!=null&&(y.plan_id=s),u!=null&&(Array.isArray(u)?y.plan_ids=u.map(V=>V):y.plan_ids=u),g!=null&&(y.q=g),d!=null&&(y.with_metered_products=d.toString()),l!=null&&(y.limit=l.toString()),m!=null&&(y.offset=m.toString());let j=await this._options.authProvider.getAuthRequest(),b=f(j.headers,this._options?.headers,i?.headers),T=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plan-entitlements/count"),method:"GET",headers:b,queryParameters:{...y,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(T.ok)return{data:Lp.parseOrThrow(T.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:T.rawResponse};if(T.error.reason==="status-code")switch(T.error.statusCode){case 400:throw new v(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 401:throw new C(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 403:throw new P(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 404:throw new E(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);case 500:throw new x(t.parseOrThrow(T.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),T.rawResponse);default:throw new z({statusCode:T.error.statusCode,body:T.error.body,rawResponse:T.rawResponse})}return U(T.error,T.rawResponse,"GET","/plan-entitlements/count")}duplicatePlanEntitlements(o,i){return R.fromPromise(this.__duplicatePlanEntitlements(o,i))}async __duplicatePlanEntitlements(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plan-entitlements/duplicate"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Tt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Yp.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/plan-entitlements/duplicate")}getFeatureUsageByCompany(o,i){return R.fromPromise(this.__getFeatureUsageByCompany(o,i))}async __getFeatureUsageByCompany(o,i){let{keys:a}=o,n={};n.keys=me(a);let r=await this._options.authProvider.getAuthRequest(),s=f(r.headers,this._options?.headers,i?.headers),u=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"usage-by-company"),method:"GET",headers:s,queryParameters:{...n,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(u.ok)return{data:ru.parseOrThrow(u.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")switch(u.error.statusCode){case 401:throw new C(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 403:throw new P(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 404:throw new E(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 500:throw new x(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);default:throw new z({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse})}return U(u.error,u.rawResponse,"GET","/usage-by-company")}};var So=class{constructor(o){this._options=K(o)}createEventBatch(o,i){return R.fromPromise(this.__createEventBatch(o,i))}async __createEventBatch(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"event-batch"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:jt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Pu.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/event-batch")}getEventSummaries(o={},i){return R.fromPromise(this.__getEventSummaries(o,i))}async __getEventSummaries(o={},i){let{q:a,eventSubtypes:n,limit:r,offset:s}=o,u={};a!=null&&(u.q=a),n!=null&&(Array.isArray(n)?u.event_subtypes=n.map(m=>m):u.event_subtypes=n),r!=null&&(u.limit=r.toString()),s!=null&&(u.offset=s.toString());let g=await this._options.authProvider.getAuthRequest(),d=f(g.headers,this._options?.headers,i?.headers),l=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"event-types"),method:"GET",headers:d,queryParameters:{...u,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(l.ok)return{data:Tu.parseOrThrow(l.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:l.rawResponse};if(l.error.reason==="status-code")switch(l.error.statusCode){case 400:throw new v(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 401:throw new C(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 403:throw new P(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 404:throw new E(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);case 500:throw new x(t.parseOrThrow(l.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),l.rawResponse);default:throw new z({statusCode:l.error.statusCode,body:l.error.body,rawResponse:l.rawResponse})}return U(l.error,l.rawResponse,"GET","/event-types")}listEvents(o={},i){return R.fromPromise(this.__listEvents(o,i))}async __listEvents(o={},i){let{companyId:a,eventSubtype:n,eventTypes:r,flagId:s,userId:u,limit:g,offset:d}=o,l={};a!=null&&(l.company_id=a),n!=null&&(l.event_subtype=n),r!=null&&(Array.isArray(r)?l.event_types=r.map(b=>Ne.jsonOrThrow(b,{unrecognizedObjectKeys:"strip"})):l.event_types=Ne.jsonOrThrow(r,{unrecognizedObjectKeys:"strip"})),s!=null&&(l.flag_id=s),u!=null&&(l.user_id=u),g!=null&&(l.limit=g.toString()),d!=null&&(l.offset=d.toString());let m=await this._options.authProvider.getAuthRequest(),y=f(m.headers,this._options?.headers,i?.headers),j=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"events"),method:"GET",headers:y,queryParameters:{...l,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(j.ok)return{data:ku.parseOrThrow(j.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:j.rawResponse};if(j.error.reason==="status-code")switch(j.error.statusCode){case 400:throw new v(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 401:throw new C(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 403:throw new P(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 404:throw new E(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);case 500:throw new x(t.parseOrThrow(j.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),j.rawResponse);default:throw new z({statusCode:j.error.statusCode,body:j.error.body,rawResponse:j.rawResponse})}return U(j.error,j.rawResponse,"GET","/events")}createEvent(o,i){return R.fromPromise(this.__createEvent(o,i))}async __createEvent(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"events"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Ii.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:xu.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/events")}getEvent(o,i){return R.fromPromise(this.__getEvent(o,i))}async __getEvent(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`events/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Cu.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/events/{event_id}")}getSegmentIntegrationStatus(o){return R.fromPromise(this.__getSegmentIntegrationStatus(o))}async __getSegmentIntegrationStatus(o){let i=await this._options.authProvider.getAuthRequest(),a=f(i.headers,this._options?.headers,o?.headers),n=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"segment-integration"),method:"GET",headers:a,queryParameters:o?.queryParams,timeoutMs:(o?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:o?.maxRetries??this._options?.maxRetries,abortSignal:o?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(n.ok)return{data:Ou.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.statusCode){case 401:throw new C(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);case 403:throw new P(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);case 404:throw new E(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);case 500:throw new x(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);default:throw new z({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse})}return U(n.error,n.rawResponse,"GET","/segment-integration")}};var Po=class{constructor(o){this._options=K(o)}listFeatures(o={},i){return R.fromPromise(this.__listFeatures(o,i))}async __listFeatures(o={},i){let{ids:a,q:n,withoutCompanyOverrideFor:r,withoutPlanEntitlementFor:s,featureType:u,booleanRequireEvent:g,limit:d,offset:l}=o,m={};a!=null&&(Array.isArray(a)?m.ids=a.map(T=>T):m.ids=a),n!=null&&(m.q=n),r!=null&&(m.without_company_override_for=r),s!=null&&(m.without_plan_entitlement_for=s),u!=null&&(Array.isArray(u)?m.feature_type=u.map(T=>te.jsonOrThrow(T,{unrecognizedObjectKeys:"strip"})):m.feature_type=te.jsonOrThrow(u,{unrecognizedObjectKeys:"strip"})),g!=null&&(m.boolean_require_event=g.toString()),d!=null&&(m.limit=d.toString()),l!=null&&(m.offset=l.toString());let y=await this._options.authProvider.getAuthRequest(),j=f(y.headers,this._options?.headers,i?.headers),b=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"features"),method:"GET",headers:j,queryParameters:{...m,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(b.ok)return{data:id.parseOrThrow(b.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:b.rawResponse};if(b.error.reason==="status-code")switch(b.error.statusCode){case 400:throw new v(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 401:throw new C(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 403:throw new P(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 404:throw new E(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 500:throw new x(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);default:throw new z({statusCode:b.error.statusCode,body:b.error.body,rawResponse:b.rawResponse})}return U(b.error,b.rawResponse,"GET","/features")}createFeature(o,i){return R.fromPromise(this.__createFeature(o,i))}async __createFeature(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"features"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Bt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Zu.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/features")}getFeature(o,i){return R.fromPromise(this.__getFeature(o,i))}async __getFeature(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`features/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Xu.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/features/{feature_id}")}updateFeature(o,i={},a){return R.fromPromise(this.__updateFeature(o,i,a))}async __updateFeature(o,i={},a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`features/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:At.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:ad.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/features/{feature_id}")}deleteFeature(o,i){return R.fromPromise(this.__deleteFeature(o,i))}async __deleteFeature(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`features/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Qu.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/features/{feature_id}")}countFeatures(o={},i){return R.fromPromise(this.__countFeatures(o,i))}async __countFeatures(o={},i){let{ids:a,q:n,withoutCompanyOverrideFor:r,withoutPlanEntitlementFor:s,featureType:u,booleanRequireEvent:g,limit:d,offset:l}=o,m={};a!=null&&(Array.isArray(a)?m.ids=a.map(T=>T):m.ids=a),n!=null&&(m.q=n),r!=null&&(m.without_company_override_for=r),s!=null&&(m.without_plan_entitlement_for=s),u!=null&&(Array.isArray(u)?m.feature_type=u.map(T=>te.jsonOrThrow(T,{unrecognizedObjectKeys:"strip"})):m.feature_type=te.jsonOrThrow(u,{unrecognizedObjectKeys:"strip"})),g!=null&&(m.boolean_require_event=g.toString()),d!=null&&(m.limit=d.toString()),l!=null&&(m.offset=l.toString());let y=await this._options.authProvider.getAuthRequest(),j=f(y.headers,this._options?.headers,i?.headers),b=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"features/count"),method:"GET",headers:j,queryParameters:{...m,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(b.ok)return{data:Nu.parseOrThrow(b.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:b.rawResponse};if(b.error.reason==="status-code")switch(b.error.statusCode){case 400:throw new v(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 401:throw new C(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 403:throw new P(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 404:throw new E(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);case 500:throw new x(t.parseOrThrow(b.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),b.rawResponse);default:throw new z({statusCode:b.error.statusCode,body:b.error.body,rawResponse:b.rawResponse})}return U(b.error,b.rawResponse,"GET","/features/count")}listFlags(o={},i){return R.fromPromise(this.__listFlags(o,i))}async __listFlags(o={},i){let{featureId:a,ids:n,q:r,limit:s,offset:u}=o,g={};a!=null&&(g.feature_id=a),n!=null&&(Array.isArray(n)?g.ids=n.map(y=>y):g.ids=n),r!=null&&(g.q=r),s!=null&&(g.limit=s.toString()),u!=null&&(g.offset=u.toString());let d=await this._options.authProvider.getAuthRequest(),l=f(d.headers,this._options?.headers,i?.headers),m=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"flags"),method:"GET",headers:l,queryParameters:{...g,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(m.ok)return{data:td.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new v(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 401:throw new C(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 403:throw new P(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 404:throw new E(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 500:throw new x(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new z({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return U(m.error,m.rawResponse,"GET","/flags")}createFlag(o,i){return R.fromPromise(this.__createFlag(o,i))}async __createFlag(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"flags"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Nt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Ju.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/flags")}getFlag(o,i){return R.fromPromise(this.__getFlag(o,i))}async __getFlag(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`flags/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:ed.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/flags/{flag_id}")}updateFlag(o,i,a){return R.fromPromise(this.__updateFlag(o,i,a))}async __updateFlag(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`flags/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:Nt.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:sd.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/flags/{flag_id}")}deleteFlag(o,i){return R.fromPromise(this.__deleteFlag(o,i))}async __deleteFlag(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`flags/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Yu.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/flags/{flag_id}")}updateFlagRules(o,i,a){return R.fromPromise(this.__updateFlagRules(o,i,a))}async __updateFlagRules(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`flags/${w.encodePathParam(o)}/rules`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:Vt.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:ld.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/flags/{flag_id}/rules")}checkFlag(o,i,a){return R.fromPromise(this.__checkFlag(o,i,a))}async __checkFlag(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`flags/${w.encodePathParam(o)}/check`),method:"POST",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:ni.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:Iu.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"POST","/flags/{key}/check")}checkFlags(o,i){return R.fromPromise(this.__checkFlags(o,i))}async __checkFlags(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"flags/check"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:ni.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Lu.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/flags/check")}checkFlagsBulk(o,i){return R.fromPromise(this.__checkFlagsBulk(o,i))}async __checkFlagsBulk(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"flags/check-bulk"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:kt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Gu.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/flags/check-bulk")}countFlags(o={},i){return R.fromPromise(this.__countFlags(o,i))}async __countFlags(o={},i){let{featureId:a,ids:n,q:r,limit:s,offset:u}=o,g={};a!=null&&(g.feature_id=a),n!=null&&(Array.isArray(n)?g.ids=n.map(y=>y):g.ids=n),r!=null&&(g.q=r),s!=null&&(g.limit=s.toString()),u!=null&&(g.offset=u.toString());let d=await this._options.authProvider.getAuthRequest(),l=f(d.headers,this._options?.headers,i?.headers),m=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"flags/count"),method:"GET",headers:l,queryParameters:{...g,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(m.ok)return{data:$u.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new v(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 401:throw new C(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 403:throw new P(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 404:throw new E(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 500:throw new x(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new z({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return U(m.error,m.rawResponse,"GET","/flags/count")}};var xo=class{constructor(o){this._options=K(o)}createPlanBundle(o,i){return R.fromPromise(this.__createPlanBundle(o,i))}async __createPlanBundle(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plan-bundles"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:qt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:hd.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/plan-bundles")}updatePlanBundle(o,i,a){return R.fromPromise(this.__updatePlanBundle(o,i,a))}async __updatePlanBundle(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plan-bundles/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:Dt.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:gd.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/plan-bundles/{plan_bundle_id}")}};var Eo=class{constructor(o){this._options=K(o)}getPlanGroup(o){return R.fromPromise(this.__getPlanGroup(o))}async __getPlanGroup(o){let i=await this._options.authProvider.getAuthRequest(),a=f(i.headers,this._options?.headers,o?.headers),n=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plan-groups"),method:"GET",headers:a,queryParameters:o?.queryParams,timeoutMs:(o?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:o?.maxRetries??this._options?.maxRetries,abortSignal:o?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(n.ok)return{data:fd.parseOrThrow(n.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:n.rawResponse};if(n.error.reason==="status-code")switch(n.error.statusCode){case 401:throw new C(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);case 403:throw new P(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);case 404:throw new E(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);case 500:throw new x(t.parseOrThrow(n.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),n.rawResponse);default:throw new z({statusCode:n.error.statusCode,body:n.error.body,rawResponse:n.rawResponse})}return U(n.error,n.rawResponse,"GET","/plan-groups")}createPlanGroup(o,i){return R.fromPromise(this.__createPlanGroup(o,i))}async __createPlanGroup(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plan-groups"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Mt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:bd.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/plan-groups")}updatePlanGroup(o,i,a){return R.fromPromise(this.__updatePlanGroup(o,i,a))}async __updatePlanGroup(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plan-groups/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:Ft.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:_d.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/plan-groups/{plan_group_id}")}};var Co=class{constructor(o){this._options=K(o)}updateCompanyPlans(o,i,a){return R.fromPromise(this.__updateCompanyPlans(o,i,a))}async __updateCompanyPlans(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`company-plans/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:Kt.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:kd.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/company-plans/{company_plan_id}")}listPlans(o={},i){return R.fromPromise(this.__listPlans(o,i))}async __listPlans(o={},i){let{companyId:a,forFallbackPlan:n,forInitialPlan:r,forTrialExpiryPlan:s,hasProductId:u,ids:g,planType:d,q:l,withoutEntitlementFor:m,withoutPaidProductId:y,limit:j,offset:b}=o,T={};a!=null&&(T.company_id=a),n!=null&&(T.for_fallback_plan=n.toString()),r!=null&&(T.for_initial_plan=r.toString()),s!=null&&(T.for_trial_expiry_plan=s.toString()),u!=null&&(T.has_product_id=u.toString()),g!=null&&(Array.isArray(g)?T.ids=g.map(pe=>pe):T.ids=g),d!=null&&(T.plan_type=ae.jsonOrThrow(d,{unrecognizedObjectKeys:"strip"})),l!=null&&(T.q=l),m!=null&&(T.without_entitlement_for=m),y!=null&&(T.without_paid_product_id=y.toString()),j!=null&&(T.limit=j.toString()),b!=null&&(T.offset=b.toString());let V=await this._options.authProvider.getAuthRequest(),H=f(V.headers,this._options?.headers,i?.headers),O=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plans"),method:"GET",headers:H,queryParameters:{...T,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(O.ok)return{data:jd.parseOrThrow(O.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:O.rawResponse};if(O.error.reason==="status-code")switch(O.error.statusCode){case 400:throw new v(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 401:throw new C(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 403:throw new P(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 404:throw new E(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 500:throw new x(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);default:throw new z({statusCode:O.error.statusCode,body:O.error.body,rawResponse:O.rawResponse})}return U(O.error,O.rawResponse,"GET","/plans")}createPlan(o,i){return R.fromPromise(this.__createPlan(o,i))}async __createPlan(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plans"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:$i.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:xd.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/plans")}getPlan(o,i){return R.fromPromise(this.__getPlan(o,i))}async __getPlan(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plans/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Cd.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/plans/{plan_id}")}updatePlan(o,i,a){return R.fromPromise(this.__updatePlan(o,i,a))}async __updatePlan(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plans/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:ro.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:Bd.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/plans/{plan_id}")}deletePlan(o,i){return R.fromPromise(this.__deletePlan(o,i))}async __deletePlan(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plans/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Ed.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/plans/{plan_id}")}upsertBillingProductPlan(o,i,a){return R.fromPromise(this.__upsertBillingProductPlan(o,i,a))}async __upsertBillingProductPlan(o,i,a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plans/${w.encodePathParam(o)}/billing_products`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:Wr.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:Ad.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/plans/{plan_id}/billing_products")}countPlans(o={},i){return R.fromPromise(this.__countPlans(o,i))}async __countPlans(o={},i){let{companyId:a,forFallbackPlan:n,forInitialPlan:r,forTrialExpiryPlan:s,hasProductId:u,ids:g,planType:d,q:l,withoutEntitlementFor:m,withoutPaidProductId:y,limit:j,offset:b}=o,T={};a!=null&&(T.company_id=a),n!=null&&(T.for_fallback_plan=n.toString()),r!=null&&(T.for_initial_plan=r.toString()),s!=null&&(T.for_trial_expiry_plan=s.toString()),u!=null&&(T.has_product_id=u.toString()),g!=null&&(Array.isArray(g)?T.ids=g.map(pe=>pe):T.ids=g),d!=null&&(T.plan_type=ae.jsonOrThrow(d,{unrecognizedObjectKeys:"strip"})),l!=null&&(T.q=l),m!=null&&(T.without_entitlement_for=m),y!=null&&(T.without_paid_product_id=y.toString()),j!=null&&(T.limit=j.toString()),b!=null&&(T.offset=b.toString());let V=await this._options.authProvider.getAuthRequest(),H=f(V.headers,this._options?.headers,i?.headers),O=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plans/count"),method:"GET",headers:H,queryParameters:{...T,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(O.ok)return{data:Pd.parseOrThrow(O.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:O.rawResponse};if(O.error.reason==="status-code")switch(O.error.statusCode){case 400:throw new v(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 401:throw new C(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 403:throw new P(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 404:throw new E(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);case 500:throw new x(t.parseOrThrow(O.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),O.rawResponse);default:throw new z({statusCode:O.error.statusCode,body:O.error.body,rawResponse:O.rawResponse})}return U(O.error,O.rawResponse,"GET","/plans/count")}listPlanIssues(o,i){return R.fromPromise(this.__listPlanIssues(o,i))}async __listPlanIssues(o,i){let{planId:a}=o,n={};n.plan_id=a;let r=await this._options.authProvider.getAuthRequest(),s=f(r.headers,this._options?.headers,i?.headers),u=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"plans/issues"),method:"GET",headers:s,queryParameters:{...n,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(u.ok)return{data:vd.parseOrThrow(u.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")switch(u.error.statusCode){case 400:throw new v(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 401:throw new C(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 403:throw new P(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 404:throw new E(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);case 500:throw new x(t.parseOrThrow(u.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),u.rawResponse);default:throw new z({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse})}return U(u.error,u.rawResponse,"GET","/plans/issues")}};var Uo=class{constructor(o){this._options=K(o)}listWebhookEvents(o={},i){return R.fromPromise(this.__listWebhookEvents(o,i))}async __listWebhookEvents(o={},i){let{ids:a,q:n,webhookId:r,limit:s,offset:u}=o,g={};a!=null&&(Array.isArray(a)?g.ids=a.map(y=>y):g.ids=a),n!=null&&(g.q=n),r!=null&&(g.webhook_id=r),s!=null&&(g.limit=s.toString()),u!=null&&(g.offset=u.toString());let d=await this._options.authProvider.getAuthRequest(),l=f(d.headers,this._options?.headers,i?.headers),m=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"webhook-events"),method:"GET",headers:l,queryParameters:{...g,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(m.ok)return{data:Nd.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new v(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 401:throw new C(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 403:throw new P(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 404:throw new E(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 500:throw new x(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new z({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return U(m.error,m.rawResponse,"GET","/webhook-events")}getWebhookEvent(o,i){return R.fromPromise(this.__getWebhookEvent(o,i))}async __getWebhookEvent(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`webhook-events/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Gd.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/webhook-events/{webhook_event_id}")}countWebhookEvents(o={},i){return R.fromPromise(this.__countWebhookEvents(o,i))}async __countWebhookEvents(o={},i){let{ids:a,q:n,webhookId:r,limit:s,offset:u}=o,g={};a!=null&&(Array.isArray(a)?g.ids=a.map(y=>y):g.ids=a),n!=null&&(g.q=n),r!=null&&(g.webhook_id=r),s!=null&&(g.limit=s.toString()),u!=null&&(g.offset=u.toString());let d=await this._options.authProvider.getAuthRequest(),l=f(d.headers,this._options?.headers,i?.headers),m=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"webhook-events/count"),method:"GET",headers:l,queryParameters:{...g,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(m.ok)return{data:qd.parseOrThrow(m.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:m.rawResponse};if(m.error.reason==="status-code")switch(m.error.statusCode){case 400:throw new v(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 401:throw new C(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 403:throw new P(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 404:throw new E(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);case 500:throw new x(t.parseOrThrow(m.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),m.rawResponse);default:throw new z({statusCode:m.error.statusCode,body:m.error.body,rawResponse:m.rawResponse})}return U(m.error,m.rawResponse,"GET","/webhook-events/count")}listWebhooks(o={},i){return R.fromPromise(this.__listWebhooks(o,i))}async __listWebhooks(o={},i){let{q:a,limit:n,offset:r}=o,s={};a!=null&&(s.q=a),n!=null&&(s.limit=n.toString()),r!=null&&(s.offset=r.toString());let u=await this._options.authProvider.getAuthRequest(),g=f(u.headers,this._options?.headers,i?.headers),d=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"webhooks"),method:"GET",headers:g,queryParameters:{...s,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(d.ok)return{data:$d.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:d.rawResponse};if(d.error.reason==="status-code")switch(d.error.statusCode){case 400:throw new v(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 401:throw new C(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 403:throw new P(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 404:throw new E(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 500:throw new x(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);default:throw new z({statusCode:d.error.statusCode,body:d.error.body,rawResponse:d.rawResponse})}return U(d.error,d.rawResponse,"GET","/webhooks")}createWebhook(o,i){return R.fromPromise(this.__createWebhook(o,i))}async __createWebhook(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"webhooks"),method:"POST",headers:n,contentType:"application/json",queryParameters:i?.queryParams,requestType:"json",body:Gt.jsonOrThrow(o,{unrecognizedObjectKeys:"strip"}),timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Fd.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"POST","/webhooks")}getWebhook(o,i){return R.fromPromise(this.__getWebhook(o,i))}async __getWebhook(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`webhooks/${w.encodePathParam(o)}`),method:"GET",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Ld.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"GET","/webhooks/{webhook_id}")}updateWebhook(o,i={},a){return R.fromPromise(this.__updateWebhook(o,i,a))}async __updateWebhook(o,i={},a){let n=await this._options.authProvider.getAuthRequest(),r=f(n.headers,this._options?.headers,a?.headers),s=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`webhooks/${w.encodePathParam(o)}`),method:"PUT",headers:r,contentType:"application/json",queryParameters:a?.queryParams,requestType:"json",body:Lt.jsonOrThrow(i,{unrecognizedObjectKeys:"strip"}),timeoutMs:(a?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:a?.maxRetries??this._options?.maxRetries,abortSignal:a?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(s.ok)return{data:Zd.parseOrThrow(s.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:s.rawResponse};if(s.error.reason==="status-code")switch(s.error.statusCode){case 400:throw new v(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 401:throw new C(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 403:throw new P(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 404:throw new E(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);case 500:throw new x(t.parseOrThrow(s.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),s.rawResponse);default:throw new z({statusCode:s.error.statusCode,body:s.error.body,rawResponse:s.rawResponse})}return U(s.error,s.rawResponse,"PUT","/webhooks/{webhook_id}")}deleteWebhook(o,i){return R.fromPromise(this.__deleteWebhook(o,i))}async __deleteWebhook(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`webhooks/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:Id.parseOrThrow(r.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:r.rawResponse};if(r.error.reason==="status-code")switch(r.error.statusCode){case 400:throw new v(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 401:throw new C(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 403:throw new P(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 404:throw new E(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);case 500:throw new x(t.parseOrThrow(r.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),r.rawResponse);default:throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse})}return U(r.error,r.rawResponse,"DELETE","/webhooks/{webhook_id}")}countWebhooks(o={},i){return R.fromPromise(this.__countWebhooks(o,i))}async __countWebhooks(o={},i){let{q:a,limit:n,offset:r}=o,s={};a!=null&&(s.q=a),n!=null&&(s.limit=n.toString()),r!=null&&(s.offset=r.toString());let u=await this._options.authProvider.getAuthRequest(),g=f(u.headers,this._options?.headers,i?.headers),d=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,"webhooks/count"),method:"GET",headers:g,queryParameters:{...s,...i?.queryParams},timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(d.ok)return{data:Md.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:d.rawResponse};if(d.error.reason==="status-code")switch(d.error.statusCode){case 400:throw new v(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 401:throw new C(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 403:throw new P(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 404:throw new E(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);case 500:throw new x(t.parseOrThrow(d.error.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),d.rawResponse);default:throw new z({statusCode:d.error.statusCode,body:d.error.body,rawResponse:d.rawResponse})}return U(d.error,d.rawResponse,"GET","/webhooks/count")}};var To=class{constructor(o){this._options=K(o)}get accounts(){return this._accounts??=new go(this._options)}get billing(){return this._billing??=new yo(this._options)}get credits(){return this._credits??=new Ro(this._options)}get checkout(){return this._checkout??=new wo(this._options)}get companies(){return this._companies??=new bo(this._options)}get entitlements(){return this._entitlements??=new _o(this._options)}get plans(){return this._plans??=new Co(this._options)}get components(){return this._components??=new zo(this._options)}get dataexports(){return this._dataexports??=new fo(this._options)}get events(){return this._events??=new So(this._options)}get features(){return this._features??=new Po(this._options)}get planbundle(){return this._planbundle??=new xo(this._options)}get plangroups(){return this._plangroups??=new Eo(this._options)}get accesstokens(){return this._accesstokens??=new ho(this._options)}get webhooks(){return this._webhooks??=new Uo(this._options)}putPlanAudiencesPlanAudienceId(o,i){return R.fromPromise(this.__putPlanAudiencesPlanAudienceId(o,i))}async __putPlanAudiencesPlanAudienceId(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plan-audiences/${w.encodePathParam(o)}`),method:"PUT",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:void 0,rawResponse:r.rawResponse};if(r.error.reason==="status-code")throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse});return U(r.error,r.rawResponse,"PUT","/plan-audiences/{plan_audience_id}")}deletePlanAudiencesPlanAudienceId(o,i){return R.fromPromise(this.__deletePlanAudiencesPlanAudienceId(o,i))}async __deletePlanAudiencesPlanAudienceId(o,i){let a=await this._options.authProvider.getAuthRequest(),n=f(a.headers,this._options?.headers,i?.headers),r=await(this._options.fetcher??S)({url:w.join(await h.get(this._options.baseUrl)??await h.get(this._options.environment)??_.Default,`plan-audiences/${w.encodePathParam(o)}`),method:"DELETE",headers:n,queryParameters:i?.queryParams,timeoutMs:(i?.timeoutInSeconds??this._options?.timeoutInSeconds??60)*1e3,maxRetries:i?.maxRetries??this._options?.maxRetries,abortSignal:i?.abortSignal,fetchFn:this._options?.fetch,logging:this._options.logging});if(r.ok)return{data:void 0,rawResponse:r.rawResponse};if(r.error.reason==="status-code")throw new z({statusCode:r.error.statusCode,body:r.error.body,rawResponse:r.rawResponse});return U(r.error,r.rawResponse,"DELETE","/plan-audiences/{plan_audience_id}")}};var Zr=class{error(o,...i){console.error(o,...i)}warn(o,...i){console.warn(o,...i)}info(o,...i){console.info(o,...i)}debug(o,...i){console.debug(o,...i)}};var Yh=1e3,Xh=1e3,eg=3,rg=1e3,vo=class{constructor(o,i){this.events=[];this.intervalId=null;this.shutdown=!1;this.stopped=!1;this.flushing=!1;let{logger:a=new Zr,maxSize:n=Xh,interval:r=Yh,offline:s=!1,maxRetries:u=eg,initialRetryDelay:g=rg}=i||{};this.eventsApi=o,this.interval=r,this.logger=a,this.maxSize=n,this.offline=s,this.maxRetries=u,this.initialRetryDelay=g,this.startPeriodicFlush()}async flush(){if(!(this.events.length===0||this.flushing)){this.flushing=!0;try{let o=[...this.events];this.events=[];let i=0,a=!1,n=null;for(;i<=this.maxRetries&&!a;)try{i>0&&this.logger.info(`Retrying event batch submission (attempt ${i} of ${this.maxRetries})`),await this.eventsApi.createEventBatch({events:o}),a=!0}catch(r){if(n=r,i++,i<=this.maxRetries){let s=this.initialRetryDelay*Math.pow(2,i-1),u=Math.random()*.1*s,g=s+u;this.logger.warn(`Event batch submission failed: ${r}. Retrying in ${(g/1e3).toFixed(2)} seconds...`),process.env.NODE_ENV!=="test"&&await new Promise(d=>setTimeout(d,g))}}a?i>0&&this.logger.info(`Event batch submission succeeded after ${i} retries`):this.logger.error(`Event batch submission failed after ${this.maxRetries} retries:`,n)}finally{this.flushing=!1}}}async push(o){if(!this.offline){if(this.stopped){this.logger.error("Event buffer is stopped, not accepting new events");return}this.events.length>=this.maxSize&&!this.flushing&&await this.flush(),this.events.push(o)}}async stop(){this.shutdown=!0,this.stopped=!0,this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null),await this.flush()}startPeriodicFlush(){this.offline||this.intervalId||(this.intervalId=setInterval(async()=>{this.shutdown||await this.flush()},this.interval))}};function Yd(p){return async function(i){let a={};if(p&&Object.assign(a,p),i.body!==void 0&&i.contentType!=null&&(a["Content-Type"]=i.contentType),i.headers!=null)for(let[u,g]of Object.entries(i.headers))g!=null&&typeof g=="string"&&(a[u]=g);let n=li(i.url,i.queryParameters),r=await ui({body:i.body,type:i.requestType==="json"?"json":"other"}),s=await pi();try{let u=await mi(async()=>di(s,n,i.method,a,r,i.timeoutMs,i.abortSignal,i.withCredentials,i.duplex),i.maxRetries),g=await wr(u,i.responseType),d=ei(u);return u.status>=200&&u.status<400?{ok:!0,body:g,headers:u.headers,rawResponse:d}:{ok:!1,error:{reason:"status-code",statusCode:u.status,body:g},rawResponse:d}}catch(u){return i.abortSignal!=null&&i.abortSignal.aborted?{ok:!1,error:{reason:"unknown",errorMessage:"The user aborted a request"},rawResponse:br}:u instanceof Error&&u.name==="AbortError"?{ok:!1,error:{reason:"timeout"},rawResponse:br}:u instanceof Error?{ok:!1,error:{reason:"unknown",errorMessage:u.message},rawResponse:zr}:{ok:!1,error:{reason:"unknown",errorMessage:JSON.stringify(u)},rawResponse:zr}}}}async function ig(p){return{ok:!0,body:{},headers:{"Content-Type":"application/json"},rawResponse:{headers:new je,redirected:!1,status:200,statusText:"OK",type:"basic",url:""}}}var Xd=ig;var Oo=class extends To{constructor(o){let{apiKey:i="",basePath:a,eventBufferInterval:n,flagDefaults:r={},logger:s=new Zr,timeoutMs:u}=o??{},{offline:g=!1}=o??{},d={};o?.environmentId&&(d["X-Schematic-Environment-Id"]=o.environmentId),o?.headers&&Object.assign(d,o.headers),g?i!==""&&s.debug("Offline mode enabled, ignoring API key"):i===""&&!g&&(s.warn("No API key was provided, running in offline mode"),g=!0),super({apiKey:i,environment:a,fetcher:g?Xd:Yd(d),timeoutInSeconds:u!==void 0?u/1e3:void 0}),this.logger=s,this.eventBuffer=new vo(this.events,{interval:n,logger:s,offline:g}),this.flagCheckCacheProviders=o?.cacheProviders?.flagChecks??[new hr],this.flagDefaults=r,this.offline=g}async checkFlag(o,i,a){let n=()=>a?.defaultValue===void 0?this.getFlagDefault(i):typeof a.defaultValue=="function"?a.defaultValue():a.defaultValue;if(this.offline)return this.logger.debug(`Offline mode enabled, returning default flag value for flag ${i}`),n();let r=JSON.stringify({evalCtx:o,key:i});for(let u of this.flagCheckCacheProviders)try{let g=await u.get(r);if(g!==void 0)return this.logger.debug(`${u.constructor.name} cache hit for flag ${i}`),g}catch(g){this.logger.warn(`Cache read error for flag ${i} from ${u.constructor.name}: ${g}`)}let s;try{let u=await this.features.checkFlag(i,o,{timeoutInSeconds:a?.timeoutMs!==void 0?a.timeoutMs/1e3:void 0});if(u.data.value===void 0)return this.logger.debug(`No value returned from feature flag API for flag ${i}, falling back to default`),n();s=u.data.value,this.logger.debug(`Feature flag API response for ${i}: ${JSON.stringify(u.data)}`)}catch(u){return this.logger.error(`Error checking flag ${i}: ${u}`),n()}for(let u of this.flagCheckCacheProviders)try{this.logger.debug(`Caching value for flag ${i} in ${u.constructor.name}`),await u.set(r,s)}catch(g){this.logger.warn(`Cache write error for flag ${i} to ${u.constructor.name}: ${g}`)}return s}async checkFlags(o,i){if(this.offline)return this.logger.debug(`Offline mode enabled, returning default flag values for flags ${i?i.join(", "):"all"}`),i&&i.length>0?i.map(a=>({flag:a,value:this.getFlagDefault(a),reason:"Offline mode - using default value"})):[];try{if(!i||i.length===0)return this.logger.debug("No specific flag keys provided, calling standard checkFlags API"),(await this.features.checkFlags(o)).data.flags;let a=new Map,n=[];for(let g of i){let d=JSON.stringify({evalCtx:o,key:g}),l=!1;for(let m of this.flagCheckCacheProviders)try{let y=await m.get(d);if(y!==void 0){this.logger.debug(`${m.constructor.name} cache hit for flag ${g}`),a.set(g,{flag:g,value:y,reason:"Retrieved from cache"}),l=!0;break}}catch(y){this.logger.warn(`Cache read error for flag ${g} from ${m.constructor.name}: ${y}`)}l||n.push(g)}if(n.length===0)return this.logger.debug(`All ${i.length} flags found in cache`),i.map(g=>a.get(g));this.logger.debug(`Cache miss for ${n.length} flags: ${n.join(", ")}, calling API`);let s=(await this.features.checkFlags(o)).data.flags,u=[];for(let g of i){let d=s.find(l=>l.flag===g);if(d){let l=JSON.stringify({evalCtx:o,key:g});for(let m of this.flagCheckCacheProviders)try{this.logger.debug(`Caching value for flag ${l} in ${m.constructor.name}`),await m.set(l,d.value)}catch(y){this.logger.warn(`Cache write error for flag ${g} to ${m.constructor.name}: ${y}`)}u.push(d)}else{let l=a.get(g);if(l)u.push(l);else{this.logger.debug(`Flag ${g} not found in API response or cache, using default value`);let m={flag:g,value:this.getFlagDefault(g),reason:"Flag not found - using default value"};u.push(m)}}}return this.logger.debug(`Checked ${i.length} flags: used fresh API values for consistency (${n.length} were cache misses)`),u}catch(a){return this.logger.error(`Error checking flags ${i?i.join(", "):"all"}: ${a}`),i&&i.length>0?i.map(n=>({flag:n,value:this.getFlagDefault(n),reason:`Error occurred - using default value: ${a}`})):[]}}async close(){return this.eventBuffer.stop()}async identify(o){if(!this.offline)try{await this.enqueueEvent("identify",o)}catch(i){this.logger.error(`Error sending identify event: ${i}`)}}async track(o){if(!this.offline)try{await this.enqueueEvent("track",o)}catch(i){this.logger.error(`Error sending track event: ${i}`)}}setFlagDefault(o,i){this.flagDefaults[o]=i}setFlagDefaults(o){Object.assign(this.flagDefaults,o)}getFlagDefault(o){return this.flagDefaults[o]??!1}async enqueueEvent(o,i){try{this.eventBuffer.push({eventType:o,body:i,sentAt:new Date})}catch(a){this.logger.error(`Error enqueueing ${o} event: ${a}`)}}};var jo=Ao(require("crypto")),Yt="X-Schematic-Webhook-Signature",Xt="X-Schematic-Webhook-Timestamp",Ie=class p extends Error{constructor(o){super(o),Object.setPrototypeOf(this,p.prototype),this.name="WebhookSignatureError"}static missingSignature(){return new p("Missing webhook signature header")}static missingTimestamp(){return new p("Missing webhook timestamp header")}static invalidSignature(){return new p("Invalid webhook signature")}};function ko(p,o,i){let a=Buffer.isBuffer(p)?p:Buffer.from(p),n=Buffer.concat([a,Buffer.from(`+${o}`)]),r=jo.createHmac("sha256",i);return r.update(n),r.digest()}function rm(p,o,i){return ko(p,o,i).toString("hex")}function ea(p,o,i,a){if(!o)throw Ie.missingSignature();if(!i)throw Ie.missingTimestamp();let n;try{n=Buffer.from(o,"hex")}catch(s){throw new Ie(`Invalid signature format: ${s?.message||"Unknown error"}`)}let r=ko(p,i,a);if(n.length!==r.length||!jo.timingSafeEqual(n,r))throw Ie.invalidSignature()}function im(p,o,i,a={}){let n=p.headers,r=a.signatureHeader||Yt,s=a.timestampHeader||Xt,u=em(n,r),g=em(n,s),d;if(i!==void 0)d=i;else if("rawBody"in p&&p.rawBody)d=p.rawBody;else throw new Ie("Request body is not available. Provide the body as a parameter or ensure req.rawBody exists.");ea(d,u,g,o)}function em(p,o){let i=p[o]||p[o.toLowerCase()];return Array.isArray(i)?i[0]||"":i||""}0&&(module.exports={LocalCache,Schematic,SchematicClient,SchematicEnvironment,SchematicError,SchematicTimeoutError,WEBHOOK_SIGNATURE_HEADER,WEBHOOK_TIMESTAMP_HEADER,WebhookSignatureError,computeHexSignature,computeSignature,verifySignature,verifyWebhookSignature});
|