@paid-ai/paid-node 1.7.1 → 2.0.0
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/cjs/Client.d.ts +33 -0
- package/dist/cjs/Client.js +83 -28
- package/dist/cjs/api/errors/BadRequestError.d.ts +1 -2
- package/dist/cjs/api/errors/ConflictError.d.ts +1 -2
- package/dist/cjs/api/errors/ForbiddenError.d.ts +1 -2
- package/dist/cjs/api/errors/InternalServerError.d.ts +1 -2
- package/dist/cjs/api/errors/NotFoundError.d.ts +1 -2
- package/dist/cjs/api/errors/RequestTimeoutError.d.ts +6 -0
- package/dist/cjs/api/errors/RequestTimeoutError.js +50 -0
- package/dist/cjs/api/errors/TooManyRequestsError.d.ts +6 -0
- package/dist/cjs/api/errors/TooManyRequestsError.js +50 -0
- package/dist/cjs/api/errors/UnprocessableEntityError.d.ts +6 -0
- package/dist/cjs/api/errors/UnprocessableEntityError.js +50 -0
- package/dist/cjs/api/errors/index.d.ts +3 -0
- package/dist/cjs/api/errors/index.js +3 -0
- package/dist/cjs/api/resources/amendments/client/Client.d.ts +83 -0
- package/dist/cjs/api/resources/amendments/client/Client.js +313 -0
- package/dist/cjs/api/resources/amendments/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/amendments/client/index.js +17 -0
- package/dist/cjs/api/resources/amendments/client/requests/GetOrderAmendmentOptionsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/amendments/client/requests/UnifiedAmendmentExecuteRequest.d.ts +35 -0
- package/dist/cjs/api/resources/amendments/client/requests/UnifiedAmendmentExecuteRequest.js +14 -0
- package/dist/cjs/api/resources/amendments/client/requests/UnifiedAmendmentPreviewRequest.d.ts +33 -0
- package/dist/cjs/api/resources/amendments/client/requests/UnifiedAmendmentPreviewRequest.js +14 -0
- package/dist/cjs/api/resources/amendments/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/amendments/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/amendments/index.d.ts +1 -0
- package/dist/cjs/api/resources/amendments/index.js +17 -0
- package/dist/cjs/api/resources/analytics/client/Client.d.ts +64 -0
- package/dist/cjs/api/resources/analytics/client/Client.js +276 -0
- package/dist/cjs/api/resources/analytics/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/analytics/client/index.js +17 -0
- package/dist/cjs/api/resources/analytics/client/requests/GetSignalsMetadataRequest.d.ts +12 -0
- package/dist/cjs/api/resources/analytics/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/analytics/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/analytics/index.d.ts +1 -0
- package/dist/cjs/api/resources/analytics/index.js +17 -0
- package/dist/cjs/api/resources/analyticsExperimental/client/Client.d.ts +70 -0
- package/dist/cjs/api/resources/analyticsExperimental/client/Client.js +282 -0
- package/dist/cjs/api/resources/analyticsExperimental/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/analyticsExperimental/client/index.js +17 -0
- package/dist/cjs/api/resources/analyticsExperimental/client/requests/GetExperimentalSignalsMetadataRequest.d.ts +12 -0
- package/dist/cjs/api/resources/analyticsExperimental/client/requests/GetExperimentalSignalsMetadataRequest.js +3 -0
- package/dist/cjs/api/resources/analyticsExperimental/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/analyticsExperimental/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/analyticsExperimental/index.d.ts +1 -0
- package/dist/cjs/api/resources/analyticsExperimental/index.js +17 -0
- package/dist/cjs/api/resources/checkouts/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/checkouts/client/Client.js +4 -1
- package/dist/cjs/api/resources/checkouts/client/requests/CreateCheckoutRequest.d.ts +8 -1
- package/dist/cjs/api/resources/contacts/client/Client.d.ts +6 -4
- package/dist/cjs/api/resources/contacts/client/Client.js +10 -4
- package/dist/cjs/api/resources/credits/client/Client.d.ts +76 -2
- package/dist/cjs/api/resources/credits/client/Client.js +371 -5
- package/dist/cjs/api/resources/credits/client/index.d.ts +1 -1
- package/dist/cjs/api/resources/credits/client/index.js +15 -0
- package/dist/cjs/api/resources/credits/client/requests/CreateCreditCurrencyRequest.d.ts +16 -0
- package/dist/cjs/api/resources/credits/client/requests/CreateCreditCurrencyRequest.js +3 -0
- package/dist/cjs/api/resources/credits/client/requests/GetCreditTransactionSummaryRequest.d.ts +33 -0
- package/dist/cjs/api/resources/credits/client/requests/GetCreditTransactionSummaryRequest.js +3 -0
- package/dist/cjs/api/resources/credits/client/requests/ListCreditCurrenciesRequest.d.ts +9 -0
- package/dist/cjs/api/resources/credits/client/requests/ListCreditCurrenciesRequest.js +3 -0
- package/dist/cjs/api/resources/credits/client/requests/ListCreditTransactionsRequest.d.ts +27 -0
- package/dist/cjs/api/resources/credits/client/requests/ListCreditTransactionsRequest.js +3 -0
- package/dist/cjs/api/resources/credits/client/requests/UpdateCreditCurrencyRequest.d.ts +24 -0
- package/dist/cjs/api/resources/credits/client/requests/UpdateCreditCurrencyRequest.js +12 -0
- package/dist/cjs/api/resources/credits/client/requests/index.d.ts +5 -0
- package/dist/cjs/api/resources/credits/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/credits/index.d.ts +1 -0
- package/dist/cjs/api/resources/credits/index.js +1 -0
- package/dist/cjs/api/resources/credits/types/GetCreditTransactionSummaryRequestGroupBy.d.ts +4 -0
- package/dist/cjs/api/resources/credits/types/GetCreditTransactionSummaryRequestGroupBy.js +7 -0
- package/dist/cjs/api/resources/credits/types/GetCreditTransactionSummaryRequestInterval.d.ts +6 -0
- package/dist/cjs/api/resources/credits/types/GetCreditTransactionSummaryRequestInterval.js +9 -0
- package/dist/cjs/api/resources/credits/types/GetCreditTransactionSummaryRequestType.d.ts +6 -0
- package/dist/cjs/api/resources/credits/types/GetCreditTransactionSummaryRequestType.js +9 -0
- package/dist/cjs/api/resources/credits/types/ListCreditCurrenciesRequestStatus.d.ts +6 -0
- package/dist/cjs/api/resources/credits/types/ListCreditCurrenciesRequestStatus.js +9 -0
- package/dist/cjs/api/resources/credits/types/ListCreditTransactionsRequestType.d.ts +6 -0
- package/dist/cjs/api/resources/credits/types/ListCreditTransactionsRequestType.js +9 -0
- package/dist/cjs/api/resources/credits/types/index.d.ts +5 -0
- package/dist/cjs/api/resources/credits/types/index.js +21 -0
- package/dist/cjs/api/resources/customViewsExperimental/client/Client.d.ts +200 -0
- package/dist/cjs/api/resources/customViewsExperimental/client/Client.js +785 -0
- package/dist/cjs/api/resources/customViewsExperimental/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/customViewsExperimental/client/index.js +17 -0
- package/dist/cjs/api/resources/customViewsExperimental/client/requests/CreateCustomViewRequest.d.ts +70 -0
- package/dist/cjs/api/resources/customViewsExperimental/client/requests/CreateCustomViewRequest.js +26 -0
- package/dist/cjs/api/resources/customViewsExperimental/client/requests/GetCustomViewCustomerUnitsRequest.d.ts +14 -0
- package/dist/cjs/api/resources/customViewsExperimental/client/requests/GetCustomViewCustomerUnitsRequest.js +3 -0
- package/dist/cjs/api/resources/customViewsExperimental/client/requests/GetCustomViewDataRequest.d.ts +28 -0
- package/dist/cjs/api/resources/customViewsExperimental/client/requests/GetCustomViewDataRequest.js +3 -0
- package/dist/cjs/api/resources/customViewsExperimental/client/requests/GetCustomViewEmbedTokenRequest.d.ts +14 -0
- package/dist/cjs/api/resources/customViewsExperimental/client/requests/GetCustomViewEmbedTokenRequest.js +3 -0
- package/dist/cjs/api/resources/customViewsExperimental/client/requests/GetCustomViewRequest.d.ts +9 -0
- package/dist/cjs/api/resources/customViewsExperimental/client/requests/GetCustomViewRequest.js +3 -0
- package/dist/cjs/api/resources/customViewsExperimental/client/requests/PublishCustomViewRequest.d.ts +9 -0
- package/dist/cjs/api/resources/customViewsExperimental/client/requests/PublishCustomViewRequest.js +3 -0
- package/dist/cjs/api/resources/customViewsExperimental/client/requests/UpdateCustomViewPeriodRequest.d.ts +46 -0
- package/dist/cjs/api/resources/customViewsExperimental/client/requests/UpdateCustomViewPeriodRequest.js +21 -0
- package/dist/cjs/api/resources/customViewsExperimental/client/requests/UpdateCustomViewRequest.d.ts +30 -0
- package/dist/cjs/api/resources/customViewsExperimental/client/requests/UpdateCustomViewRequest.js +3 -0
- package/dist/cjs/api/resources/customViewsExperimental/client/requests/index.d.ts +8 -0
- package/dist/cjs/api/resources/customViewsExperimental/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/customViewsExperimental/index.d.ts +2 -0
- package/dist/cjs/api/resources/customViewsExperimental/index.js +18 -0
- package/dist/cjs/api/resources/customViewsExperimental/types/GetCustomViewDataRequestIncludeDraft.d.ts +5 -0
- package/dist/cjs/api/resources/customViewsExperimental/types/GetCustomViewDataRequestIncludeDraft.js +8 -0
- package/dist/cjs/api/resources/customViewsExperimental/types/GetCustomViewDataRequestPeriodKind.d.ts +5 -0
- package/dist/cjs/api/resources/customViewsExperimental/types/GetCustomViewDataRequestPeriodKind.js +8 -0
- package/dist/cjs/api/resources/customViewsExperimental/types/GetCustomViewDataRequestPeriodUnit.d.ts +6 -0
- package/dist/cjs/api/resources/customViewsExperimental/types/GetCustomViewDataRequestPeriodUnit.js +9 -0
- package/dist/cjs/api/resources/customViewsExperimental/types/GetCustomViewDataRequestUnitMode.d.ts +6 -0
- package/dist/cjs/api/resources/customViewsExperimental/types/GetCustomViewDataRequestUnitMode.js +9 -0
- package/dist/cjs/api/resources/customViewsExperimental/types/index.d.ts +4 -0
- package/dist/cjs/api/resources/customViewsExperimental/types/index.js +20 -0
- package/dist/cjs/api/resources/customerPortals/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/customerPortals/client/Client.js +1 -1
- package/dist/cjs/api/resources/customers/client/Client.d.ts +1049 -15
- package/dist/cjs/api/resources/customers/client/Client.js +4104 -99
- package/dist/cjs/api/resources/customers/client/requests/CreateCustomerAliasByExternalIdRequest.d.ts +15 -0
- package/dist/cjs/api/resources/customers/client/requests/CreateCustomerAliasByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/CreateCustomerAliasRequest.d.ts +15 -0
- package/dist/cjs/api/resources/customers/client/requests/CreateCustomerAliasRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/CreateCustomerApiKeyByExternalIdRequest.d.ts +15 -0
- package/dist/cjs/api/resources/customers/client/requests/CreateCustomerApiKeyByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/CreateCustomerApiKeyRequest.d.ts +15 -0
- package/dist/cjs/api/resources/customers/client/requests/CreateCustomerApiKeyRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/CreateCustomerFundingInstructionsByExternalIdRequest.d.ts +12 -0
- package/dist/cjs/api/resources/customers/client/requests/CreateCustomerFundingInstructionsByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/CreateCustomerFundingInstructionsRequest.d.ts +13 -0
- package/dist/cjs/api/resources/customers/client/requests/CreateCustomerFundingInstructionsRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/CreateCustomerRequest.d.ts +1 -1
- package/dist/cjs/api/resources/customers/client/requests/CreateCustomerUnitAliasByExternalIdRequest.d.ts +18 -0
- package/dist/cjs/api/resources/customers/client/requests/CreateCustomerUnitAliasByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/CreateCustomerUnitAliasByKeyRequest.d.ts +15 -0
- package/dist/cjs/api/resources/customers/client/requests/CreateCustomerUnitAliasByKeyRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/CreateCustomerUnitAliasRequest.d.ts +18 -0
- package/dist/cjs/api/resources/customers/client/requests/CreateCustomerUnitAliasRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/CreateCustomerUnitByExternalIdRequest.d.ts +15 -0
- package/dist/cjs/api/resources/customers/client/requests/CreateCustomerUnitByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/CreateCustomerUnitRequest.d.ts +15 -0
- package/dist/cjs/api/resources/customers/client/requests/CreateCustomerUnitRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/CustomerUnitCreateUnderParent.d.ts +21 -0
- package/dist/cjs/api/resources/customers/client/requests/CustomerUnitCreateUnderParent.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerAliasByExternalIdRequest.d.ts +13 -0
- package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerAliasByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerAliasRequest.d.ts +13 -0
- package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerAliasRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerByExternalIdRequest.d.ts +2 -1
- package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerByIdRequest.d.ts +2 -1
- package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerUnitAliasByExternalIdRequest.d.ts +16 -0
- package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerUnitAliasByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerUnitAliasByKeyRequest.d.ts +13 -0
- package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerUnitAliasByKeyRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerUnitAliasRequest.d.ts +16 -0
- package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerUnitAliasRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerUnitByExternalIdRequest.d.ts +13 -0
- package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerUnitByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerUnitRequest.d.ts +13 -0
- package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerUnitRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/EndCustomerUnitCapByExternalIdRequest.d.ts +16 -0
- package/dist/cjs/api/resources/customers/client/requests/EndCustomerUnitCapByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/EndCustomerUnitCapRequest.d.ts +16 -0
- package/dist/cjs/api/resources/customers/client/requests/EndCustomerUnitCapRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerByExternalIdRequest.d.ts +2 -1
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerByIdRequest.d.ts +2 -1
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerCreditBalancesByExternalIdRequest.d.ts +2 -1
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerCreditBalancesRequest.d.ts +2 -1
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerFundingInstructionsByExternalIdRequest.d.ts +11 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerFundingInstructionsByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerFundingInstructionsRequest.d.ts +12 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerFundingInstructionsRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerStateByExternalIdRequest.d.ts +10 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerStateByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerStateByIdRequest.d.ts +10 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerStateByIdRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitByExternalIdRequest.d.ts +13 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitByKeyRequest.d.ts +10 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitByKeyRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitCapByExternalIdRequest.d.ts +16 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitCapByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitCapRequest.d.ts +16 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitCapRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitRequest.d.ts +13 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitSpendByExternalIdRequest.d.ts +22 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitSpendByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitSpendRequest.d.ts +22 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitSpendRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/GrantCustomerCreditsByExternalIdRequest.d.ts +19 -0
- package/dist/cjs/api/resources/customers/client/requests/GrantCustomerCreditsByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/GrantCustomerCreditsRequest.d.ts +19 -0
- package/dist/cjs/api/resources/customers/client/requests/GrantCustomerCreditsRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/ListCustomerAliasesByExternalIdRequest.d.ts +12 -0
- package/dist/cjs/api/resources/customers/client/requests/ListCustomerAliasesByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/ListCustomerAliasesRequest.d.ts +12 -0
- package/dist/cjs/api/resources/customers/client/requests/ListCustomerAliasesRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/ListCustomerApiKeysByExternalIdRequest.d.ts +12 -0
- package/dist/cjs/api/resources/customers/client/requests/ListCustomerApiKeysByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/ListCustomerApiKeysRequest.d.ts +12 -0
- package/dist/cjs/api/resources/customers/client/requests/ListCustomerApiKeysRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/ListCustomerPendingCreditConsumptionByExternalIdRequest.d.ts +12 -0
- package/dist/cjs/api/resources/customers/client/requests/ListCustomerPendingCreditConsumptionByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/ListCustomerPendingCreditConsumptionRequest.d.ts +12 -0
- package/dist/cjs/api/resources/customers/client/requests/ListCustomerPendingCreditConsumptionRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/ListCustomerUnitAliasesByExternalIdRequest.d.ts +15 -0
- package/dist/cjs/api/resources/customers/client/requests/ListCustomerUnitAliasesByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/ListCustomerUnitAliasesByKeyRequest.d.ts +12 -0
- package/dist/cjs/api/resources/customers/client/requests/ListCustomerUnitAliasesByKeyRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/ListCustomerUnitAliasesRequest.d.ts +15 -0
- package/dist/cjs/api/resources/customers/client/requests/ListCustomerUnitAliasesRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/ListCustomerUnitsByExternalIdRequest.d.ts +20 -0
- package/dist/cjs/api/resources/customers/client/requests/ListCustomerUnitsByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/ListCustomerUnitsRequest.d.ts +20 -0
- package/dist/cjs/api/resources/customers/client/requests/ListCustomerUnitsRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/ListCustomersRequest.d.ts +13 -0
- package/dist/cjs/api/resources/customers/client/requests/RevokeCustomerApiKeyByExternalIdRequest.d.ts +13 -0
- package/dist/cjs/api/resources/customers/client/requests/RevokeCustomerApiKeyByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/RevokeCustomerApiKeyRequest.d.ts +13 -0
- package/dist/cjs/api/resources/customers/client/requests/RevokeCustomerApiKeyRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/SetCustomerUnitCapByExternalIdRequest.d.ts +18 -0
- package/dist/cjs/api/resources/customers/client/requests/SetCustomerUnitCapByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/SetCustomerUnitCapRequest.d.ts +18 -0
- package/dist/cjs/api/resources/customers/client/requests/SetCustomerUnitCapRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/UpdateCustomerByExternalIdRequest.d.ts +2 -1
- package/dist/cjs/api/resources/customers/client/requests/UpdateCustomerByIdRequest.d.ts +2 -1
- package/dist/cjs/api/resources/customers/client/requests/UpdateCustomerUnitByExternalIdRequest.d.ts +16 -0
- package/dist/cjs/api/resources/customers/client/requests/UpdateCustomerUnitByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/UpdateCustomerUnitRequest.d.ts +16 -0
- package/dist/cjs/api/resources/customers/client/requests/UpdateCustomerUnitRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/index.d.ts +51 -0
- package/dist/cjs/api/resources/customers/index.d.ts +1 -0
- package/dist/cjs/api/resources/customers/index.js +1 -0
- package/dist/cjs/api/resources/customers/types/DeleteCustomerUnitAliasByExternalIdResponse.d.ts +1 -0
- package/dist/cjs/api/resources/customers/types/DeleteCustomerUnitAliasByExternalIdResponse.js +3 -0
- package/dist/cjs/api/resources/customers/types/DeleteCustomerUnitAliasByKeyResponse.d.ts +1 -0
- package/dist/cjs/api/resources/customers/types/DeleteCustomerUnitAliasByKeyResponse.js +3 -0
- package/dist/cjs/api/resources/customers/types/DeleteCustomerUnitAliasResponse.d.ts +1 -0
- package/dist/cjs/api/resources/customers/types/DeleteCustomerUnitAliasResponse.js +3 -0
- package/dist/cjs/api/resources/customers/types/ListCustomerUnitsByExternalIdRequestStatus.d.ts +6 -0
- package/dist/cjs/api/resources/customers/types/ListCustomerUnitsByExternalIdRequestStatus.js +9 -0
- package/dist/cjs/api/resources/customers/types/ListCustomerUnitsRequestStatus.d.ts +6 -0
- package/dist/cjs/api/resources/customers/types/ListCustomerUnitsRequestStatus.js +9 -0
- package/dist/cjs/api/resources/customers/types/ListCustomersRequestCreationState.d.ts +5 -0
- package/dist/cjs/api/resources/customers/types/ListCustomersRequestCreationState.js +8 -0
- package/dist/cjs/api/resources/customers/types/ListCustomersRequestStatus.d.ts +5 -0
- package/dist/cjs/api/resources/customers/types/ListCustomersRequestStatus.js +8 -0
- package/dist/cjs/api/resources/customers/types/index.d.ts +7 -0
- package/dist/cjs/api/resources/customers/types/index.js +23 -0
- package/dist/cjs/api/resources/deliveredValue/client/Client.d.ts +60 -0
- package/dist/cjs/api/resources/deliveredValue/client/Client.js +248 -0
- package/dist/cjs/api/resources/deliveredValue/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/deliveredValue/client/index.js +17 -0
- package/dist/cjs/api/resources/deliveredValue/client/requests/GetDeliveredValueRequest.d.ts +18 -0
- package/dist/cjs/api/resources/deliveredValue/client/requests/GetDeliveredValueRequest.js +3 -0
- package/dist/cjs/api/resources/deliveredValue/client/requests/GetDeliveredValueSummaryRequest.d.ts +29 -0
- package/dist/cjs/api/resources/deliveredValue/client/requests/GetDeliveredValueSummaryRequest.js +3 -0
- package/dist/cjs/api/resources/deliveredValue/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/deliveredValue/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/deliveredValue/index.d.ts +2 -0
- package/dist/cjs/api/resources/deliveredValue/index.js +18 -0
- package/dist/cjs/api/resources/deliveredValue/types/GetDeliveredValueSummaryRequestGroupBy.d.ts +7 -0
- package/dist/cjs/api/resources/deliveredValue/types/GetDeliveredValueSummaryRequestGroupBy.js +10 -0
- package/dist/cjs/api/resources/deliveredValue/types/GetDeliveredValueSummaryRequestInterval.d.ts +8 -0
- package/dist/cjs/api/resources/deliveredValue/types/GetDeliveredValueSummaryRequestInterval.js +11 -0
- package/dist/cjs/api/resources/deliveredValue/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/deliveredValue/types/index.js +18 -0
- package/dist/cjs/api/resources/index.d.ts +30 -0
- package/dist/cjs/api/resources/index.js +31 -1
- package/dist/cjs/api/resources/invoices/client/Client.js +37 -1
- package/dist/cjs/api/resources/invoices/client/requests/ListInvoicesRequest.d.ts +25 -0
- package/dist/cjs/api/resources/invoices/index.d.ts +1 -0
- package/dist/cjs/api/resources/invoices/index.js +1 -0
- package/dist/cjs/api/resources/invoices/types/ListInvoicesRequestPaymentStatus.d.ts +8 -0
- package/dist/cjs/api/resources/invoices/types/ListInvoicesRequestPaymentStatus.js +11 -0
- package/dist/cjs/api/resources/invoices/types/ListInvoicesRequestStatus.d.ts +10 -0
- package/dist/cjs/api/resources/invoices/types/ListInvoicesRequestStatus.js +13 -0
- package/dist/cjs/api/resources/invoices/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/invoices/types/index.js +18 -0
- package/dist/cjs/api/resources/orders/client/Client.d.ts +105 -1
- package/dist/cjs/api/resources/orders/client/Client.js +245 -2
- package/dist/cjs/api/resources/orders/client/requests/ActivateOrderByIdRequest.d.ts +9 -0
- package/dist/cjs/api/resources/orders/client/requests/ActivateOrderByIdRequest.js +3 -0
- package/dist/cjs/api/resources/orders/client/requests/CreateOrderRequest.d.ts +14 -1
- package/dist/cjs/api/resources/orders/client/requests/CreateOrderRequest.js +12 -0
- package/dist/cjs/api/resources/orders/client/requests/ListOrdersRequest.d.ts +19 -0
- package/dist/cjs/api/resources/orders/client/requests/ProvisionRequest.d.ts +82 -0
- package/dist/cjs/api/resources/orders/client/requests/ProvisionRequest.js +3 -0
- package/dist/cjs/api/resources/orders/client/requests/UpdateOrderRequest.d.ts +14 -1
- package/dist/cjs/api/resources/orders/client/requests/UpdateOrderRequest.js +12 -0
- package/dist/cjs/api/resources/orders/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/orders/types/ListOrdersRequestCreationState.d.ts +5 -0
- package/dist/cjs/api/resources/orders/types/ListOrdersRequestCreationState.js +8 -0
- package/dist/cjs/api/resources/orders/types/OrderStatusFilter.d.ts +7 -0
- package/dist/cjs/api/resources/orders/types/OrderStatusFilter.js +10 -0
- package/dist/cjs/api/resources/orders/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/orders/types/index.js +2 -0
- package/dist/cjs/api/resources/paymentAllocations/client/Client.d.ts +56 -0
- package/dist/cjs/api/resources/paymentAllocations/client/Client.js +227 -0
- package/dist/cjs/api/resources/paymentAllocations/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/paymentAllocations/client/index.js +17 -0
- package/dist/cjs/api/resources/paymentAllocations/client/requests/CreatePaymentAllocationRequest.d.ts +17 -0
- package/dist/cjs/api/resources/paymentAllocations/client/requests/CreatePaymentAllocationRequest.js +3 -0
- package/dist/cjs/api/resources/paymentAllocations/client/requests/ListPaymentAllocationsRequest.d.ts +15 -0
- package/dist/cjs/api/resources/paymentAllocations/client/requests/ListPaymentAllocationsRequest.js +3 -0
- package/dist/cjs/api/resources/paymentAllocations/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/paymentAllocations/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/paymentAllocations/index.d.ts +1 -0
- package/dist/cjs/api/resources/paymentAllocations/index.js +17 -0
- package/dist/cjs/api/resources/paymentMethods/client/Client.d.ts +104 -0
- package/dist/cjs/api/resources/paymentMethods/client/Client.js +446 -0
- package/dist/cjs/api/resources/paymentMethods/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/paymentMethods/client/index.js +17 -0
- package/dist/cjs/api/resources/paymentMethods/client/requests/CreatePaymentMethodRequest.d.ts +18 -0
- package/dist/cjs/api/resources/paymentMethods/client/requests/CreatePaymentMethodRequest.js +3 -0
- package/dist/cjs/api/resources/paymentMethods/client/requests/DeletePaymentMethodRequest.d.ts +9 -0
- package/dist/cjs/api/resources/paymentMethods/client/requests/DeletePaymentMethodRequest.js +3 -0
- package/dist/cjs/api/resources/paymentMethods/client/requests/GetPaymentMethodRequest.d.ts +9 -0
- package/dist/cjs/api/resources/paymentMethods/client/requests/GetPaymentMethodRequest.js +3 -0
- package/dist/cjs/api/resources/paymentMethods/client/requests/ListPaymentMethodsRequest.d.ts +14 -0
- package/dist/cjs/api/resources/paymentMethods/client/requests/ListPaymentMethodsRequest.js +3 -0
- package/dist/cjs/api/resources/paymentMethods/client/requests/UpdateDefaultPaymentMethodRequest.d.ts +9 -0
- package/dist/cjs/api/resources/paymentMethods/client/requests/UpdateDefaultPaymentMethodRequest.js +3 -0
- package/dist/cjs/api/resources/paymentMethods/client/requests/index.d.ts +5 -0
- package/dist/cjs/api/resources/paymentMethods/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/paymentMethods/index.d.ts +1 -0
- package/dist/cjs/api/resources/paymentMethods/index.js +17 -0
- package/dist/cjs/api/resources/payments/client/Client.d.ts +68 -0
- package/dist/cjs/api/resources/payments/client/Client.js +293 -0
- package/dist/cjs/api/resources/payments/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/payments/client/index.js +17 -0
- package/dist/cjs/api/resources/payments/client/requests/CreatePaymentRequest.d.ts +25 -0
- package/dist/cjs/api/resources/payments/client/requests/CreatePaymentRequest.js +3 -0
- package/dist/cjs/api/resources/payments/client/requests/GetPaymentRequest.d.ts +9 -0
- package/dist/cjs/api/resources/payments/client/requests/GetPaymentRequest.js +3 -0
- package/dist/cjs/api/resources/payments/client/requests/ListPaymentsRequest.d.ts +15 -0
- package/dist/cjs/api/resources/payments/client/requests/ListPaymentsRequest.js +3 -0
- package/dist/cjs/api/resources/payments/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/payments/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/payments/index.d.ts +2 -0
- package/dist/cjs/api/resources/payments/index.js +18 -0
- package/dist/cjs/api/resources/payments/types/ListPaymentsRequestStatus.d.ts +9 -0
- package/dist/cjs/api/resources/payments/types/ListPaymentsRequestStatus.js +12 -0
- package/dist/cjs/api/resources/payments/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/payments/types/index.js +17 -0
- package/dist/cjs/api/resources/plans/client/Client.d.ts +152 -0
- package/dist/cjs/api/resources/plans/client/Client.js +593 -0
- package/dist/cjs/api/resources/plans/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/plans/client/index.js +17 -0
- package/dist/cjs/api/resources/plans/client/requests/CreatePlanRequest.d.ts +28 -0
- package/dist/cjs/api/resources/plans/client/requests/CreatePlanRequest.js +3 -0
- package/dist/cjs/api/resources/plans/client/requests/GetPlanByExternalIdRequest.d.ts +9 -0
- package/dist/cjs/api/resources/plans/client/requests/GetPlanByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/plans/client/requests/GetPlanByIdRequest.d.ts +9 -0
- package/dist/cjs/api/resources/plans/client/requests/GetPlanByIdRequest.js +3 -0
- package/dist/cjs/api/resources/plans/client/requests/ListPlansRequest.d.ts +12 -0
- package/dist/cjs/api/resources/plans/client/requests/ListPlansRequest.js +3 -0
- package/dist/cjs/api/resources/plans/client/requests/UpdatePlanByExternalIdRequest.d.ts +12 -0
- package/dist/cjs/api/resources/plans/client/requests/UpdatePlanByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/plans/client/requests/UpdatePlanByIdRequest.d.ts +12 -0
- package/dist/cjs/api/resources/plans/client/requests/UpdatePlanByIdRequest.js +3 -0
- package/dist/cjs/api/resources/plans/client/requests/UpdatePlanUpgradePathRequest.d.ts +15 -0
- package/dist/cjs/api/resources/plans/client/requests/UpdatePlanUpgradePathRequest.js +3 -0
- package/dist/cjs/api/resources/plans/client/requests/index.d.ts +7 -0
- package/dist/cjs/api/resources/plans/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/plans/index.d.ts +1 -0
- package/dist/cjs/api/resources/plans/index.js +17 -0
- package/dist/cjs/api/resources/pricing/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/pricing/client/Client.js +2 -2
- package/dist/cjs/api/resources/pricing/client/requests/UpdatePricingRequest.d.ts +1 -1
- package/dist/cjs/api/resources/products/client/Client.d.ts +9 -9
- package/dist/cjs/api/resources/products/client/Client.js +15 -6
- package/dist/cjs/api/resources/products/client/requests/ListProductsRequest.d.ts +6 -0
- package/dist/cjs/api/resources/signals/client/Client.d.ts +175 -4
- package/dist/cjs/api/resources/signals/client/Client.js +569 -4
- package/dist/cjs/api/resources/signals/client/requests/BulkSignalsRequest.d.ts +17 -3
- package/dist/cjs/api/resources/signals/client/requests/CreateSignalSummaryExportRequest.d.ts +56 -0
- package/dist/cjs/api/resources/signals/client/requests/CreateSignalSummaryExportRequest.js +12 -0
- package/dist/cjs/api/resources/signals/client/requests/GetSignalByIdRequest.d.ts +10 -0
- package/dist/cjs/api/resources/signals/client/requests/GetSignalByIdRequest.js +3 -0
- package/dist/cjs/api/resources/signals/client/requests/GetSignalSummaryExportRequest.d.ts +9 -0
- package/dist/cjs/api/resources/signals/client/requests/GetSignalSummaryExportRequest.js +3 -0
- package/dist/cjs/api/resources/signals/client/requests/GetSignalSummaryRequest.d.ts +45 -0
- package/dist/cjs/api/resources/signals/client/requests/GetSignalSummaryRequest.js +3 -0
- package/dist/cjs/api/resources/signals/client/requests/ListSignalsRequest.d.ts +22 -0
- package/dist/cjs/api/resources/signals/client/requests/ListSignalsRequest.js +3 -0
- package/dist/cjs/api/resources/signals/client/requests/SignalLookupRequest.d.ts +10 -0
- package/dist/cjs/api/resources/signals/client/requests/SignalLookupRequest.js +3 -0
- package/dist/cjs/api/resources/signals/client/requests/index.d.ts +6 -0
- package/dist/cjs/api/resources/signals/index.d.ts +1 -0
- package/dist/cjs/api/resources/signals/index.js +1 -0
- package/dist/cjs/api/resources/signals/types/GetSignalSummaryRequestGroupBy.d.ts +5 -0
- package/dist/cjs/api/resources/signals/types/GetSignalSummaryRequestGroupBy.js +8 -0
- package/dist/cjs/api/resources/signals/types/GetSignalSummaryRequestInterval.d.ts +7 -0
- package/dist/cjs/api/resources/signals/types/GetSignalSummaryRequestInterval.js +10 -0
- package/dist/cjs/api/resources/signals/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/signals/types/index.js +18 -0
- package/dist/cjs/api/resources/valueMetrics/client/Client.d.ts +111 -0
- package/dist/cjs/api/resources/valueMetrics/client/Client.js +446 -0
- package/dist/cjs/api/resources/valueMetrics/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/valueMetrics/client/index.js +17 -0
- package/dist/cjs/api/resources/valueMetrics/client/requests/ArchiveValueMetricRequest.d.ts +10 -0
- package/dist/cjs/api/resources/valueMetrics/client/requests/ArchiveValueMetricRequest.js +3 -0
- package/dist/cjs/api/resources/valueMetrics/client/requests/CreateValueMetricRequest.d.ts +57 -0
- package/dist/cjs/api/resources/valueMetrics/client/requests/CreateValueMetricRequest.js +15 -0
- package/dist/cjs/api/resources/valueMetrics/client/requests/GetValueMetricRequest.d.ts +9 -0
- package/dist/cjs/api/resources/valueMetrics/client/requests/GetValueMetricRequest.js +3 -0
- package/dist/cjs/api/resources/valueMetrics/client/requests/ListValueMetricsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/valueMetrics/client/requests/ListValueMetricsRequest.js +3 -0
- package/dist/cjs/api/resources/valueMetrics/client/requests/UpdateValueMetricRequest.d.ts +43 -0
- package/dist/cjs/api/resources/valueMetrics/client/requests/UpdateValueMetricRequest.js +15 -0
- package/dist/cjs/api/resources/valueMetrics/client/requests/index.d.ts +5 -0
- package/dist/cjs/api/resources/valueMetrics/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/valueMetrics/index.d.ts +1 -0
- package/dist/cjs/api/resources/valueMetrics/index.js +17 -0
- package/dist/cjs/api/resources/valueModels/client/Client.d.ts +120 -0
- package/dist/cjs/api/resources/valueModels/client/Client.js +425 -0
- package/dist/cjs/api/resources/valueModels/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/valueModels/client/index.js +17 -0
- package/dist/cjs/api/resources/valueModels/client/requests/GetValueModelVersionRequest.d.ts +9 -0
- package/dist/cjs/api/resources/valueModels/client/requests/GetValueModelVersionRequest.js +3 -0
- package/dist/cjs/api/resources/valueModels/client/requests/ListValueModelVersionsRequest.d.ts +8 -0
- package/dist/cjs/api/resources/valueModels/client/requests/ListValueModelVersionsRequest.js +3 -0
- package/dist/cjs/api/resources/valueModels/client/requests/RefreshValueModelBackfillRequest.d.ts +5 -0
- package/dist/cjs/api/resources/valueModels/client/requests/RefreshValueModelBackfillRequest.js +3 -0
- package/dist/cjs/api/resources/valueModels/client/requests/ValueModelUploadRequest.d.ts +46 -0
- package/dist/cjs/api/resources/valueModels/client/requests/ValueModelUploadRequest.js +3 -0
- package/dist/cjs/api/resources/valueModels/client/requests/index.d.ts +4 -0
- package/dist/cjs/api/resources/valueModels/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/valueModels/index.d.ts +1 -0
- package/dist/cjs/api/resources/valueModels/index.js +17 -0
- package/dist/cjs/api/resources/valueReceipts/client/Client.d.ts +45 -14
- package/dist/cjs/api/resources/valueReceipts/client/Client.js +156 -46
- package/dist/cjs/api/resources/valueReceipts/client/requests/PublishValueReceiptBody.d.ts +1 -0
- package/dist/cjs/api/resources/valueReceipts/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +19 -4
- package/dist/cjs/api/resources/webhooks/client/Client.js +71 -3
- package/dist/cjs/api/resources/webhooks/client/requests/RotateWebhookSecretRequest.d.ts +5 -0
- package/dist/cjs/api/resources/webhooks/client/requests/RotateWebhookSecretRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/client/requests/TestWebhookRequest.d.ts +1 -1
- package/dist/cjs/api/resources/webhooks/client/requests/UpdateWebhookRequest.d.ts +2 -2
- package/dist/cjs/api/resources/webhooks/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/webhooks/types/TestWebhookRequestWebhookName.d.ts +2 -1
- package/dist/cjs/api/resources/webhooks/types/TestWebhookRequestWebhookName.js +2 -1
- package/dist/cjs/api/resources/webhooks/types/UpdateWebhookRequestWebhookName.d.ts +2 -1
- package/dist/cjs/api/resources/webhooks/types/UpdateWebhookRequestWebhookName.js +2 -1
- package/dist/cjs/api/types/AddAttributeIntent.d.ts +45 -0
- package/dist/cjs/api/types/AddAttributeIntent.js +24 -0
- package/dist/cjs/api/types/AddFromCatalogIntent.d.ts +22 -0
- package/dist/cjs/api/types/AddFromCatalogIntent.js +13 -0
- package/dist/cjs/api/types/AmendmentAddAttributeOptions.d.ts +9 -0
- package/dist/cjs/api/types/AmendmentAddAttributeOptions.js +3 -0
- package/dist/cjs/api/types/AmendmentAddAxisOptions.d.ts +10 -0
- package/dist/cjs/api/types/AmendmentAddAxisOptions.js +3 -0
- package/dist/cjs/api/types/AmendmentAttributeOptions.d.ts +14 -0
- package/dist/cjs/api/types/AmendmentAttributeOptions.js +3 -0
- package/dist/cjs/api/types/AmendmentAttributeState.d.ts +24 -0
- package/dist/cjs/api/types/AmendmentAttributeState.js +3 -0
- package/dist/cjs/api/types/AmendmentAxisChoiceValue.d.ts +10 -0
- package/dist/cjs/api/types/AmendmentAxisChoiceValue.js +13 -0
- package/dist/cjs/api/types/AmendmentAxisId.d.ts +8 -0
- package/dist/cjs/api/types/AmendmentAxisId.js +11 -0
- package/dist/cjs/api/types/AmendmentAxisOptions.d.ts +16 -0
- package/dist/cjs/api/types/AmendmentAxisOptions.js +3 -0
- package/dist/cjs/api/types/AmendmentAxisRelevance.d.ts +6 -0
- package/dist/cjs/api/types/AmendmentAxisRelevance.js +9 -0
- package/dist/cjs/api/types/AmendmentBillingType.d.ts +6 -0
- package/dist/cjs/api/types/AmendmentBillingType.js +9 -0
- package/dist/cjs/api/types/AmendmentChargeType.d.ts +8 -0
- package/dist/cjs/api/types/AmendmentChargeType.js +11 -0
- package/dist/cjs/api/types/AmendmentCreditEffectKind.d.ts +6 -0
- package/dist/cjs/api/types/AmendmentCreditEffectKind.js +9 -0
- package/dist/cjs/api/types/AmendmentErrorResponse.d.ts +7 -0
- package/dist/cjs/api/types/AmendmentErrorResponse.js +3 -0
- package/dist/cjs/api/types/AmendmentIntentKind.d.ts +10 -0
- package/dist/cjs/api/types/AmendmentIntentKind.js +13 -0
- package/dist/cjs/api/types/AmendmentIntentOptions.d.ts +7 -0
- package/dist/cjs/api/types/AmendmentIntentOptions.js +3 -0
- package/dist/cjs/api/types/AmendmentLineOptions.d.ts +12 -0
- package/dist/cjs/api/types/AmendmentLineOptions.js +3 -0
- package/dist/cjs/api/types/AmendmentMoneyBilling.d.ts +6 -0
- package/dist/cjs/api/types/AmendmentMoneyBilling.js +9 -0
- package/dist/cjs/api/types/AmendmentOptions.d.ts +26 -0
- package/dist/cjs/api/types/AmendmentOptions.js +3 -0
- package/dist/cjs/api/types/AmendmentPlan.d.ts +24 -0
- package/dist/cjs/api/types/AmendmentPlan.js +3 -0
- package/dist/cjs/api/types/AmendmentPlanAttributeDiff.d.ts +18 -0
- package/dist/cjs/api/types/AmendmentPlanAttributeDiff.js +3 -0
- package/dist/cjs/api/types/AmendmentPlanChange.d.ts +9 -0
- package/dist/cjs/api/types/AmendmentPlanChange.js +12 -0
- package/dist/cjs/api/types/AmendmentPlanCreditEffect.d.ts +15 -0
- package/dist/cjs/api/types/AmendmentPlanCreditEffect.js +3 -0
- package/dist/cjs/api/types/AmendmentPlanLineType.d.ts +8 -0
- package/dist/cjs/api/types/AmendmentPlanLineType.js +11 -0
- package/dist/cjs/api/types/AmendmentPlanMoneyEffect.d.ts +31 -0
- package/dist/cjs/api/types/AmendmentPlanMoneyEffect.js +13 -0
- package/dist/cjs/api/types/AmendmentPlanTreatmentResolution.d.ts +12 -0
- package/dist/cjs/api/types/AmendmentPlanTreatmentResolution.js +3 -0
- package/dist/cjs/api/types/AmendmentPlanUsageEffect.d.ts +17 -0
- package/dist/cjs/api/types/AmendmentPlanUsageEffect.js +12 -0
- package/dist/cjs/api/types/AmendmentPricingClause.d.ts +14 -0
- package/dist/cjs/api/types/AmendmentPricingClause.js +3 -0
- package/dist/cjs/api/types/AmendmentPricingModel.d.ts +11 -0
- package/dist/cjs/api/types/AmendmentPricingModel.js +14 -0
- package/dist/cjs/api/types/AmendmentTreatmentSource.d.ts +7 -0
- package/dist/cjs/api/types/AmendmentTreatmentSource.js +10 -0
- package/dist/cjs/api/types/AnalyticsColumn.d.ts +5 -0
- package/dist/cjs/api/types/AnalyticsColumn.js +3 -0
- package/dist/cjs/api/types/AnalyticsQueryRequest.d.ts +4 -0
- package/dist/cjs/api/types/AnalyticsQueryRequest.js +3 -0
- package/dist/cjs/api/types/AnalyticsQueryResponse.d.ts +15 -0
- package/dist/cjs/api/types/AnalyticsQueryResponse.js +3 -0
- package/dist/cjs/api/types/AnalyticsSchemaColumn.d.ts +6 -0
- package/dist/cjs/api/types/AnalyticsSchemaColumn.js +3 -0
- package/dist/cjs/api/types/AnalyticsSchemaResponse.d.ts +4 -0
- package/dist/cjs/api/types/AnalyticsSchemaResponse.js +3 -0
- package/dist/cjs/api/types/AnalyticsSchemaView.d.ts +6 -0
- package/dist/cjs/api/types/AnalyticsSchemaView.js +3 -0
- package/dist/cjs/api/types/Attribution.d.ts +3 -0
- package/dist/cjs/api/types/BackfillResponse.d.ts +4 -0
- package/dist/cjs/api/types/BackfillResponse.js +3 -0
- package/dist/cjs/api/types/ChargeStubAddAxisOptions.d.ts +34 -0
- package/dist/cjs/api/types/ChargeStubAddAxisOptions.js +19 -0
- package/dist/cjs/api/types/ChargeStubAxisOptions.d.ts +33 -0
- package/dist/cjs/api/types/ChargeStubAxisOptions.js +19 -0
- package/dist/cjs/api/types/Checkout.d.ts +6 -0
- package/dist/cjs/api/types/CheckoutCustomCard.d.ts +10 -0
- package/dist/cjs/api/types/CheckoutCustomCard.js +3 -0
- package/dist/cjs/api/types/CheckoutCustomCardInput.d.ts +10 -0
- package/dist/cjs/api/types/CheckoutCustomCardInput.js +3 -0
- package/dist/cjs/api/types/CheckoutDetails.d.ts +7 -0
- package/dist/cjs/api/types/CheckoutPlan.d.ts +4 -0
- package/dist/cjs/api/types/CheckoutPlan.js +3 -0
- package/dist/cjs/api/types/CheckoutPlanInput.d.ts +6 -0
- package/dist/cjs/api/types/CheckoutPlanInput.js +3 -0
- package/dist/cjs/api/types/CheckoutProduct.d.ts +3 -0
- package/dist/cjs/api/types/CheckoutProductInput.d.ts +3 -0
- package/dist/cjs/api/types/CheckoutSelectedProduct.d.ts +8 -0
- package/dist/cjs/api/types/CheckoutSelectedProduct.js +3 -0
- package/dist/cjs/api/types/CreateOrderLineAttributeRequest.d.ts +47 -5
- package/dist/cjs/api/types/CreateOrderLineAttributeRequest.js +11 -0
- package/dist/cjs/api/types/CreateOrderLineRequest.d.ts +4 -0
- package/dist/cjs/api/types/CreditBalance.d.ts +3 -1
- package/dist/cjs/api/types/CreditBenefitInput.d.ts +12 -5
- package/dist/cjs/api/types/CreditBenefitInput.js +2 -0
- package/dist/cjs/api/types/CreditBenefitOutput.d.ts +8 -6
- package/dist/cjs/api/types/CreditCurrency.d.ts +17 -0
- package/dist/cjs/api/types/CreditCurrency.js +9 -0
- package/dist/cjs/api/types/CreditGrant.d.ts +3 -0
- package/dist/cjs/api/types/CreditGrantAddAxisOptions.d.ts +24 -0
- package/dist/cjs/api/types/CreditGrantAddAxisOptions.js +3 -0
- package/dist/cjs/api/types/CreditGrantAxisOptions.d.ts +23 -0
- package/dist/cjs/api/types/CreditGrantAxisOptions.js +3 -0
- package/dist/cjs/api/types/CreditGrantCreateRequest.d.ts +12 -0
- package/dist/cjs/api/types/CreditGrantCreateRequest.js +3 -0
- package/dist/cjs/api/types/CreditGrantCurrency.d.ts +6 -0
- package/dist/cjs/api/types/CreditGrantCurrency.js +3 -0
- package/dist/cjs/api/types/CreditGrantCustomer.d.ts +6 -0
- package/dist/cjs/api/types/CreditGrantCustomer.js +3 -0
- package/dist/cjs/api/types/CreditGrantResult.d.ts +19 -0
- package/dist/cjs/api/types/CreditGrantResult.js +11 -0
- package/dist/cjs/api/types/CreditGrantValue.d.ts +7 -0
- package/dist/cjs/api/types/CreditGrantValue.js +10 -0
- package/dist/cjs/api/types/CreditTransaction.d.ts +31 -0
- package/dist/cjs/api/types/CreditTransaction.js +13 -0
- package/dist/cjs/api/types/CreditTransactionCurrency.d.ts +6 -0
- package/dist/cjs/api/types/CreditTransactionCurrency.js +3 -0
- package/dist/cjs/api/types/CreditTransactionCustomer.d.ts +6 -0
- package/dist/cjs/api/types/CreditTransactionCustomer.js +3 -0
- package/dist/cjs/api/types/CreditTransactionListResponse.d.ts +6 -0
- package/dist/cjs/api/types/CreditTransactionListResponse.js +3 -0
- package/dist/cjs/api/types/CreditTransactionProduct.d.ts +11 -0
- package/dist/cjs/api/types/CreditTransactionProduct.js +3 -0
- package/dist/cjs/api/types/CreditTransactionSummaryBucket.d.ts +25 -0
- package/dist/cjs/api/types/CreditTransactionSummaryBucket.js +3 -0
- package/dist/cjs/api/types/CreditTransactionSummaryResponse.d.ts +32 -0
- package/dist/cjs/api/types/CreditTransactionSummaryResponse.js +23 -0
- package/dist/cjs/api/types/CurrencyCode.d.ts +4 -0
- package/dist/cjs/api/types/CurrencyCode.js +3 -0
- package/dist/cjs/api/types/CustomView.d.ts +29 -0
- package/dist/cjs/api/types/CustomView.js +17 -0
- package/dist/cjs/api/types/CustomViewAuthoringDetail.d.ts +73 -0
- package/dist/cjs/api/types/CustomViewAuthoringDetail.js +30 -0
- package/dist/cjs/api/types/CustomViewAuthoringGuide.d.ts +6 -0
- package/dist/cjs/api/types/CustomViewAuthoringGuide.js +3 -0
- package/dist/cjs/api/types/CustomViewContextCap.d.ts +27 -0
- package/dist/cjs/api/types/CustomViewContextCap.js +11 -0
- package/dist/cjs/api/types/CustomViewCustomerUnit.d.ts +16 -0
- package/dist/cjs/api/types/CustomViewCustomerUnit.js +3 -0
- package/dist/cjs/api/types/CustomViewDataContext.d.ts +57 -0
- package/dist/cjs/api/types/CustomViewDataContext.js +21 -0
- package/dist/cjs/api/types/CustomViewDetail.d.ts +64 -0
- package/dist/cjs/api/types/CustomViewDetail.js +30 -0
- package/dist/cjs/api/types/CustomViewEmbedTokenResponse.d.ts +6 -0
- package/dist/cjs/api/types/CustomViewEmbedTokenResponse.js +3 -0
- package/dist/cjs/api/types/CustomViewFilter.d.ts +6 -0
- package/dist/cjs/api/types/CustomViewFilter.js +3 -0
- package/dist/cjs/api/types/CustomViewListResponse.d.ts +4 -0
- package/dist/cjs/api/types/CustomViewListResponse.js +3 -0
- package/dist/cjs/api/types/CustomViewPreviewHarness.d.ts +4 -0
- package/dist/cjs/api/types/CustomViewPreviewHarness.js +3 -0
- package/dist/cjs/api/types/CustomViewPreviewHarnessColumn.d.ts +16 -0
- package/dist/cjs/api/types/CustomViewPreviewHarnessColumn.js +14 -0
- package/dist/cjs/api/types/CustomViewPreviewHarnessRequest.d.ts +12 -0
- package/dist/cjs/api/types/CustomViewPreviewHarnessRequest.js +3 -0
- package/dist/cjs/api/types/CustomViewQuery.d.ts +6 -0
- package/dist/cjs/api/types/CustomViewQuery.js +3 -0
- package/dist/cjs/api/types/CustomViewSummary.d.ts +61 -0
- package/dist/cjs/api/types/CustomViewSummary.js +30 -0
- package/dist/cjs/api/types/CustomViewUnitSelection.d.ts +14 -0
- package/dist/cjs/api/types/CustomViewUnitSelection.js +3 -0
- package/dist/cjs/api/types/CustomViewValidationFinding.d.ts +8 -0
- package/dist/cjs/api/types/CustomViewValidationFinding.js +3 -0
- package/dist/cjs/api/types/Customer.d.ts +14 -2
- package/dist/cjs/api/types/Customer.js +9 -0
- package/dist/cjs/api/types/CustomerAlias.d.ts +12 -0
- package/dist/cjs/api/types/CustomerAlias.js +3 -0
- package/dist/cjs/api/types/CustomerAliasCreateRequest.d.ts +8 -0
- package/dist/cjs/api/types/CustomerAliasCreateRequest.js +3 -0
- package/dist/cjs/api/types/CustomerAliasListResponse.d.ts +5 -0
- package/dist/cjs/api/types/CustomerAliasListResponse.js +3 -0
- package/dist/cjs/api/types/CustomerApiKey.d.ts +31 -0
- package/dist/cjs/api/types/CustomerApiKey.js +13 -0
- package/dist/cjs/api/types/CustomerApiKeyCreate.d.ts +8 -0
- package/dist/cjs/api/types/CustomerApiKeyCreate.js +3 -0
- package/dist/cjs/api/types/CustomerApiKeyCreated.d.ts +33 -0
- package/dist/cjs/api/types/CustomerApiKeyCreated.js +13 -0
- package/dist/cjs/api/types/CustomerApiKeyList.d.ts +5 -0
- package/dist/cjs/api/types/CustomerApiKeyList.js +3 -0
- package/dist/cjs/api/types/CustomerAttribution.d.ts +3 -0
- package/dist/{esm/api/types/CustomerBillingAddress.d.mts → cjs/api/types/CustomerBillingAddressInput.d.ts} +1 -1
- package/dist/cjs/api/types/CustomerBillingAddressInput.js +3 -0
- package/dist/cjs/api/types/CustomerBillingAddressResponse.d.ts +11 -0
- package/dist/cjs/api/types/CustomerBillingAddressResponse.js +3 -0
- package/dist/cjs/api/types/CustomerConnections.d.ts +7 -0
- package/dist/cjs/api/types/CustomerConnections.js +3 -0
- package/dist/cjs/api/types/CustomerFundingInstructions.d.ts +24 -0
- package/dist/cjs/api/types/CustomerFundingInstructions.js +10 -0
- package/dist/cjs/api/types/CustomerFundingInstructionsCreateRequest.d.ts +4 -0
- package/dist/cjs/api/types/CustomerFundingInstructionsCreateRequest.js +3 -0
- package/dist/cjs/api/types/CustomerState.d.ts +10 -0
- package/dist/cjs/api/types/CustomerState.js +3 -0
- package/dist/cjs/api/types/CustomerStateCheckoutLink.d.ts +18 -0
- package/dist/cjs/api/types/CustomerStateCheckoutLink.js +13 -0
- package/dist/cjs/api/types/CustomerStateCreditBalance.d.ts +6 -0
- package/dist/cjs/api/types/CustomerStateCreditBalance.js +3 -0
- package/dist/cjs/api/types/CustomerStateCreditSummary.d.ts +4 -0
- package/dist/cjs/api/types/CustomerStateCreditSummary.js +3 -0
- package/dist/cjs/api/types/CustomerStateCustomer.d.ts +8 -0
- package/dist/cjs/api/types/CustomerStateCustomer.js +3 -0
- package/dist/cjs/api/types/CustomerStateOrder.d.ts +21 -0
- package/dist/cjs/api/types/CustomerStateOrder.js +13 -0
- package/dist/cjs/api/types/CustomerStateProductRef.d.ts +5 -0
- package/dist/cjs/api/types/CustomerStateProductRef.js +3 -0
- package/dist/cjs/api/types/CustomerStateSeat.d.ts +17 -0
- package/dist/cjs/api/types/CustomerStateSeat.js +11 -0
- package/dist/cjs/api/types/CustomerStateSeatAssignee.d.ts +6 -0
- package/dist/cjs/api/types/CustomerStateSeatAssignee.js +3 -0
- package/dist/cjs/api/types/CustomerStateSeats.d.ts +7 -0
- package/dist/cjs/api/types/CustomerStateSeats.js +3 -0
- package/dist/cjs/api/types/CustomerUnit.d.ts +36 -0
- package/dist/cjs/api/types/CustomerUnit.js +13 -0
- package/dist/cjs/api/types/CustomerUnitAttribution.d.ts +7 -0
- package/dist/cjs/api/types/CustomerUnitAttribution.js +3 -0
- package/dist/cjs/api/types/CustomerUnitByKey.d.ts +37 -0
- package/dist/cjs/api/types/CustomerUnitByKey.js +13 -0
- package/dist/cjs/api/types/CustomerUnitCapCurrentPeriod.d.ts +11 -0
- package/dist/cjs/api/types/CustomerUnitCapCurrentPeriod.js +3 -0
- package/dist/cjs/api/types/CustomerUnitCapEndResponse.d.ts +12 -0
- package/dist/cjs/api/types/CustomerUnitCapEndResponse.js +3 -0
- package/dist/cjs/api/types/CustomerUnitCapEndedPolicy.d.ts +26 -0
- package/dist/cjs/api/types/CustomerUnitCapEndedPolicy.js +11 -0
- package/dist/cjs/api/types/CustomerUnitCapPeriod.d.ts +6 -0
- package/dist/cjs/api/types/CustomerUnitCapPeriod.js +3 -0
- package/dist/cjs/api/types/CustomerUnitCapPolicy.d.ts +26 -0
- package/dist/cjs/api/types/CustomerUnitCapPolicy.js +11 -0
- package/dist/cjs/api/types/CustomerUnitCapResponse.d.ts +11 -0
- package/dist/cjs/api/types/CustomerUnitCapResponse.js +3 -0
- package/dist/cjs/api/types/CustomerUnitCapSavedPolicy.d.ts +26 -0
- package/dist/cjs/api/types/CustomerUnitCapSavedPolicy.js +11 -0
- package/dist/cjs/api/types/CustomerUnitCapSchedule.d.ts +9 -0
- package/dist/cjs/api/types/CustomerUnitCapSchedule.js +3 -0
- package/dist/cjs/api/types/CustomerUnitCapScheduleInput.d.ts +9 -0
- package/dist/cjs/api/types/CustomerUnitCapScheduleInput.js +3 -0
- package/dist/cjs/api/types/CustomerUnitCapSet.d.ts +19 -0
- package/dist/cjs/api/types/CustomerUnitCapSet.js +11 -0
- package/dist/cjs/api/types/CustomerUnitCapSetResponse.d.ts +13 -0
- package/dist/cjs/api/types/CustomerUnitCapSetResponse.js +3 -0
- package/dist/cjs/api/types/CustomerUnitCreate.d.ts +14 -0
- package/dist/cjs/api/types/CustomerUnitCreate.js +3 -0
- package/dist/cjs/api/types/CustomerUnitCreatedUnderParent.d.ts +34 -0
- package/dist/cjs/api/types/CustomerUnitCreatedUnderParent.js +13 -0
- package/dist/cjs/api/types/CustomerUnitListResponse.d.ts +6 -0
- package/dist/cjs/api/types/CustomerUnitListResponse.js +3 -0
- package/dist/cjs/api/types/CustomerUnitSpendResponse.d.ts +12 -0
- package/dist/cjs/api/types/CustomerUnitSpendResponse.js +3 -0
- package/dist/cjs/api/types/CustomerUnitSpendWindow.d.ts +9 -0
- package/dist/cjs/api/types/CustomerUnitSpendWindow.js +3 -0
- package/dist/cjs/api/types/CustomerUnitUpdate.d.ts +12 -0
- package/dist/cjs/api/types/CustomerUnitUpdate.js +3 -0
- package/dist/cjs/api/types/DeliveredValueCalculation.d.ts +11 -0
- package/dist/cjs/api/types/DeliveredValueCalculation.js +3 -0
- package/dist/cjs/api/types/DeliveredValueCalculationTerm.d.ts +34 -0
- package/dist/cjs/api/types/DeliveredValueCalculationTerm.js +24 -0
- package/dist/cjs/api/types/DeliveredValueMetric.d.ts +54 -0
- package/dist/cjs/api/types/DeliveredValueMetric.js +3 -0
- package/dist/cjs/api/types/DeliveredValueResponse.d.ts +34 -0
- package/dist/cjs/api/types/DeliveredValueResponse.js +3 -0
- package/dist/cjs/api/types/DeliveredValueSignal.d.ts +14 -0
- package/dist/cjs/api/types/DeliveredValueSignal.js +3 -0
- package/dist/cjs/api/types/DeliveredValueSignalValue.d.ts +8 -0
- package/dist/cjs/api/types/DeliveredValueSignalValue.js +3 -0
- package/dist/cjs/api/types/DeliveredValueSummaryBucket.d.ts +20 -0
- package/dist/cjs/api/types/DeliveredValueSummaryBucket.js +3 -0
- package/dist/cjs/api/types/DeliveredValueSummaryResponse.d.ts +41 -0
- package/dist/cjs/api/types/DeliveredValueSummaryResponse.js +22 -0
- package/dist/cjs/api/types/EndAttributeIntent.d.ts +16 -0
- package/dist/cjs/api/types/EndAttributeIntent.js +14 -0
- package/dist/cjs/api/types/GrantCustomerCreditsResponse.d.ts +9 -0
- package/dist/cjs/api/types/GrantCustomerCreditsResponse.js +3 -0
- package/dist/cjs/api/types/Invoice.d.ts +3 -0
- package/dist/cjs/api/types/MoneyAxisOptions.d.ts +23 -0
- package/dist/cjs/api/types/MoneyAxisOptions.js +3 -0
- package/dist/cjs/api/types/MoneyAxisValue.d.ts +6 -0
- package/dist/cjs/api/types/MoneyAxisValue.js +9 -0
- package/dist/cjs/api/types/Order.d.ts +1 -0
- package/dist/cjs/api/types/OrderLine.d.ts +2 -0
- package/dist/cjs/api/types/OrderLineType.d.ts +7 -0
- package/dist/cjs/api/types/OrderLineType.js +10 -0
- package/dist/cjs/api/types/Payment.d.ts +30 -0
- package/dist/cjs/api/types/Payment.js +3 -0
- package/dist/cjs/api/types/PaymentAllocation.d.ts +21 -0
- package/dist/cjs/api/types/PaymentAllocation.js +3 -0
- package/dist/cjs/api/types/PaymentAllocationCreateResponse.d.ts +4 -0
- package/dist/cjs/api/types/PaymentAllocationCreateResponse.js +3 -0
- package/dist/cjs/api/types/PaymentAllocationInput.d.ts +8 -0
- package/dist/cjs/api/types/PaymentAllocationInput.js +3 -0
- package/dist/cjs/api/types/PaymentAllocationListResponse.d.ts +5 -0
- package/dist/cjs/api/types/PaymentAllocationListResponse.js +3 -0
- package/dist/cjs/api/types/PaymentCreateStatus.d.ts +6 -0
- package/dist/cjs/api/types/PaymentCreateStatus.js +9 -0
- package/dist/cjs/api/types/PaymentListResponse.d.ts +5 -0
- package/dist/cjs/api/types/PaymentListResponse.js +3 -0
- package/dist/cjs/api/types/PaymentMethod.d.ts +15 -0
- package/dist/cjs/api/types/PaymentMethod.js +3 -0
- package/dist/cjs/api/types/PaymentMethodCard.d.ts +13 -0
- package/dist/cjs/api/types/PaymentMethodCard.js +3 -0
- package/dist/cjs/api/types/PaymentMethodListResponse.d.ts +5 -0
- package/dist/cjs/api/types/PaymentMethodListResponse.js +3 -0
- package/dist/cjs/api/types/PaymentMethodSetup.d.ts +21 -0
- package/dist/cjs/api/types/PaymentMethodSetup.js +3 -0
- package/dist/cjs/api/types/PaymentType.d.ts +9 -0
- package/dist/cjs/api/types/PaymentType.js +12 -0
- package/dist/cjs/api/types/PendingCreditConsumption.d.ts +16 -0
- package/dist/cjs/api/types/PendingCreditConsumption.js +3 -0
- package/dist/cjs/api/types/PendingCreditConsumptionCurrency.d.ts +9 -0
- package/dist/cjs/api/types/PendingCreditConsumptionCurrency.js +3 -0
- package/dist/cjs/api/types/PendingCreditConsumptionListResponse.d.ts +6 -0
- package/dist/cjs/api/types/PendingCreditConsumptionListResponse.js +3 -0
- package/dist/cjs/api/types/Plan.d.ts +22 -0
- package/dist/cjs/api/types/Plan.js +11 -0
- package/dist/cjs/api/types/PlanAttribute.d.ts +8 -0
- package/dist/cjs/api/types/PlanAttribute.js +3 -0
- package/dist/cjs/api/types/PlanAttributeInput.d.ts +7 -0
- package/dist/cjs/api/types/PlanAttributeInput.js +3 -0
- package/dist/cjs/api/types/PlanCreditBenefit.d.ts +35 -0
- package/dist/cjs/api/types/PlanCreditBenefit.js +20 -0
- package/dist/cjs/api/types/PlanListResponse.d.ts +5 -0
- package/dist/cjs/api/types/PlanListResponse.js +3 -0
- package/dist/cjs/api/types/PlanPricing.d.ts +31 -0
- package/dist/cjs/api/types/PlanPricing.js +24 -0
- package/dist/cjs/api/types/PlanRef.d.ts +5 -0
- package/dist/cjs/api/types/PlanRef.js +3 -0
- package/dist/cjs/api/types/PlanUpgradePathGroup.d.ts +4 -0
- package/dist/cjs/api/types/PlanUpgradePathGroup.js +3 -0
- package/dist/cjs/api/types/PlanUpgradePathResponse.d.ts +4 -0
- package/dist/cjs/api/types/PlanUpgradePathResponse.js +3 -0
- package/dist/cjs/api/types/PlannedAdd.d.ts +28 -0
- package/dist/cjs/api/types/PlannedAdd.js +13 -0
- package/dist/cjs/api/types/PlannedCopy.d.ts +10 -0
- package/dist/cjs/api/types/PlannedCopy.js +3 -0
- package/dist/cjs/api/types/PlannedEnd.d.ts +10 -0
- package/dist/cjs/api/types/PlannedEnd.js +3 -0
- package/dist/cjs/api/types/PlannedOperations.d.ts +13 -0
- package/dist/cjs/api/types/PlannedOperations.js +3 -0
- package/dist/cjs/api/types/PlannedOrderTerm.d.ts +10 -0
- package/dist/cjs/api/types/PlannedOrderTerm.js +3 -0
- package/dist/cjs/api/types/PlannedReplace.d.ts +15 -0
- package/dist/cjs/api/types/PlannedReplace.js +3 -0
- package/dist/cjs/api/types/PricingInput.d.ts +4 -1
- package/dist/cjs/api/types/PricingOutput.d.ts +10 -0
- package/dist/cjs/api/types/PricingOutput.js +5 -0
- package/dist/cjs/api/types/PricingPricePointOutput.d.ts +2 -22
- package/dist/cjs/api/types/PricingPricePointOutput.js +0 -14
- package/dist/cjs/api/types/PricingTierOutput.d.ts +16 -0
- package/dist/cjs/api/types/PricingTierOutput.js +11 -0
- package/dist/cjs/api/types/ProductAttributeOutput.d.ts +8 -0
- package/dist/cjs/api/types/ProductAttributeOutput.js +3 -0
- package/dist/cjs/api/types/ProductAttributeUpsert.d.ts +9 -0
- package/dist/cjs/api/types/ProductAttributeUpsert.js +3 -0
- package/dist/cjs/api/types/ProductCreditBenefitInput.d.ts +37 -0
- package/dist/cjs/api/types/ProductCreditBenefitInput.js +22 -0
- package/dist/cjs/api/types/ProductCreditBenefitOutput.d.ts +15 -0
- package/dist/cjs/api/types/ProductCreditBenefitOutput.js +3 -0
- package/dist/cjs/api/types/ProductDetail.d.ts +14 -0
- package/dist/cjs/api/types/ProductDetail.js +3 -0
- package/dist/cjs/api/types/ProductOneTimePerUnitInput.d.ts +21 -0
- package/dist/cjs/api/types/ProductOneTimePerUnitInput.js +18 -0
- package/dist/cjs/api/types/ProductPricePointOutput.d.ts +9 -0
- package/dist/cjs/api/types/ProductPricePointOutput.js +3 -0
- package/dist/cjs/api/types/ProductPricingInput.d.ts +49 -0
- package/dist/cjs/api/types/ProductPricingInput.js +3 -0
- package/dist/cjs/api/types/ProductPricingOutput.d.ts +46 -0
- package/dist/cjs/api/types/ProductPricingOutput.js +28 -0
- package/dist/cjs/api/types/ProductPricingTierOutput.d.ts +16 -0
- package/dist/cjs/api/types/ProductPricingTierOutput.js +11 -0
- package/dist/cjs/api/types/ProductRecurringGraduatedInput.d.ts +22 -0
- package/dist/cjs/api/types/ProductRecurringGraduatedInput.js +18 -0
- package/dist/cjs/api/types/ProductRecurringPerUnitInput.d.ts +22 -0
- package/dist/cjs/api/types/ProductRecurringPerUnitInput.js +18 -0
- package/dist/cjs/api/types/ProductRecurringPercentOfTotalInput.d.ts +23 -0
- package/dist/cjs/api/types/ProductRecurringPercentOfTotalInput.js +18 -0
- package/dist/cjs/api/types/ProductRecurringVolumeInput.d.ts +22 -0
- package/dist/cjs/api/types/ProductRecurringVolumeInput.js +18 -0
- package/dist/cjs/api/types/ProductSeatBasedGraduatedInput.d.ts +22 -0
- package/dist/cjs/api/types/ProductSeatBasedGraduatedInput.js +18 -0
- package/dist/cjs/api/types/ProductSeatBasedPerUnitInput.d.ts +22 -0
- package/dist/cjs/api/types/ProductSeatBasedPerUnitInput.js +18 -0
- package/dist/cjs/api/types/ProductSeatBasedPrepaidCreditsInput.d.ts +29 -0
- package/dist/cjs/api/types/ProductSeatBasedPrepaidCreditsInput.js +18 -0
- package/dist/cjs/api/types/ProductSeatBasedVolumeInput.d.ts +22 -0
- package/dist/cjs/api/types/ProductSeatBasedVolumeInput.js +18 -0
- package/dist/cjs/api/types/ProductSimplePricePoint.d.ts +29 -0
- package/dist/cjs/api/types/ProductSimplePricePoint.js +17 -0
- package/dist/cjs/api/types/ProductTieredPricePoint.d.ts +29 -0
- package/dist/cjs/api/types/ProductTieredPricePoint.js +17 -0
- package/dist/cjs/api/types/ProductUsageBracketedPrepaidCreditsInput.d.ts +61 -0
- package/dist/cjs/api/types/ProductUsageBracketedPrepaidCreditsInput.js +29 -0
- package/dist/cjs/api/types/ProductUsageCostPlusInput.d.ts +31 -0
- package/dist/cjs/api/types/ProductUsageCostPlusInput.js +23 -0
- package/dist/cjs/api/types/ProductUsageGraduatedInput.d.ts +31 -0
- package/dist/cjs/api/types/ProductUsageGraduatedInput.js +23 -0
- package/dist/cjs/api/types/ProductUsagePerUnitInput.d.ts +31 -0
- package/dist/cjs/api/types/ProductUsagePerUnitInput.js +23 -0
- package/dist/cjs/api/types/ProductUsagePrepaidCreditsInput.d.ts +50 -0
- package/dist/cjs/api/types/ProductUsagePrepaidCreditsInput.js +29 -0
- package/dist/cjs/api/types/ProductUsageVolumeInput.d.ts +31 -0
- package/dist/cjs/api/types/ProductUsageVolumeInput.js +23 -0
- package/dist/cjs/api/types/ProvisionBillingFrequencyOverride.d.ts +14 -0
- package/dist/cjs/api/types/ProvisionBillingFrequencyOverride.js +14 -0
- package/dist/cjs/api/types/ProvisionContact.d.ts +20 -0
- package/dist/cjs/api/types/ProvisionContact.js +14 -0
- package/dist/cjs/api/types/ProvisionCreatedContact.d.ts +14 -0
- package/dist/cjs/api/types/ProvisionCreatedContact.js +12 -0
- package/dist/cjs/api/types/ProvisionCreatedCustomer.d.ts +14 -0
- package/dist/cjs/api/types/ProvisionCreatedCustomer.js +12 -0
- package/dist/cjs/api/types/ProvisionCreatedOrder.d.ts +17 -0
- package/dist/cjs/api/types/ProvisionCreatedOrder.js +12 -0
- package/dist/cjs/api/types/ProvisionCreatedOrderLine.d.ts +17 -0
- package/dist/cjs/api/types/ProvisionCreatedOrderLine.js +12 -0
- package/dist/cjs/api/types/ProvisionCreditBenefit.d.ts +44 -0
- package/dist/cjs/api/types/ProvisionCreditBenefit.js +26 -0
- package/dist/cjs/api/types/ProvisionCustomer.d.ts +23 -0
- package/dist/cjs/api/types/ProvisionCustomer.js +12 -0
- package/dist/cjs/api/types/ProvisionExternalReference.d.ts +16 -0
- package/dist/cjs/api/types/ProvisionExternalReference.js +14 -0
- package/dist/cjs/api/types/ProvisionOrder.d.ts +39 -0
- package/dist/cjs/api/types/ProvisionOrder.js +20 -0
- package/dist/cjs/api/types/ProvisionOrderLine.d.ts +12 -0
- package/dist/cjs/api/types/ProvisionOrderLine.js +3 -0
- package/dist/cjs/api/types/ProvisionOrderLineAttribute.d.ts +96 -0
- package/dist/cjs/api/types/ProvisionOrderLineAttribute.js +50 -0
- package/dist/cjs/api/types/ProvisionOrderLineType.d.ts +7 -0
- package/dist/cjs/api/types/ProvisionOrderLineType.js +10 -0
- package/dist/cjs/api/types/ProvisionProduct.d.ts +95 -0
- package/dist/cjs/api/types/ProvisionProduct.js +52 -0
- package/dist/cjs/api/types/ProvisionResponse.d.ts +17 -0
- package/dist/cjs/api/types/ProvisionResponse.js +12 -0
- package/dist/cjs/api/types/RenderBundleEdit.d.ts +8 -0
- package/dist/cjs/api/types/RenderBundleEdit.js +3 -0
- package/dist/cjs/api/types/RotateWebhookSecretResponse.d.ts +4 -0
- package/dist/cjs/api/types/RotateWebhookSecretResponse.js +3 -0
- package/dist/cjs/api/types/SeatBasedPrepaidCreditsInput.d.ts +4 -0
- package/dist/cjs/api/types/Signal.d.ts +9 -2
- package/dist/cjs/api/types/SignalListItem.d.ts +20 -0
- package/dist/cjs/api/types/SignalListItem.js +3 -0
- package/dist/cjs/api/types/SignalListResponse.d.ts +5 -0
- package/dist/cjs/api/types/SignalListResponse.js +3 -0
- package/dist/cjs/api/types/SignalLookupResponse.d.ts +7 -0
- package/dist/cjs/api/types/SignalLookupResponse.js +3 -0
- package/dist/cjs/api/types/SignalSummaryBandsDimension.d.ts +21 -0
- package/dist/cjs/api/types/SignalSummaryBandsDimension.js +3 -0
- package/dist/cjs/api/types/SignalSummaryColumn.d.ts +8 -0
- package/dist/cjs/api/types/SignalSummaryColumn.js +3 -0
- package/dist/cjs/api/types/SignalSummaryDefinitionSpec.d.ts +21 -0
- package/dist/cjs/api/types/SignalSummaryDefinitionSpec.js +11 -0
- package/dist/cjs/api/types/SignalSummaryDefinitionSpecDimensionsItem.d.ts +10 -0
- package/dist/cjs/api/types/SignalSummaryDefinitionSpecDimensionsItem.js +3 -0
- package/dist/cjs/api/types/SignalSummaryExport.d.ts +36 -0
- package/dist/cjs/api/types/SignalSummaryExport.js +18 -0
- package/dist/cjs/api/types/SignalSummaryGroups.d.ts +9 -0
- package/dist/cjs/api/types/SignalSummaryGroups.js +3 -0
- package/dist/cjs/api/types/SignalSummaryMeasure.d.ts +16 -0
- package/dist/cjs/api/types/SignalSummaryMeasure.js +14 -0
- package/dist/cjs/api/types/SignalSummaryPage.d.ts +8 -0
- package/dist/cjs/api/types/SignalSummaryPage.js +3 -0
- package/dist/cjs/api/types/SignalSummaryPoint.d.ts +16 -0
- package/dist/cjs/api/types/SignalSummaryPoint.js +3 -0
- package/dist/cjs/api/types/SignalSummaryPresenceDimension.d.ts +23 -0
- package/dist/cjs/api/types/SignalSummaryPresenceDimension.js +3 -0
- package/dist/cjs/api/types/SignalSummaryResponse.d.ts +29 -0
- package/dist/cjs/api/types/SignalSummaryResponse.js +19 -0
- package/dist/cjs/api/types/SignalSummarySignalSelection.d.ts +8 -0
- package/dist/cjs/api/types/SignalSummarySignalSelection.js +3 -0
- package/dist/cjs/api/types/SignalSummarySpecInput.d.ts +21 -0
- package/dist/cjs/api/types/SignalSummarySpecInput.js +11 -0
- package/dist/cjs/api/types/SignalSummarySpecInputDimensionsItem.d.ts +10 -0
- package/dist/cjs/api/types/SignalSummarySpecInputDimensionsItem.js +3 -0
- package/dist/cjs/api/types/SignalsMetadataResponse.d.ts +49 -0
- package/dist/cjs/api/types/SignalsMetadataResponse.js +27 -0
- package/dist/cjs/api/types/StripeConnection.d.ts +7 -0
- package/dist/cjs/api/types/StripeConnection.js +3 -0
- package/dist/cjs/api/{resources/valueReceipts/client/requests → types}/SyncValueReceiptRequest.d.ts +0 -7
- package/dist/cjs/api/types/SyncValueReceiptRequest.js +3 -0
- package/dist/cjs/api/types/UnifiedAmendmentIntent.d.ts +25 -0
- package/dist/cjs/api/types/UnifiedAmendmentIntent.js +3 -0
- package/dist/cjs/api/types/UnifiedAmendmentResponse.d.ts +19 -0
- package/dist/cjs/api/types/UnifiedAmendmentResponse.js +3 -0
- package/dist/cjs/api/types/UpdateContactRequest.d.ts +1 -0
- package/dist/cjs/api/types/UpdateCustomerRequest.d.ts +1 -1
- package/dist/cjs/api/types/UpdateLineTermIntent.d.ts +18 -0
- package/dist/cjs/api/types/UpdateLineTermIntent.js +14 -0
- package/dist/cjs/api/types/UpdateOrderTermIntent.d.ts +18 -0
- package/dist/cjs/api/types/UpdateOrderTermIntent.js +14 -0
- package/dist/cjs/api/types/UpdatePlanRequest.d.ts +18 -0
- package/dist/cjs/api/types/UpdatePlanRequest.js +12 -0
- package/dist/cjs/api/types/UpdatePricingIntent.d.ts +22 -0
- package/dist/cjs/api/types/UpdatePricingIntent.js +14 -0
- package/dist/cjs/api/types/UpdateProductRequest.d.ts +2 -0
- package/dist/cjs/api/types/UpdateQuantityIntent.d.ts +18 -0
- package/dist/cjs/api/types/UpdateQuantityIntent.js +14 -0
- package/dist/cjs/api/types/UsageAttributionAxisOptions.d.ts +23 -0
- package/dist/cjs/api/types/UsageAttributionAxisOptions.js +3 -0
- package/dist/cjs/api/types/UsageAttributionAxisValue.d.ts +6 -0
- package/dist/cjs/api/types/UsageAttributionAxisValue.js +9 -0
- package/dist/cjs/api/types/UsageBracketedPrepaidCreditsInput.d.ts +61 -0
- package/dist/cjs/api/types/UsageBracketedPrepaidCreditsInput.js +29 -0
- package/dist/cjs/api/types/UsageCostPlusInput.d.ts +8 -0
- package/dist/cjs/api/types/UsageCostPlusInput.js +5 -0
- package/dist/cjs/api/types/UsageGraduatedInput.d.ts +8 -0
- package/dist/cjs/api/types/UsageGraduatedInput.js +5 -0
- package/dist/cjs/api/types/UsagePerUnitInput.d.ts +8 -0
- package/dist/cjs/api/types/UsagePerUnitInput.js +5 -0
- package/dist/cjs/api/types/UsagePrepaidCreditsInput.d.ts +24 -0
- package/dist/cjs/api/types/UsagePrepaidCreditsInput.js +11 -0
- package/dist/cjs/api/types/UsageVolumeInput.d.ts +8 -0
- package/dist/cjs/api/types/UsageVolumeInput.js +5 -0
- package/dist/cjs/api/types/ValidateCustomViewRequest.d.ts +55 -0
- package/dist/cjs/api/types/ValidateCustomViewRequest.js +26 -0
- package/dist/cjs/api/types/ValidateCustomViewResponse.d.ts +7 -0
- package/dist/cjs/api/types/ValidateCustomViewResponse.js +3 -0
- package/dist/cjs/api/types/ValueMetricDetail.d.ts +47 -0
- package/dist/cjs/api/types/ValueMetricDetail.js +3 -0
- package/dist/cjs/api/types/ValueMetricFormula.d.ts +9 -0
- package/dist/cjs/api/types/ValueMetricFormula.js +3 -0
- package/dist/cjs/api/types/ValueMetricFormulaVariable.d.ts +31 -0
- package/dist/cjs/api/types/ValueMetricFormulaVariable.js +24 -0
- package/dist/cjs/api/types/ValueMetricListResponse.d.ts +5 -0
- package/dist/cjs/api/types/ValueMetricListResponse.js +3 -0
- package/dist/cjs/api/types/ValueMetricMonetaryConversion.d.ts +6 -0
- package/dist/cjs/api/types/ValueMetricMonetaryConversion.js +3 -0
- package/dist/cjs/api/types/ValueMetricSignalBinding.d.ts +14 -0
- package/dist/cjs/api/types/ValueMetricSignalBinding.js +3 -0
- package/dist/cjs/api/types/ValueMetricSummary.d.ts +30 -0
- package/dist/cjs/api/types/ValueMetricSummary.js +3 -0
- package/dist/cjs/api/types/ValueMetricUnit.d.ts +27 -0
- package/dist/cjs/api/types/ValueMetricUnit.js +20 -0
- package/dist/cjs/api/types/ValueMetricValidationResponse.d.ts +13 -0
- package/dist/cjs/api/types/ValueMetricValidationResponse.js +3 -0
- package/dist/cjs/api/types/ValueMetricVariableEdit.d.ts +26 -0
- package/dist/cjs/api/types/ValueMetricVariableEdit.js +19 -0
- package/dist/cjs/api/types/ValueMetricWriteAck.d.ts +6 -0
- package/dist/cjs/api/types/ValueMetricWriteAck.js +3 -0
- package/dist/cjs/api/types/ValueModelAuthoringGuide.d.ts +22 -0
- package/dist/cjs/api/types/ValueModelAuthoringGuide.js +3 -0
- package/dist/cjs/api/types/ValueModelContent.d.ts +359 -0
- package/dist/cjs/api/types/ValueModelContent.js +148 -0
- package/dist/cjs/api/types/ValueModelDetail.d.ts +12 -0
- package/dist/cjs/api/types/ValueModelDetail.js +3 -0
- package/dist/cjs/api/types/ValueModelSummary.d.ts +18 -0
- package/dist/cjs/api/types/ValueModelSummary.js +12 -0
- package/dist/cjs/api/types/ValueModelVersionListResponse.d.ts +5 -0
- package/dist/cjs/api/types/ValueModelVersionListResponse.js +3 -0
- package/dist/cjs/api/types/ValueReceiptDetail.d.ts +1 -0
- package/dist/cjs/api/types/ValueReceiptSummary.d.ts +1 -0
- package/dist/cjs/api/types/ValueReceiptSyncResponse.d.ts +2 -0
- package/dist/cjs/api/types/ViewCustomerUnitsResponse.d.ts +7 -0
- package/dist/cjs/api/types/ViewCustomerUnitsResponse.js +3 -0
- package/dist/cjs/api/types/ViewDataResponse.d.ts +6 -0
- package/dist/cjs/api/types/ViewDataResponse.js +3 -0
- package/dist/cjs/api/types/Webhook.d.ts +2 -1
- package/dist/cjs/api/types/Webhook.js +2 -1
- package/dist/cjs/api/types/WebhookListResponse.d.ts +2 -0
- package/dist/cjs/api/types/WebhookUpdateResponse.d.ts +27 -0
- package/dist/cjs/api/types/WebhookUpdateResponse.js +19 -0
- package/dist/cjs/api/types/WritableOrderLineType.d.ts +6 -0
- package/dist/cjs/api/types/WritableOrderLineType.js +9 -0
- package/dist/cjs/api/types/WritableProvisionOrderLineType.d.ts +6 -0
- package/dist/cjs/api/types/WritableProvisionOrderLineType.js +9 -0
- package/dist/cjs/api/types/index.d.ts +258 -1
- package/dist/cjs/api/types/index.js +258 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +33 -0
- package/dist/esm/Client.mjs +57 -2
- package/dist/esm/api/errors/BadRequestError.d.mts +1 -2
- package/dist/esm/api/errors/ConflictError.d.mts +1 -2
- package/dist/esm/api/errors/ForbiddenError.d.mts +1 -2
- package/dist/esm/api/errors/InternalServerError.d.mts +1 -2
- package/dist/esm/api/errors/NotFoundError.d.mts +1 -2
- package/dist/esm/api/errors/RequestTimeoutError.d.mts +6 -0
- package/dist/esm/api/errors/RequestTimeoutError.mjs +13 -0
- package/dist/esm/api/errors/TooManyRequestsError.d.mts +6 -0
- package/dist/esm/api/errors/TooManyRequestsError.mjs +13 -0
- package/dist/esm/api/errors/UnprocessableEntityError.d.mts +6 -0
- package/dist/esm/api/errors/UnprocessableEntityError.mjs +13 -0
- package/dist/esm/api/errors/index.d.mts +3 -0
- package/dist/esm/api/errors/index.mjs +3 -0
- package/dist/esm/api/resources/amendments/client/Client.d.mts +83 -0
- package/dist/esm/api/resources/amendments/client/Client.mjs +276 -0
- package/dist/esm/api/resources/amendments/client/index.d.mts +1 -0
- package/dist/esm/api/resources/amendments/client/index.mjs +1 -0
- package/dist/esm/api/resources/amendments/client/requests/GetOrderAmendmentOptionsRequest.d.mts +10 -0
- package/dist/esm/api/resources/amendments/client/requests/UnifiedAmendmentExecuteRequest.d.mts +35 -0
- package/dist/esm/api/resources/amendments/client/requests/UnifiedAmendmentExecuteRequest.mjs +11 -0
- package/dist/esm/api/resources/amendments/client/requests/UnifiedAmendmentPreviewRequest.d.mts +33 -0
- package/dist/esm/api/resources/amendments/client/requests/UnifiedAmendmentPreviewRequest.mjs +11 -0
- package/dist/esm/api/resources/amendments/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/amendments/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/amendments/index.d.mts +1 -0
- package/dist/esm/api/resources/amendments/index.mjs +1 -0
- package/dist/esm/api/resources/analytics/client/Client.d.mts +64 -0
- package/dist/esm/api/resources/analytics/client/Client.mjs +239 -0
- package/dist/esm/api/resources/analytics/client/index.d.mts +1 -0
- package/dist/esm/api/resources/analytics/client/index.mjs +1 -0
- package/dist/esm/api/resources/analytics/client/requests/GetSignalsMetadataRequest.d.mts +12 -0
- package/dist/esm/api/resources/analytics/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/analytics/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/analytics/index.d.mts +1 -0
- package/dist/esm/api/resources/analytics/index.mjs +1 -0
- package/dist/esm/api/resources/analyticsExperimental/client/Client.d.mts +70 -0
- package/dist/esm/api/resources/analyticsExperimental/client/Client.mjs +245 -0
- package/dist/esm/api/resources/analyticsExperimental/client/index.d.mts +1 -0
- package/dist/esm/api/resources/analyticsExperimental/client/index.mjs +1 -0
- package/dist/esm/api/resources/analyticsExperimental/client/requests/GetExperimentalSignalsMetadataRequest.d.mts +12 -0
- package/dist/esm/api/resources/analyticsExperimental/client/requests/GetExperimentalSignalsMetadataRequest.mjs +2 -0
- package/dist/esm/api/resources/analyticsExperimental/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/analyticsExperimental/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/analyticsExperimental/index.d.mts +1 -0
- package/dist/esm/api/resources/analyticsExperimental/index.mjs +1 -0
- package/dist/esm/api/resources/checkouts/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/checkouts/client/Client.mjs +4 -1
- package/dist/esm/api/resources/checkouts/client/requests/CreateCheckoutRequest.d.mts +8 -1
- package/dist/esm/api/resources/contacts/client/Client.d.mts +6 -4
- package/dist/esm/api/resources/contacts/client/Client.mjs +10 -4
- package/dist/esm/api/resources/credits/client/Client.d.mts +76 -2
- package/dist/esm/api/resources/credits/client/Client.mjs +371 -5
- package/dist/esm/api/resources/credits/client/index.d.mts +1 -1
- package/dist/esm/api/resources/credits/client/index.mjs +1 -1
- package/dist/esm/api/resources/credits/client/requests/CreateCreditCurrencyRequest.d.mts +16 -0
- package/dist/esm/api/resources/credits/client/requests/CreateCreditCurrencyRequest.mjs +2 -0
- package/dist/esm/api/resources/credits/client/requests/GetCreditTransactionSummaryRequest.d.mts +33 -0
- package/dist/esm/api/resources/credits/client/requests/GetCreditTransactionSummaryRequest.mjs +2 -0
- package/dist/esm/api/resources/credits/client/requests/ListCreditCurrenciesRequest.d.mts +9 -0
- package/dist/esm/api/resources/credits/client/requests/ListCreditCurrenciesRequest.mjs +2 -0
- package/dist/esm/api/resources/credits/client/requests/ListCreditTransactionsRequest.d.mts +27 -0
- package/dist/esm/api/resources/credits/client/requests/ListCreditTransactionsRequest.mjs +2 -0
- package/dist/esm/api/resources/credits/client/requests/UpdateCreditCurrencyRequest.d.mts +24 -0
- package/dist/esm/api/resources/credits/client/requests/UpdateCreditCurrencyRequest.mjs +9 -0
- package/dist/esm/api/resources/credits/client/requests/index.d.mts +5 -0
- package/dist/esm/api/resources/credits/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/credits/index.d.mts +1 -0
- package/dist/esm/api/resources/credits/index.mjs +1 -0
- package/dist/esm/api/resources/credits/types/GetCreditTransactionSummaryRequestGroupBy.d.mts +4 -0
- package/dist/esm/api/resources/credits/types/GetCreditTransactionSummaryRequestGroupBy.mjs +4 -0
- package/dist/esm/api/resources/credits/types/GetCreditTransactionSummaryRequestInterval.d.mts +6 -0
- package/dist/esm/api/resources/credits/types/GetCreditTransactionSummaryRequestInterval.mjs +6 -0
- package/dist/esm/api/resources/credits/types/GetCreditTransactionSummaryRequestType.d.mts +6 -0
- package/dist/esm/api/resources/credits/types/GetCreditTransactionSummaryRequestType.mjs +6 -0
- package/dist/esm/api/resources/credits/types/ListCreditCurrenciesRequestStatus.d.mts +6 -0
- package/dist/esm/api/resources/credits/types/ListCreditCurrenciesRequestStatus.mjs +6 -0
- package/dist/esm/api/resources/credits/types/ListCreditTransactionsRequestType.d.mts +6 -0
- package/dist/esm/api/resources/credits/types/ListCreditTransactionsRequestType.mjs +6 -0
- package/dist/esm/api/resources/credits/types/index.d.mts +5 -0
- package/dist/esm/api/resources/credits/types/index.mjs +5 -0
- package/dist/esm/api/resources/customViewsExperimental/client/Client.d.mts +200 -0
- package/dist/esm/api/resources/customViewsExperimental/client/Client.mjs +748 -0
- package/dist/esm/api/resources/customViewsExperimental/client/index.d.mts +1 -0
- package/dist/esm/api/resources/customViewsExperimental/client/index.mjs +1 -0
- package/dist/esm/api/resources/customViewsExperimental/client/requests/CreateCustomViewRequest.d.mts +70 -0
- package/dist/esm/api/resources/customViewsExperimental/client/requests/CreateCustomViewRequest.mjs +23 -0
- package/dist/esm/api/resources/customViewsExperimental/client/requests/GetCustomViewCustomerUnitsRequest.d.mts +14 -0
- package/dist/esm/api/resources/customViewsExperimental/client/requests/GetCustomViewCustomerUnitsRequest.mjs +2 -0
- package/dist/esm/api/resources/customViewsExperimental/client/requests/GetCustomViewDataRequest.d.mts +28 -0
- package/dist/esm/api/resources/customViewsExperimental/client/requests/GetCustomViewDataRequest.mjs +2 -0
- package/dist/esm/api/resources/customViewsExperimental/client/requests/GetCustomViewEmbedTokenRequest.d.mts +14 -0
- package/dist/esm/api/resources/customViewsExperimental/client/requests/GetCustomViewEmbedTokenRequest.mjs +2 -0
- package/dist/esm/api/resources/customViewsExperimental/client/requests/GetCustomViewRequest.d.mts +9 -0
- package/dist/esm/api/resources/customViewsExperimental/client/requests/GetCustomViewRequest.mjs +2 -0
- package/dist/esm/api/resources/customViewsExperimental/client/requests/PublishCustomViewRequest.d.mts +9 -0
- package/dist/esm/api/resources/customViewsExperimental/client/requests/PublishCustomViewRequest.mjs +2 -0
- package/dist/esm/api/resources/customViewsExperimental/client/requests/UpdateCustomViewPeriodRequest.d.mts +46 -0
- package/dist/esm/api/resources/customViewsExperimental/client/requests/UpdateCustomViewPeriodRequest.mjs +18 -0
- package/dist/esm/api/resources/customViewsExperimental/client/requests/UpdateCustomViewRequest.d.mts +30 -0
- package/dist/esm/api/resources/customViewsExperimental/client/requests/UpdateCustomViewRequest.mjs +2 -0
- package/dist/esm/api/resources/customViewsExperimental/client/requests/index.d.mts +8 -0
- package/dist/esm/api/resources/customViewsExperimental/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/customViewsExperimental/index.d.mts +2 -0
- package/dist/esm/api/resources/customViewsExperimental/index.mjs +2 -0
- package/dist/esm/api/resources/customViewsExperimental/types/GetCustomViewDataRequestIncludeDraft.d.mts +5 -0
- package/dist/esm/api/resources/customViewsExperimental/types/GetCustomViewDataRequestIncludeDraft.mjs +5 -0
- package/dist/esm/api/resources/customViewsExperimental/types/GetCustomViewDataRequestPeriodKind.d.mts +5 -0
- package/dist/esm/api/resources/customViewsExperimental/types/GetCustomViewDataRequestPeriodKind.mjs +5 -0
- package/dist/esm/api/resources/customViewsExperimental/types/GetCustomViewDataRequestPeriodUnit.d.mts +6 -0
- package/dist/esm/api/resources/customViewsExperimental/types/GetCustomViewDataRequestPeriodUnit.mjs +6 -0
- package/dist/esm/api/resources/customViewsExperimental/types/GetCustomViewDataRequestUnitMode.d.mts +6 -0
- package/dist/esm/api/resources/customViewsExperimental/types/GetCustomViewDataRequestUnitMode.mjs +6 -0
- package/dist/esm/api/resources/customViewsExperimental/types/index.d.mts +4 -0
- package/dist/esm/api/resources/customViewsExperimental/types/index.mjs +4 -0
- package/dist/esm/api/resources/customerPortals/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/customerPortals/client/Client.mjs +1 -1
- package/dist/esm/api/resources/customers/client/Client.d.mts +1049 -15
- package/dist/esm/api/resources/customers/client/Client.mjs +4104 -99
- package/dist/esm/api/resources/customers/client/requests/CreateCustomerAliasByExternalIdRequest.d.mts +15 -0
- package/dist/esm/api/resources/customers/client/requests/CreateCustomerAliasByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/CreateCustomerAliasRequest.d.mts +15 -0
- package/dist/esm/api/resources/customers/client/requests/CreateCustomerAliasRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/CreateCustomerApiKeyByExternalIdRequest.d.mts +15 -0
- package/dist/esm/api/resources/customers/client/requests/CreateCustomerApiKeyByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/CreateCustomerApiKeyRequest.d.mts +15 -0
- package/dist/esm/api/resources/customers/client/requests/CreateCustomerApiKeyRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/CreateCustomerFundingInstructionsByExternalIdRequest.d.mts +12 -0
- package/dist/esm/api/resources/customers/client/requests/CreateCustomerFundingInstructionsByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/CreateCustomerFundingInstructionsRequest.d.mts +13 -0
- package/dist/esm/api/resources/customers/client/requests/CreateCustomerFundingInstructionsRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/CreateCustomerRequest.d.mts +1 -1
- package/dist/esm/api/resources/customers/client/requests/CreateCustomerUnitAliasByExternalIdRequest.d.mts +18 -0
- package/dist/esm/api/resources/customers/client/requests/CreateCustomerUnitAliasByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/CreateCustomerUnitAliasByKeyRequest.d.mts +15 -0
- package/dist/esm/api/resources/customers/client/requests/CreateCustomerUnitAliasByKeyRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/CreateCustomerUnitAliasRequest.d.mts +18 -0
- package/dist/esm/api/resources/customers/client/requests/CreateCustomerUnitAliasRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/CreateCustomerUnitByExternalIdRequest.d.mts +15 -0
- package/dist/esm/api/resources/customers/client/requests/CreateCustomerUnitByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/CreateCustomerUnitRequest.d.mts +15 -0
- package/dist/esm/api/resources/customers/client/requests/CreateCustomerUnitRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/CustomerUnitCreateUnderParent.d.mts +21 -0
- package/dist/esm/api/resources/customers/client/requests/CustomerUnitCreateUnderParent.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/DeleteCustomerAliasByExternalIdRequest.d.mts +13 -0
- package/dist/esm/api/resources/customers/client/requests/DeleteCustomerAliasByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/DeleteCustomerAliasRequest.d.mts +13 -0
- package/dist/esm/api/resources/customers/client/requests/DeleteCustomerAliasRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/DeleteCustomerByExternalIdRequest.d.mts +2 -1
- package/dist/esm/api/resources/customers/client/requests/DeleteCustomerByIdRequest.d.mts +2 -1
- package/dist/esm/api/resources/customers/client/requests/DeleteCustomerUnitAliasByExternalIdRequest.d.mts +16 -0
- package/dist/esm/api/resources/customers/client/requests/DeleteCustomerUnitAliasByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/DeleteCustomerUnitAliasByKeyRequest.d.mts +13 -0
- package/dist/esm/api/resources/customers/client/requests/DeleteCustomerUnitAliasByKeyRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/DeleteCustomerUnitAliasRequest.d.mts +16 -0
- package/dist/esm/api/resources/customers/client/requests/DeleteCustomerUnitAliasRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/DeleteCustomerUnitByExternalIdRequest.d.mts +13 -0
- package/dist/esm/api/resources/customers/client/requests/DeleteCustomerUnitByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/DeleteCustomerUnitRequest.d.mts +13 -0
- package/dist/esm/api/resources/customers/client/requests/DeleteCustomerUnitRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/EndCustomerUnitCapByExternalIdRequest.d.mts +16 -0
- package/dist/esm/api/resources/customers/client/requests/EndCustomerUnitCapByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/EndCustomerUnitCapRequest.d.mts +16 -0
- package/dist/esm/api/resources/customers/client/requests/EndCustomerUnitCapRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerByExternalIdRequest.d.mts +2 -1
- package/dist/esm/api/resources/customers/client/requests/GetCustomerByIdRequest.d.mts +2 -1
- package/dist/esm/api/resources/customers/client/requests/GetCustomerCreditBalancesByExternalIdRequest.d.mts +2 -1
- package/dist/esm/api/resources/customers/client/requests/GetCustomerCreditBalancesRequest.d.mts +2 -1
- package/dist/esm/api/resources/customers/client/requests/GetCustomerFundingInstructionsByExternalIdRequest.d.mts +11 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerFundingInstructionsByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerFundingInstructionsRequest.d.mts +12 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerFundingInstructionsRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerStateByExternalIdRequest.d.mts +10 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerStateByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerStateByIdRequest.d.mts +10 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerStateByIdRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitByExternalIdRequest.d.mts +13 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitByKeyRequest.d.mts +10 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitByKeyRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitCapByExternalIdRequest.d.mts +16 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitCapByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitCapRequest.d.mts +16 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitCapRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitRequest.d.mts +13 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitSpendByExternalIdRequest.d.mts +22 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitSpendByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitSpendRequest.d.mts +22 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitSpendRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/GrantCustomerCreditsByExternalIdRequest.d.mts +19 -0
- package/dist/esm/api/resources/customers/client/requests/GrantCustomerCreditsByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/GrantCustomerCreditsRequest.d.mts +19 -0
- package/dist/esm/api/resources/customers/client/requests/GrantCustomerCreditsRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/ListCustomerAliasesByExternalIdRequest.d.mts +12 -0
- package/dist/esm/api/resources/customers/client/requests/ListCustomerAliasesByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/ListCustomerAliasesRequest.d.mts +12 -0
- package/dist/esm/api/resources/customers/client/requests/ListCustomerAliasesRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/ListCustomerApiKeysByExternalIdRequest.d.mts +12 -0
- package/dist/esm/api/resources/customers/client/requests/ListCustomerApiKeysByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/ListCustomerApiKeysRequest.d.mts +12 -0
- package/dist/esm/api/resources/customers/client/requests/ListCustomerApiKeysRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/ListCustomerPendingCreditConsumptionByExternalIdRequest.d.mts +12 -0
- package/dist/esm/api/resources/customers/client/requests/ListCustomerPendingCreditConsumptionByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/ListCustomerPendingCreditConsumptionRequest.d.mts +12 -0
- package/dist/esm/api/resources/customers/client/requests/ListCustomerPendingCreditConsumptionRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/ListCustomerUnitAliasesByExternalIdRequest.d.mts +15 -0
- package/dist/esm/api/resources/customers/client/requests/ListCustomerUnitAliasesByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/ListCustomerUnitAliasesByKeyRequest.d.mts +12 -0
- package/dist/esm/api/resources/customers/client/requests/ListCustomerUnitAliasesByKeyRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/ListCustomerUnitAliasesRequest.d.mts +15 -0
- package/dist/esm/api/resources/customers/client/requests/ListCustomerUnitAliasesRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/ListCustomerUnitsByExternalIdRequest.d.mts +20 -0
- package/dist/esm/api/resources/customers/client/requests/ListCustomerUnitsByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/ListCustomerUnitsRequest.d.mts +20 -0
- package/dist/esm/api/resources/customers/client/requests/ListCustomerUnitsRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/ListCustomersRequest.d.mts +13 -0
- package/dist/esm/api/resources/customers/client/requests/RevokeCustomerApiKeyByExternalIdRequest.d.mts +13 -0
- package/dist/esm/api/resources/customers/client/requests/RevokeCustomerApiKeyByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/RevokeCustomerApiKeyRequest.d.mts +13 -0
- package/dist/esm/api/resources/customers/client/requests/RevokeCustomerApiKeyRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/SetCustomerUnitCapByExternalIdRequest.d.mts +18 -0
- package/dist/esm/api/resources/customers/client/requests/SetCustomerUnitCapByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/SetCustomerUnitCapRequest.d.mts +18 -0
- package/dist/esm/api/resources/customers/client/requests/SetCustomerUnitCapRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/UpdateCustomerByExternalIdRequest.d.mts +2 -1
- package/dist/esm/api/resources/customers/client/requests/UpdateCustomerByIdRequest.d.mts +2 -1
- package/dist/esm/api/resources/customers/client/requests/UpdateCustomerUnitByExternalIdRequest.d.mts +16 -0
- package/dist/esm/api/resources/customers/client/requests/UpdateCustomerUnitByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/UpdateCustomerUnitRequest.d.mts +16 -0
- package/dist/esm/api/resources/customers/client/requests/UpdateCustomerUnitRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/index.d.mts +51 -0
- package/dist/esm/api/resources/customers/index.d.mts +1 -0
- package/dist/esm/api/resources/customers/index.mjs +1 -0
- package/dist/esm/api/resources/customers/types/DeleteCustomerUnitAliasByExternalIdResponse.d.mts +1 -0
- package/dist/esm/api/resources/customers/types/DeleteCustomerUnitAliasByExternalIdResponse.mjs +2 -0
- package/dist/esm/api/resources/customers/types/DeleteCustomerUnitAliasByKeyResponse.d.mts +1 -0
- package/dist/esm/api/resources/customers/types/DeleteCustomerUnitAliasByKeyResponse.mjs +2 -0
- package/dist/esm/api/resources/customers/types/DeleteCustomerUnitAliasResponse.d.mts +1 -0
- package/dist/esm/api/resources/customers/types/DeleteCustomerUnitAliasResponse.mjs +2 -0
- package/dist/esm/api/resources/customers/types/ListCustomerUnitsByExternalIdRequestStatus.d.mts +6 -0
- package/dist/esm/api/resources/customers/types/ListCustomerUnitsByExternalIdRequestStatus.mjs +6 -0
- package/dist/esm/api/resources/customers/types/ListCustomerUnitsRequestStatus.d.mts +6 -0
- package/dist/esm/api/resources/customers/types/ListCustomerUnitsRequestStatus.mjs +6 -0
- package/dist/esm/api/resources/customers/types/ListCustomersRequestCreationState.d.mts +5 -0
- package/dist/esm/api/resources/customers/types/ListCustomersRequestCreationState.mjs +5 -0
- package/dist/esm/api/resources/customers/types/ListCustomersRequestStatus.d.mts +5 -0
- package/dist/esm/api/resources/customers/types/ListCustomersRequestStatus.mjs +5 -0
- package/dist/esm/api/resources/customers/types/index.d.mts +7 -0
- package/dist/esm/api/resources/customers/types/index.mjs +7 -0
- package/dist/esm/api/resources/deliveredValue/client/Client.d.mts +60 -0
- package/dist/esm/api/resources/deliveredValue/client/Client.mjs +211 -0
- package/dist/esm/api/resources/deliveredValue/client/index.d.mts +1 -0
- package/dist/esm/api/resources/deliveredValue/client/index.mjs +1 -0
- package/dist/esm/api/resources/deliveredValue/client/requests/GetDeliveredValueRequest.d.mts +18 -0
- package/dist/esm/api/resources/deliveredValue/client/requests/GetDeliveredValueRequest.mjs +2 -0
- package/dist/esm/api/resources/deliveredValue/client/requests/GetDeliveredValueSummaryRequest.d.mts +29 -0
- package/dist/esm/api/resources/deliveredValue/client/requests/GetDeliveredValueSummaryRequest.mjs +2 -0
- package/dist/esm/api/resources/deliveredValue/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/deliveredValue/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/deliveredValue/index.d.mts +2 -0
- package/dist/esm/api/resources/deliveredValue/index.mjs +2 -0
- package/dist/esm/api/resources/deliveredValue/types/GetDeliveredValueSummaryRequestGroupBy.d.mts +7 -0
- package/dist/esm/api/resources/deliveredValue/types/GetDeliveredValueSummaryRequestGroupBy.mjs +7 -0
- package/dist/esm/api/resources/deliveredValue/types/GetDeliveredValueSummaryRequestInterval.d.mts +8 -0
- package/dist/esm/api/resources/deliveredValue/types/GetDeliveredValueSummaryRequestInterval.mjs +8 -0
- package/dist/esm/api/resources/deliveredValue/types/index.d.mts +2 -0
- package/dist/esm/api/resources/deliveredValue/types/index.mjs +2 -0
- package/dist/esm/api/resources/index.d.mts +30 -0
- package/dist/esm/api/resources/index.mjs +30 -0
- package/dist/esm/api/resources/invoices/client/Client.mjs +37 -1
- package/dist/esm/api/resources/invoices/client/requests/ListInvoicesRequest.d.mts +25 -0
- package/dist/esm/api/resources/invoices/index.d.mts +1 -0
- package/dist/esm/api/resources/invoices/index.mjs +1 -0
- package/dist/esm/api/resources/invoices/types/ListInvoicesRequestPaymentStatus.d.mts +8 -0
- package/dist/esm/api/resources/invoices/types/ListInvoicesRequestPaymentStatus.mjs +8 -0
- package/dist/esm/api/resources/invoices/types/ListInvoicesRequestStatus.d.mts +10 -0
- package/dist/esm/api/resources/invoices/types/ListInvoicesRequestStatus.mjs +10 -0
- package/dist/esm/api/resources/invoices/types/index.d.mts +2 -0
- package/dist/esm/api/resources/invoices/types/index.mjs +2 -0
- package/dist/esm/api/resources/orders/client/Client.d.mts +105 -1
- package/dist/esm/api/resources/orders/client/Client.mjs +245 -2
- package/dist/esm/api/resources/orders/client/requests/ActivateOrderByIdRequest.d.mts +9 -0
- package/dist/esm/api/resources/orders/client/requests/ActivateOrderByIdRequest.mjs +2 -0
- package/dist/esm/api/resources/orders/client/requests/CreateOrderRequest.d.mts +14 -1
- package/dist/esm/api/resources/orders/client/requests/CreateOrderRequest.mjs +11 -1
- package/dist/esm/api/resources/orders/client/requests/ListOrdersRequest.d.mts +19 -0
- package/dist/esm/api/resources/orders/client/requests/ProvisionRequest.d.mts +82 -0
- package/dist/esm/api/resources/orders/client/requests/ProvisionRequest.mjs +2 -0
- package/dist/esm/api/resources/orders/client/requests/UpdateOrderRequest.d.mts +14 -1
- package/dist/esm/api/resources/orders/client/requests/UpdateOrderRequest.mjs +11 -1
- package/dist/esm/api/resources/orders/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/orders/types/ListOrdersRequestCreationState.d.mts +5 -0
- package/dist/esm/api/resources/orders/types/ListOrdersRequestCreationState.mjs +5 -0
- package/dist/esm/api/resources/orders/types/OrderStatusFilter.d.mts +7 -0
- package/dist/esm/api/resources/orders/types/OrderStatusFilter.mjs +7 -0
- package/dist/esm/api/resources/orders/types/index.d.mts +2 -0
- package/dist/esm/api/resources/orders/types/index.mjs +2 -0
- package/dist/esm/api/resources/paymentAllocations/client/Client.d.mts +56 -0
- package/dist/esm/api/resources/paymentAllocations/client/Client.mjs +190 -0
- package/dist/esm/api/resources/paymentAllocations/client/index.d.mts +1 -0
- package/dist/esm/api/resources/paymentAllocations/client/index.mjs +1 -0
- package/dist/esm/api/resources/paymentAllocations/client/requests/CreatePaymentAllocationRequest.d.mts +17 -0
- package/dist/esm/api/resources/paymentAllocations/client/requests/CreatePaymentAllocationRequest.mjs +2 -0
- package/dist/esm/api/resources/paymentAllocations/client/requests/ListPaymentAllocationsRequest.d.mts +15 -0
- package/dist/esm/api/resources/paymentAllocations/client/requests/ListPaymentAllocationsRequest.mjs +2 -0
- package/dist/esm/api/resources/paymentAllocations/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/paymentAllocations/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/paymentAllocations/index.d.mts +1 -0
- package/dist/esm/api/resources/paymentAllocations/index.mjs +1 -0
- package/dist/esm/api/resources/paymentMethods/client/Client.d.mts +104 -0
- package/dist/esm/api/resources/paymentMethods/client/Client.mjs +409 -0
- package/dist/esm/api/resources/paymentMethods/client/index.d.mts +1 -0
- package/dist/esm/api/resources/paymentMethods/client/index.mjs +1 -0
- package/dist/esm/api/resources/paymentMethods/client/requests/CreatePaymentMethodRequest.d.mts +18 -0
- package/dist/esm/api/resources/paymentMethods/client/requests/CreatePaymentMethodRequest.mjs +2 -0
- package/dist/esm/api/resources/paymentMethods/client/requests/DeletePaymentMethodRequest.d.mts +9 -0
- package/dist/esm/api/resources/paymentMethods/client/requests/DeletePaymentMethodRequest.mjs +2 -0
- package/dist/esm/api/resources/paymentMethods/client/requests/GetPaymentMethodRequest.d.mts +9 -0
- package/dist/esm/api/resources/paymentMethods/client/requests/GetPaymentMethodRequest.mjs +2 -0
- package/dist/esm/api/resources/paymentMethods/client/requests/ListPaymentMethodsRequest.d.mts +14 -0
- package/dist/esm/api/resources/paymentMethods/client/requests/ListPaymentMethodsRequest.mjs +2 -0
- package/dist/esm/api/resources/paymentMethods/client/requests/UpdateDefaultPaymentMethodRequest.d.mts +9 -0
- package/dist/esm/api/resources/paymentMethods/client/requests/UpdateDefaultPaymentMethodRequest.mjs +2 -0
- package/dist/esm/api/resources/paymentMethods/client/requests/index.d.mts +5 -0
- package/dist/esm/api/resources/paymentMethods/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/paymentMethods/index.d.mts +1 -0
- package/dist/esm/api/resources/paymentMethods/index.mjs +1 -0
- package/dist/esm/api/resources/payments/client/Client.d.mts +68 -0
- package/dist/esm/api/resources/payments/client/Client.mjs +256 -0
- package/dist/esm/api/resources/payments/client/index.d.mts +1 -0
- package/dist/esm/api/resources/payments/client/index.mjs +1 -0
- package/dist/esm/api/resources/payments/client/requests/CreatePaymentRequest.d.mts +25 -0
- package/dist/esm/api/resources/payments/client/requests/CreatePaymentRequest.mjs +2 -0
- package/dist/esm/api/resources/payments/client/requests/GetPaymentRequest.d.mts +9 -0
- package/dist/esm/api/resources/payments/client/requests/GetPaymentRequest.mjs +2 -0
- package/dist/esm/api/resources/payments/client/requests/ListPaymentsRequest.d.mts +15 -0
- package/dist/esm/api/resources/payments/client/requests/ListPaymentsRequest.mjs +2 -0
- package/dist/esm/api/resources/payments/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/payments/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/payments/index.d.mts +2 -0
- package/dist/esm/api/resources/payments/index.mjs +2 -0
- package/dist/esm/api/resources/payments/types/ListPaymentsRequestStatus.d.mts +9 -0
- package/dist/esm/api/resources/payments/types/ListPaymentsRequestStatus.mjs +9 -0
- package/dist/esm/api/resources/payments/types/index.d.mts +1 -0
- package/dist/esm/api/resources/payments/types/index.mjs +1 -0
- package/dist/esm/api/resources/plans/client/Client.d.mts +152 -0
- package/dist/esm/api/resources/plans/client/Client.mjs +556 -0
- package/dist/esm/api/resources/plans/client/index.d.mts +1 -0
- package/dist/esm/api/resources/plans/client/index.mjs +1 -0
- package/dist/esm/api/resources/plans/client/requests/CreatePlanRequest.d.mts +28 -0
- package/dist/esm/api/resources/plans/client/requests/CreatePlanRequest.mjs +2 -0
- package/dist/esm/api/resources/plans/client/requests/GetPlanByExternalIdRequest.d.mts +9 -0
- package/dist/esm/api/resources/plans/client/requests/GetPlanByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/plans/client/requests/GetPlanByIdRequest.d.mts +9 -0
- package/dist/esm/api/resources/plans/client/requests/GetPlanByIdRequest.mjs +2 -0
- package/dist/esm/api/resources/plans/client/requests/ListPlansRequest.d.mts +12 -0
- package/dist/esm/api/resources/plans/client/requests/ListPlansRequest.mjs +2 -0
- package/dist/esm/api/resources/plans/client/requests/UpdatePlanByExternalIdRequest.d.mts +12 -0
- package/dist/esm/api/resources/plans/client/requests/UpdatePlanByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/plans/client/requests/UpdatePlanByIdRequest.d.mts +12 -0
- package/dist/esm/api/resources/plans/client/requests/UpdatePlanByIdRequest.mjs +2 -0
- package/dist/esm/api/resources/plans/client/requests/UpdatePlanUpgradePathRequest.d.mts +15 -0
- package/dist/esm/api/resources/plans/client/requests/UpdatePlanUpgradePathRequest.mjs +2 -0
- package/dist/esm/api/resources/plans/client/requests/index.d.mts +7 -0
- package/dist/esm/api/resources/plans/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/plans/index.d.mts +1 -0
- package/dist/esm/api/resources/plans/index.mjs +1 -0
- package/dist/esm/api/resources/pricing/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/pricing/client/Client.mjs +2 -2
- package/dist/esm/api/resources/pricing/client/requests/UpdatePricingRequest.d.mts +1 -1
- package/dist/esm/api/resources/products/client/Client.d.mts +9 -9
- package/dist/esm/api/resources/products/client/Client.mjs +15 -6
- package/dist/esm/api/resources/products/client/requests/ListProductsRequest.d.mts +6 -0
- package/dist/esm/api/resources/signals/client/Client.d.mts +175 -4
- package/dist/esm/api/resources/signals/client/Client.mjs +569 -4
- package/dist/esm/api/resources/signals/client/requests/BulkSignalsRequest.d.mts +17 -3
- package/dist/esm/api/resources/signals/client/requests/CreateSignalSummaryExportRequest.d.mts +56 -0
- package/dist/esm/api/resources/signals/client/requests/CreateSignalSummaryExportRequest.mjs +9 -0
- package/dist/esm/api/resources/signals/client/requests/GetSignalByIdRequest.d.mts +10 -0
- package/dist/esm/api/resources/signals/client/requests/GetSignalByIdRequest.mjs +2 -0
- package/dist/esm/api/resources/signals/client/requests/GetSignalSummaryExportRequest.d.mts +9 -0
- package/dist/esm/api/resources/signals/client/requests/GetSignalSummaryExportRequest.mjs +2 -0
- package/dist/esm/api/resources/signals/client/requests/GetSignalSummaryRequest.d.mts +45 -0
- package/dist/esm/api/resources/signals/client/requests/GetSignalSummaryRequest.mjs +2 -0
- package/dist/esm/api/resources/signals/client/requests/ListSignalsRequest.d.mts +22 -0
- package/dist/esm/api/resources/signals/client/requests/ListSignalsRequest.mjs +2 -0
- package/dist/esm/api/resources/signals/client/requests/SignalLookupRequest.d.mts +10 -0
- package/dist/esm/api/resources/signals/client/requests/SignalLookupRequest.mjs +2 -0
- package/dist/esm/api/resources/signals/client/requests/index.d.mts +6 -0
- package/dist/esm/api/resources/signals/index.d.mts +1 -0
- package/dist/esm/api/resources/signals/index.mjs +1 -0
- package/dist/esm/api/resources/signals/types/GetSignalSummaryRequestGroupBy.d.mts +5 -0
- package/dist/esm/api/resources/signals/types/GetSignalSummaryRequestGroupBy.mjs +5 -0
- package/dist/esm/api/resources/signals/types/GetSignalSummaryRequestInterval.d.mts +7 -0
- package/dist/esm/api/resources/signals/types/GetSignalSummaryRequestInterval.mjs +7 -0
- package/dist/esm/api/resources/signals/types/index.d.mts +2 -0
- package/dist/esm/api/resources/signals/types/index.mjs +2 -0
- package/dist/esm/api/resources/valueMetrics/client/Client.d.mts +111 -0
- package/dist/esm/api/resources/valueMetrics/client/Client.mjs +409 -0
- package/dist/esm/api/resources/valueMetrics/client/index.d.mts +1 -0
- package/dist/esm/api/resources/valueMetrics/client/index.mjs +1 -0
- package/dist/esm/api/resources/valueMetrics/client/requests/ArchiveValueMetricRequest.d.mts +10 -0
- package/dist/esm/api/resources/valueMetrics/client/requests/ArchiveValueMetricRequest.mjs +2 -0
- package/dist/esm/api/resources/valueMetrics/client/requests/CreateValueMetricRequest.d.mts +57 -0
- package/dist/esm/api/resources/valueMetrics/client/requests/CreateValueMetricRequest.mjs +12 -0
- package/dist/esm/api/resources/valueMetrics/client/requests/GetValueMetricRequest.d.mts +9 -0
- package/dist/esm/api/resources/valueMetrics/client/requests/GetValueMetricRequest.mjs +2 -0
- package/dist/esm/api/resources/valueMetrics/client/requests/ListValueMetricsRequest.d.mts +10 -0
- package/dist/esm/api/resources/valueMetrics/client/requests/ListValueMetricsRequest.mjs +2 -0
- package/dist/esm/api/resources/valueMetrics/client/requests/UpdateValueMetricRequest.d.mts +43 -0
- package/dist/esm/api/resources/valueMetrics/client/requests/UpdateValueMetricRequest.mjs +12 -0
- package/dist/esm/api/resources/valueMetrics/client/requests/index.d.mts +5 -0
- package/dist/esm/api/resources/valueMetrics/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/valueMetrics/index.d.mts +1 -0
- package/dist/esm/api/resources/valueMetrics/index.mjs +1 -0
- package/dist/esm/api/resources/valueModels/client/Client.d.mts +120 -0
- package/dist/esm/api/resources/valueModels/client/Client.mjs +388 -0
- package/dist/esm/api/resources/valueModels/client/index.d.mts +1 -0
- package/dist/esm/api/resources/valueModels/client/index.mjs +1 -0
- package/dist/esm/api/resources/valueModels/client/requests/GetValueModelVersionRequest.d.mts +9 -0
- package/dist/esm/api/resources/valueModels/client/requests/GetValueModelVersionRequest.mjs +2 -0
- package/dist/esm/api/resources/valueModels/client/requests/ListValueModelVersionsRequest.d.mts +8 -0
- package/dist/esm/api/resources/valueModels/client/requests/ListValueModelVersionsRequest.mjs +2 -0
- package/dist/esm/api/resources/valueModels/client/requests/RefreshValueModelBackfillRequest.d.mts +5 -0
- package/dist/esm/api/resources/valueModels/client/requests/RefreshValueModelBackfillRequest.mjs +2 -0
- package/dist/esm/api/resources/valueModels/client/requests/ValueModelUploadRequest.d.mts +46 -0
- package/dist/esm/api/resources/valueModels/client/requests/ValueModelUploadRequest.mjs +2 -0
- package/dist/esm/api/resources/valueModels/client/requests/index.d.mts +4 -0
- package/dist/esm/api/resources/valueModels/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/valueModels/index.d.mts +1 -0
- package/dist/esm/api/resources/valueModels/index.mjs +1 -0
- package/dist/esm/api/resources/valueReceipts/client/Client.d.mts +45 -14
- package/dist/esm/api/resources/valueReceipts/client/Client.mjs +156 -46
- package/dist/esm/api/resources/valueReceipts/client/requests/PublishValueReceiptBody.d.mts +1 -0
- package/dist/esm/api/resources/valueReceipts/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +19 -4
- package/dist/esm/api/resources/webhooks/client/Client.mjs +71 -3
- package/dist/esm/api/resources/webhooks/client/requests/RotateWebhookSecretRequest.d.mts +5 -0
- package/dist/esm/api/resources/webhooks/client/requests/RotateWebhookSecretRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/TestWebhookRequest.d.mts +1 -1
- package/dist/esm/api/resources/webhooks/client/requests/UpdateWebhookRequest.d.mts +2 -2
- package/dist/esm/api/resources/webhooks/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/webhooks/types/TestWebhookRequestWebhookName.d.mts +2 -1
- package/dist/esm/api/resources/webhooks/types/TestWebhookRequestWebhookName.mjs +2 -1
- package/dist/esm/api/resources/webhooks/types/UpdateWebhookRequestWebhookName.d.mts +2 -1
- package/dist/esm/api/resources/webhooks/types/UpdateWebhookRequestWebhookName.mjs +2 -1
- package/dist/esm/api/types/AddAttributeIntent.d.mts +45 -0
- package/dist/esm/api/types/AddAttributeIntent.mjs +21 -0
- package/dist/esm/api/types/AddFromCatalogIntent.d.mts +22 -0
- package/dist/esm/api/types/AddFromCatalogIntent.mjs +10 -0
- package/dist/esm/api/types/AmendmentAddAttributeOptions.d.mts +9 -0
- package/dist/esm/api/types/AmendmentAddAttributeOptions.mjs +2 -0
- package/dist/esm/api/types/AmendmentAddAxisOptions.d.mts +10 -0
- package/dist/esm/api/types/AmendmentAddAxisOptions.mjs +2 -0
- package/dist/esm/api/types/AmendmentAttributeOptions.d.mts +14 -0
- package/dist/esm/api/types/AmendmentAttributeOptions.mjs +2 -0
- package/dist/esm/api/types/AmendmentAttributeState.d.mts +24 -0
- package/dist/esm/api/types/AmendmentAttributeState.mjs +2 -0
- package/dist/esm/api/types/AmendmentAxisChoiceValue.d.mts +10 -0
- package/dist/esm/api/types/AmendmentAxisChoiceValue.mjs +10 -0
- package/dist/esm/api/types/AmendmentAxisId.d.mts +8 -0
- package/dist/esm/api/types/AmendmentAxisId.mjs +8 -0
- package/dist/esm/api/types/AmendmentAxisOptions.d.mts +16 -0
- package/dist/esm/api/types/AmendmentAxisOptions.mjs +2 -0
- package/dist/esm/api/types/AmendmentAxisRelevance.d.mts +6 -0
- package/dist/esm/api/types/AmendmentAxisRelevance.mjs +6 -0
- package/dist/esm/api/types/AmendmentBillingType.d.mts +6 -0
- package/dist/esm/api/types/AmendmentBillingType.mjs +6 -0
- package/dist/esm/api/types/AmendmentChargeType.d.mts +8 -0
- package/dist/esm/api/types/AmendmentChargeType.mjs +8 -0
- package/dist/esm/api/types/AmendmentCreditEffectKind.d.mts +6 -0
- package/dist/esm/api/types/AmendmentCreditEffectKind.mjs +6 -0
- package/dist/esm/api/types/AmendmentErrorResponse.d.mts +7 -0
- package/dist/esm/api/types/AmendmentErrorResponse.mjs +2 -0
- package/dist/esm/api/types/AmendmentIntentKind.d.mts +10 -0
- package/dist/esm/api/types/AmendmentIntentKind.mjs +10 -0
- package/dist/esm/api/types/AmendmentIntentOptions.d.mts +7 -0
- package/dist/esm/api/types/AmendmentIntentOptions.mjs +2 -0
- package/dist/esm/api/types/AmendmentLineOptions.d.mts +12 -0
- package/dist/esm/api/types/AmendmentLineOptions.mjs +2 -0
- package/dist/esm/api/types/AmendmentMoneyBilling.d.mts +6 -0
- package/dist/esm/api/types/AmendmentMoneyBilling.mjs +6 -0
- package/dist/esm/api/types/AmendmentOptions.d.mts +26 -0
- package/dist/esm/api/types/AmendmentOptions.mjs +2 -0
- package/dist/esm/api/types/AmendmentPlan.d.mts +24 -0
- package/dist/esm/api/types/AmendmentPlan.mjs +2 -0
- package/dist/esm/api/types/AmendmentPlanAttributeDiff.d.mts +18 -0
- package/dist/esm/api/types/AmendmentPlanAttributeDiff.mjs +2 -0
- package/dist/esm/api/types/AmendmentPlanChange.d.mts +9 -0
- package/dist/esm/api/types/AmendmentPlanChange.mjs +9 -0
- package/dist/esm/api/types/AmendmentPlanCreditEffect.d.mts +15 -0
- package/dist/esm/api/types/AmendmentPlanCreditEffect.mjs +2 -0
- package/dist/esm/api/types/AmendmentPlanLineType.d.mts +8 -0
- package/dist/esm/api/types/AmendmentPlanLineType.mjs +8 -0
- package/dist/esm/api/types/AmendmentPlanMoneyEffect.d.mts +31 -0
- package/dist/esm/api/types/AmendmentPlanMoneyEffect.mjs +10 -0
- package/dist/esm/api/types/AmendmentPlanTreatmentResolution.d.mts +12 -0
- package/dist/esm/api/types/AmendmentPlanTreatmentResolution.mjs +2 -0
- package/dist/esm/api/types/AmendmentPlanUsageEffect.d.mts +17 -0
- package/dist/esm/api/types/AmendmentPlanUsageEffect.mjs +9 -0
- package/dist/esm/api/types/AmendmentPricingClause.d.mts +14 -0
- package/dist/esm/api/types/AmendmentPricingClause.mjs +2 -0
- package/dist/esm/api/types/AmendmentPricingModel.d.mts +11 -0
- package/dist/esm/api/types/AmendmentPricingModel.mjs +11 -0
- package/dist/esm/api/types/AmendmentTreatmentSource.d.mts +7 -0
- package/dist/esm/api/types/AmendmentTreatmentSource.mjs +7 -0
- package/dist/esm/api/types/AnalyticsColumn.d.mts +5 -0
- package/dist/esm/api/types/AnalyticsColumn.mjs +2 -0
- package/dist/esm/api/types/AnalyticsQueryRequest.d.mts +4 -0
- package/dist/esm/api/types/AnalyticsQueryRequest.mjs +2 -0
- package/dist/esm/api/types/AnalyticsQueryResponse.d.mts +15 -0
- package/dist/esm/api/types/AnalyticsQueryResponse.mjs +2 -0
- package/dist/esm/api/types/AnalyticsSchemaColumn.d.mts +6 -0
- package/dist/esm/api/types/AnalyticsSchemaColumn.mjs +2 -0
- package/dist/esm/api/types/AnalyticsSchemaResponse.d.mts +4 -0
- package/dist/esm/api/types/AnalyticsSchemaResponse.mjs +2 -0
- package/dist/esm/api/types/AnalyticsSchemaView.d.mts +6 -0
- package/dist/esm/api/types/AnalyticsSchemaView.mjs +2 -0
- package/dist/esm/api/types/Attribution.d.mts +3 -0
- package/dist/esm/api/types/BackfillResponse.d.mts +4 -0
- package/dist/esm/api/types/BackfillResponse.mjs +2 -0
- package/dist/esm/api/types/ChargeStubAddAxisOptions.d.mts +34 -0
- package/dist/esm/api/types/ChargeStubAddAxisOptions.mjs +16 -0
- package/dist/esm/api/types/ChargeStubAxisOptions.d.mts +33 -0
- package/dist/esm/api/types/ChargeStubAxisOptions.mjs +16 -0
- package/dist/esm/api/types/Checkout.d.mts +6 -0
- package/dist/esm/api/types/CheckoutCustomCard.d.mts +10 -0
- package/dist/esm/api/types/CheckoutCustomCard.mjs +2 -0
- package/dist/esm/api/types/CheckoutCustomCardInput.d.mts +10 -0
- package/dist/esm/api/types/CheckoutCustomCardInput.mjs +2 -0
- package/dist/esm/api/types/CheckoutDetails.d.mts +7 -0
- package/dist/esm/api/types/CheckoutPlan.d.mts +4 -0
- package/dist/esm/api/types/CheckoutPlan.mjs +2 -0
- package/dist/esm/api/types/CheckoutPlanInput.d.mts +6 -0
- package/dist/esm/api/types/CheckoutPlanInput.mjs +2 -0
- package/dist/esm/api/types/CheckoutProduct.d.mts +3 -0
- package/dist/esm/api/types/CheckoutProductInput.d.mts +3 -0
- package/dist/esm/api/types/CheckoutSelectedProduct.d.mts +8 -0
- package/dist/esm/api/types/CheckoutSelectedProduct.mjs +2 -0
- package/dist/esm/api/types/CreateOrderLineAttributeRequest.d.mts +47 -5
- package/dist/esm/api/types/CreateOrderLineAttributeRequest.mjs +11 -0
- package/dist/esm/api/types/CreateOrderLineRequest.d.mts +4 -0
- package/dist/esm/api/types/CreditBalance.d.mts +3 -1
- package/dist/esm/api/types/CreditBenefitInput.d.mts +12 -5
- package/dist/esm/api/types/CreditBenefitInput.mjs +2 -0
- package/dist/esm/api/types/CreditBenefitOutput.d.mts +8 -6
- package/dist/esm/api/types/CreditCurrency.d.mts +17 -0
- package/dist/esm/api/types/CreditCurrency.mjs +8 -1
- package/dist/esm/api/types/CreditGrant.d.mts +3 -0
- package/dist/esm/api/types/CreditGrantAddAxisOptions.d.mts +24 -0
- package/dist/esm/api/types/CreditGrantAddAxisOptions.mjs +2 -0
- package/dist/esm/api/types/CreditGrantAxisOptions.d.mts +23 -0
- package/dist/esm/api/types/CreditGrantAxisOptions.mjs +2 -0
- package/dist/esm/api/types/CreditGrantCreateRequest.d.mts +12 -0
- package/dist/esm/api/types/CreditGrantCreateRequest.mjs +2 -0
- package/dist/esm/api/types/CreditGrantCurrency.d.mts +6 -0
- package/dist/esm/api/types/CreditGrantCurrency.mjs +2 -0
- package/dist/esm/api/types/CreditGrantCustomer.d.mts +6 -0
- package/dist/esm/api/types/CreditGrantCustomer.mjs +2 -0
- package/dist/esm/api/types/CreditGrantResult.d.mts +19 -0
- package/dist/esm/api/types/CreditGrantResult.mjs +8 -0
- package/dist/esm/api/types/CreditGrantValue.d.mts +7 -0
- package/dist/esm/api/types/CreditGrantValue.mjs +7 -0
- package/dist/esm/api/types/CreditTransaction.d.mts +31 -0
- package/dist/esm/api/types/CreditTransaction.mjs +10 -0
- package/dist/esm/api/types/CreditTransactionCurrency.d.mts +6 -0
- package/dist/esm/api/types/CreditTransactionCurrency.mjs +2 -0
- package/dist/esm/api/types/CreditTransactionCustomer.d.mts +6 -0
- package/dist/esm/api/types/CreditTransactionCustomer.mjs +2 -0
- package/dist/esm/api/types/CreditTransactionListResponse.d.mts +6 -0
- package/dist/esm/api/types/CreditTransactionListResponse.mjs +2 -0
- package/dist/esm/api/types/CreditTransactionProduct.d.mts +11 -0
- package/dist/esm/api/types/CreditTransactionProduct.mjs +2 -0
- package/dist/esm/api/types/CreditTransactionSummaryBucket.d.mts +25 -0
- package/dist/esm/api/types/CreditTransactionSummaryBucket.mjs +2 -0
- package/dist/esm/api/types/CreditTransactionSummaryResponse.d.mts +32 -0
- package/dist/esm/api/types/CreditTransactionSummaryResponse.mjs +20 -0
- package/dist/esm/api/types/CurrencyCode.d.mts +4 -0
- package/dist/esm/api/types/CurrencyCode.mjs +2 -0
- package/dist/esm/api/types/CustomView.d.mts +29 -0
- package/dist/esm/api/types/CustomView.mjs +14 -0
- package/dist/esm/api/types/CustomViewAuthoringDetail.d.mts +73 -0
- package/dist/esm/api/types/CustomViewAuthoringDetail.mjs +27 -0
- package/dist/esm/api/types/CustomViewAuthoringGuide.d.mts +6 -0
- package/dist/esm/api/types/CustomViewAuthoringGuide.mjs +2 -0
- package/dist/esm/api/types/CustomViewContextCap.d.mts +27 -0
- package/dist/esm/api/types/CustomViewContextCap.mjs +8 -0
- package/dist/esm/api/types/CustomViewCustomerUnit.d.mts +16 -0
- package/dist/esm/api/types/CustomViewCustomerUnit.mjs +2 -0
- package/dist/esm/api/types/CustomViewDataContext.d.mts +57 -0
- package/dist/esm/api/types/CustomViewDataContext.mjs +18 -0
- package/dist/esm/api/types/CustomViewDetail.d.mts +64 -0
- package/dist/esm/api/types/CustomViewDetail.mjs +27 -0
- package/dist/esm/api/types/CustomViewEmbedTokenResponse.d.mts +6 -0
- package/dist/esm/api/types/CustomViewEmbedTokenResponse.mjs +2 -0
- package/dist/esm/api/types/CustomViewFilter.d.mts +6 -0
- package/dist/esm/api/types/CustomViewFilter.mjs +2 -0
- package/dist/esm/api/types/CustomViewListResponse.d.mts +4 -0
- package/dist/esm/api/types/CustomViewListResponse.mjs +2 -0
- package/dist/esm/api/types/CustomViewPreviewHarness.d.mts +4 -0
- package/dist/esm/api/types/CustomViewPreviewHarness.mjs +2 -0
- package/dist/esm/api/types/CustomViewPreviewHarnessColumn.d.mts +16 -0
- package/dist/esm/api/types/CustomViewPreviewHarnessColumn.mjs +11 -0
- package/dist/esm/api/types/CustomViewPreviewHarnessRequest.d.mts +12 -0
- package/dist/esm/api/types/CustomViewPreviewHarnessRequest.mjs +2 -0
- package/dist/esm/api/types/CustomViewQuery.d.mts +6 -0
- package/dist/esm/api/types/CustomViewQuery.mjs +2 -0
- package/dist/esm/api/types/CustomViewSummary.d.mts +61 -0
- package/dist/esm/api/types/CustomViewSummary.mjs +27 -0
- package/dist/esm/api/types/CustomViewUnitSelection.d.mts +14 -0
- package/dist/esm/api/types/CustomViewUnitSelection.mjs +2 -0
- package/dist/esm/api/types/CustomViewValidationFinding.d.mts +8 -0
- package/dist/esm/api/types/CustomViewValidationFinding.mjs +2 -0
- package/dist/esm/api/types/Customer.d.mts +14 -2
- package/dist/esm/api/types/Customer.mjs +8 -1
- package/dist/esm/api/types/CustomerAlias.d.mts +12 -0
- package/dist/esm/api/types/CustomerAlias.mjs +2 -0
- package/dist/esm/api/types/CustomerAliasCreateRequest.d.mts +8 -0
- package/dist/esm/api/types/CustomerAliasCreateRequest.mjs +2 -0
- package/dist/esm/api/types/CustomerAliasListResponse.d.mts +5 -0
- package/dist/esm/api/types/CustomerAliasListResponse.mjs +2 -0
- package/dist/esm/api/types/CustomerApiKey.d.mts +31 -0
- package/dist/esm/api/types/CustomerApiKey.mjs +10 -0
- package/dist/esm/api/types/CustomerApiKeyCreate.d.mts +8 -0
- package/dist/esm/api/types/CustomerApiKeyCreate.mjs +2 -0
- package/dist/esm/api/types/CustomerApiKeyCreated.d.mts +33 -0
- package/dist/esm/api/types/CustomerApiKeyCreated.mjs +10 -0
- package/dist/esm/api/types/CustomerApiKeyList.d.mts +5 -0
- package/dist/esm/api/types/CustomerApiKeyList.mjs +2 -0
- package/dist/esm/api/types/CustomerAttribution.d.mts +3 -0
- package/dist/{cjs/api/types/CustomerBillingAddress.d.ts → esm/api/types/CustomerBillingAddressInput.d.mts} +1 -1
- package/dist/esm/api/types/CustomerBillingAddressInput.mjs +2 -0
- package/dist/esm/api/types/CustomerBillingAddressResponse.d.mts +11 -0
- package/dist/esm/api/types/CustomerBillingAddressResponse.mjs +2 -0
- package/dist/esm/api/types/CustomerConnections.d.mts +7 -0
- package/dist/esm/api/types/CustomerConnections.mjs +2 -0
- package/dist/esm/api/types/CustomerFundingInstructions.d.mts +24 -0
- package/dist/esm/api/types/CustomerFundingInstructions.mjs +7 -0
- package/dist/esm/api/types/CustomerFundingInstructionsCreateRequest.d.mts +4 -0
- package/dist/esm/api/types/CustomerFundingInstructionsCreateRequest.mjs +2 -0
- package/dist/esm/api/types/CustomerState.d.mts +10 -0
- package/dist/esm/api/types/CustomerState.mjs +2 -0
- package/dist/esm/api/types/CustomerStateCheckoutLink.d.mts +18 -0
- package/dist/esm/api/types/CustomerStateCheckoutLink.mjs +10 -0
- package/dist/esm/api/types/CustomerStateCreditBalance.d.mts +6 -0
- package/dist/esm/api/types/CustomerStateCreditBalance.mjs +2 -0
- package/dist/esm/api/types/CustomerStateCreditSummary.d.mts +4 -0
- package/dist/esm/api/types/CustomerStateCreditSummary.mjs +2 -0
- package/dist/esm/api/types/CustomerStateCustomer.d.mts +8 -0
- package/dist/esm/api/types/CustomerStateCustomer.mjs +2 -0
- package/dist/esm/api/types/CustomerStateOrder.d.mts +21 -0
- package/dist/esm/api/types/CustomerStateOrder.mjs +10 -0
- package/dist/esm/api/types/CustomerStateProductRef.d.mts +5 -0
- package/dist/esm/api/types/CustomerStateProductRef.mjs +2 -0
- package/dist/esm/api/types/CustomerStateSeat.d.mts +17 -0
- package/dist/esm/api/types/CustomerStateSeat.mjs +8 -0
- package/dist/esm/api/types/CustomerStateSeatAssignee.d.mts +6 -0
- package/dist/esm/api/types/CustomerStateSeatAssignee.mjs +2 -0
- package/dist/esm/api/types/CustomerStateSeats.d.mts +7 -0
- package/dist/esm/api/types/CustomerStateSeats.mjs +2 -0
- package/dist/esm/api/types/CustomerUnit.d.mts +36 -0
- package/dist/esm/api/types/CustomerUnit.mjs +10 -0
- package/dist/esm/api/types/CustomerUnitAttribution.d.mts +7 -0
- package/dist/esm/api/types/CustomerUnitAttribution.mjs +2 -0
- package/dist/esm/api/types/CustomerUnitByKey.d.mts +37 -0
- package/dist/esm/api/types/CustomerUnitByKey.mjs +10 -0
- package/dist/esm/api/types/CustomerUnitCapCurrentPeriod.d.mts +11 -0
- package/dist/esm/api/types/CustomerUnitCapCurrentPeriod.mjs +2 -0
- package/dist/esm/api/types/CustomerUnitCapEndResponse.d.mts +12 -0
- package/dist/esm/api/types/CustomerUnitCapEndResponse.mjs +2 -0
- package/dist/esm/api/types/CustomerUnitCapEndedPolicy.d.mts +26 -0
- package/dist/esm/api/types/CustomerUnitCapEndedPolicy.mjs +8 -0
- package/dist/esm/api/types/CustomerUnitCapPeriod.d.mts +6 -0
- package/dist/esm/api/types/CustomerUnitCapPeriod.mjs +2 -0
- package/dist/esm/api/types/CustomerUnitCapPolicy.d.mts +26 -0
- package/dist/esm/api/types/CustomerUnitCapPolicy.mjs +8 -0
- package/dist/esm/api/types/CustomerUnitCapResponse.d.mts +11 -0
- package/dist/esm/api/types/CustomerUnitCapResponse.mjs +2 -0
- package/dist/esm/api/types/CustomerUnitCapSavedPolicy.d.mts +26 -0
- package/dist/esm/api/types/CustomerUnitCapSavedPolicy.mjs +8 -0
- package/dist/esm/api/types/CustomerUnitCapSchedule.d.mts +9 -0
- package/dist/esm/api/types/CustomerUnitCapSchedule.mjs +2 -0
- package/dist/esm/api/types/CustomerUnitCapScheduleInput.d.mts +9 -0
- package/dist/esm/api/types/CustomerUnitCapScheduleInput.mjs +2 -0
- package/dist/esm/api/types/CustomerUnitCapSet.d.mts +19 -0
- package/dist/esm/api/types/CustomerUnitCapSet.mjs +8 -0
- package/dist/esm/api/types/CustomerUnitCapSetResponse.d.mts +13 -0
- package/dist/esm/api/types/CustomerUnitCapSetResponse.mjs +2 -0
- package/dist/esm/api/types/CustomerUnitCreate.d.mts +14 -0
- package/dist/esm/api/types/CustomerUnitCreate.mjs +2 -0
- package/dist/esm/api/types/CustomerUnitCreatedUnderParent.d.mts +34 -0
- package/dist/esm/api/types/CustomerUnitCreatedUnderParent.mjs +10 -0
- package/dist/esm/api/types/CustomerUnitListResponse.d.mts +6 -0
- package/dist/esm/api/types/CustomerUnitListResponse.mjs +2 -0
- package/dist/esm/api/types/CustomerUnitSpendResponse.d.mts +12 -0
- package/dist/esm/api/types/CustomerUnitSpendResponse.mjs +2 -0
- package/dist/esm/api/types/CustomerUnitSpendWindow.d.mts +9 -0
- package/dist/esm/api/types/CustomerUnitSpendWindow.mjs +2 -0
- package/dist/esm/api/types/CustomerUnitUpdate.d.mts +12 -0
- package/dist/esm/api/types/CustomerUnitUpdate.mjs +2 -0
- package/dist/esm/api/types/DeliveredValueCalculation.d.mts +11 -0
- package/dist/esm/api/types/DeliveredValueCalculation.mjs +2 -0
- package/dist/esm/api/types/DeliveredValueCalculationTerm.d.mts +34 -0
- package/dist/esm/api/types/DeliveredValueCalculationTerm.mjs +21 -0
- package/dist/esm/api/types/DeliveredValueMetric.d.mts +54 -0
- package/dist/esm/api/types/DeliveredValueMetric.mjs +2 -0
- package/dist/esm/api/types/DeliveredValueResponse.d.mts +34 -0
- package/dist/esm/api/types/DeliveredValueResponse.mjs +2 -0
- package/dist/esm/api/types/DeliveredValueSignal.d.mts +14 -0
- package/dist/esm/api/types/DeliveredValueSignal.mjs +2 -0
- package/dist/esm/api/types/DeliveredValueSignalValue.d.mts +8 -0
- package/dist/esm/api/types/DeliveredValueSignalValue.mjs +2 -0
- package/dist/esm/api/types/DeliveredValueSummaryBucket.d.mts +20 -0
- package/dist/esm/api/types/DeliveredValueSummaryBucket.mjs +2 -0
- package/dist/esm/api/types/DeliveredValueSummaryResponse.d.mts +41 -0
- package/dist/esm/api/types/DeliveredValueSummaryResponse.mjs +19 -0
- package/dist/esm/api/types/EndAttributeIntent.d.mts +16 -0
- package/dist/esm/api/types/EndAttributeIntent.mjs +11 -0
- package/dist/esm/api/types/GrantCustomerCreditsResponse.d.mts +9 -0
- package/dist/esm/api/types/GrantCustomerCreditsResponse.mjs +2 -0
- package/dist/esm/api/types/Invoice.d.mts +3 -0
- package/dist/esm/api/types/MoneyAxisOptions.d.mts +23 -0
- package/dist/esm/api/types/MoneyAxisOptions.mjs +2 -0
- package/dist/esm/api/types/MoneyAxisValue.d.mts +6 -0
- package/dist/esm/api/types/MoneyAxisValue.mjs +6 -0
- package/dist/esm/api/types/Order.d.mts +1 -0
- package/dist/esm/api/types/OrderLine.d.mts +2 -0
- package/dist/esm/api/types/OrderLineType.d.mts +7 -0
- package/dist/esm/api/types/OrderLineType.mjs +7 -0
- package/dist/esm/api/types/Payment.d.mts +30 -0
- package/dist/esm/api/types/Payment.mjs +2 -0
- package/dist/esm/api/types/PaymentAllocation.d.mts +21 -0
- package/dist/esm/api/types/PaymentAllocation.mjs +2 -0
- package/dist/esm/api/types/PaymentAllocationCreateResponse.d.mts +4 -0
- package/dist/esm/api/types/PaymentAllocationCreateResponse.mjs +2 -0
- package/dist/esm/api/types/PaymentAllocationInput.d.mts +8 -0
- package/dist/esm/api/types/PaymentAllocationInput.mjs +2 -0
- package/dist/esm/api/types/PaymentAllocationListResponse.d.mts +5 -0
- package/dist/esm/api/types/PaymentAllocationListResponse.mjs +2 -0
- package/dist/esm/api/types/PaymentCreateStatus.d.mts +6 -0
- package/dist/esm/api/types/PaymentCreateStatus.mjs +6 -0
- package/dist/esm/api/types/PaymentListResponse.d.mts +5 -0
- package/dist/esm/api/types/PaymentListResponse.mjs +2 -0
- package/dist/esm/api/types/PaymentMethod.d.mts +15 -0
- package/dist/esm/api/types/PaymentMethod.mjs +2 -0
- package/dist/esm/api/types/PaymentMethodCard.d.mts +13 -0
- package/dist/esm/api/types/PaymentMethodCard.mjs +2 -0
- package/dist/esm/api/types/PaymentMethodListResponse.d.mts +5 -0
- package/dist/esm/api/types/PaymentMethodListResponse.mjs +2 -0
- package/dist/esm/api/types/PaymentMethodSetup.d.mts +21 -0
- package/dist/esm/api/types/PaymentMethodSetup.mjs +2 -0
- package/dist/esm/api/types/PaymentType.d.mts +9 -0
- package/dist/esm/api/types/PaymentType.mjs +9 -0
- package/dist/esm/api/types/PendingCreditConsumption.d.mts +16 -0
- package/dist/esm/api/types/PendingCreditConsumption.mjs +2 -0
- package/dist/esm/api/types/PendingCreditConsumptionCurrency.d.mts +9 -0
- package/dist/esm/api/types/PendingCreditConsumptionCurrency.mjs +2 -0
- package/dist/esm/api/types/PendingCreditConsumptionListResponse.d.mts +6 -0
- package/dist/esm/api/types/PendingCreditConsumptionListResponse.mjs +2 -0
- package/dist/esm/api/types/Plan.d.mts +22 -0
- package/dist/esm/api/types/Plan.mjs +8 -0
- package/dist/esm/api/types/PlanAttribute.d.mts +8 -0
- package/dist/esm/api/types/PlanAttribute.mjs +2 -0
- package/dist/esm/api/types/PlanAttributeInput.d.mts +7 -0
- package/dist/esm/api/types/PlanAttributeInput.mjs +2 -0
- package/dist/esm/api/types/PlanCreditBenefit.d.mts +35 -0
- package/dist/esm/api/types/PlanCreditBenefit.mjs +17 -0
- package/dist/esm/api/types/PlanListResponse.d.mts +5 -0
- package/dist/esm/api/types/PlanListResponse.mjs +2 -0
- package/dist/esm/api/types/PlanPricing.d.mts +31 -0
- package/dist/esm/api/types/PlanPricing.mjs +21 -0
- package/dist/esm/api/types/PlanRef.d.mts +5 -0
- package/dist/esm/api/types/PlanRef.mjs +2 -0
- package/dist/esm/api/types/PlanUpgradePathGroup.d.mts +4 -0
- package/dist/esm/api/types/PlanUpgradePathGroup.mjs +2 -0
- package/dist/esm/api/types/PlanUpgradePathResponse.d.mts +4 -0
- package/dist/esm/api/types/PlanUpgradePathResponse.mjs +2 -0
- package/dist/esm/api/types/PlannedAdd.d.mts +28 -0
- package/dist/esm/api/types/PlannedAdd.mjs +10 -0
- package/dist/esm/api/types/PlannedCopy.d.mts +10 -0
- package/dist/esm/api/types/PlannedCopy.mjs +2 -0
- package/dist/esm/api/types/PlannedEnd.d.mts +10 -0
- package/dist/esm/api/types/PlannedEnd.mjs +2 -0
- package/dist/esm/api/types/PlannedOperations.d.mts +13 -0
- package/dist/esm/api/types/PlannedOperations.mjs +2 -0
- package/dist/esm/api/types/PlannedOrderTerm.d.mts +10 -0
- package/dist/esm/api/types/PlannedOrderTerm.mjs +2 -0
- package/dist/esm/api/types/PlannedReplace.d.mts +15 -0
- package/dist/esm/api/types/PlannedReplace.mjs +2 -0
- package/dist/esm/api/types/PricingInput.d.mts +4 -1
- package/dist/esm/api/types/PricingOutput.d.mts +10 -0
- package/dist/esm/api/types/PricingOutput.mjs +5 -0
- package/dist/esm/api/types/PricingPricePointOutput.d.mts +2 -22
- package/dist/esm/api/types/PricingPricePointOutput.mjs +1 -13
- package/dist/esm/api/types/PricingTierOutput.d.mts +16 -0
- package/dist/esm/api/types/PricingTierOutput.mjs +8 -0
- package/dist/esm/api/types/ProductAttributeOutput.d.mts +8 -0
- package/dist/esm/api/types/ProductAttributeOutput.mjs +2 -0
- package/dist/esm/api/types/ProductAttributeUpsert.d.mts +9 -0
- package/dist/esm/api/types/ProductAttributeUpsert.mjs +2 -0
- package/dist/esm/api/types/ProductCreditBenefitInput.d.mts +37 -0
- package/dist/esm/api/types/ProductCreditBenefitInput.mjs +19 -0
- package/dist/esm/api/types/ProductCreditBenefitOutput.d.mts +15 -0
- package/dist/esm/api/types/ProductCreditBenefitOutput.mjs +2 -0
- package/dist/esm/api/types/ProductDetail.d.mts +14 -0
- package/dist/esm/api/types/ProductDetail.mjs +2 -0
- package/dist/esm/api/types/ProductOneTimePerUnitInput.d.mts +21 -0
- package/dist/esm/api/types/ProductOneTimePerUnitInput.mjs +15 -0
- package/dist/esm/api/types/ProductPricePointOutput.d.mts +9 -0
- package/dist/esm/api/types/ProductPricePointOutput.mjs +2 -0
- package/dist/esm/api/types/ProductPricingInput.d.mts +49 -0
- package/dist/esm/api/types/ProductPricingInput.mjs +2 -0
- package/dist/esm/api/types/ProductPricingOutput.d.mts +46 -0
- package/dist/esm/api/types/ProductPricingOutput.mjs +25 -0
- package/dist/esm/api/types/ProductPricingTierOutput.d.mts +16 -0
- package/dist/esm/api/types/ProductPricingTierOutput.mjs +8 -0
- package/dist/esm/api/types/ProductRecurringGraduatedInput.d.mts +22 -0
- package/dist/esm/api/types/ProductRecurringGraduatedInput.mjs +15 -0
- package/dist/esm/api/types/ProductRecurringPerUnitInput.d.mts +22 -0
- package/dist/esm/api/types/ProductRecurringPerUnitInput.mjs +15 -0
- package/dist/esm/api/types/ProductRecurringPercentOfTotalInput.d.mts +23 -0
- package/dist/esm/api/types/ProductRecurringPercentOfTotalInput.mjs +15 -0
- package/dist/esm/api/types/ProductRecurringVolumeInput.d.mts +22 -0
- package/dist/esm/api/types/ProductRecurringVolumeInput.mjs +15 -0
- package/dist/esm/api/types/ProductSeatBasedGraduatedInput.d.mts +22 -0
- package/dist/esm/api/types/ProductSeatBasedGraduatedInput.mjs +15 -0
- package/dist/esm/api/types/ProductSeatBasedPerUnitInput.d.mts +22 -0
- package/dist/esm/api/types/ProductSeatBasedPerUnitInput.mjs +15 -0
- package/dist/esm/api/types/ProductSeatBasedPrepaidCreditsInput.d.mts +29 -0
- package/dist/esm/api/types/ProductSeatBasedPrepaidCreditsInput.mjs +15 -0
- package/dist/esm/api/types/ProductSeatBasedVolumeInput.d.mts +22 -0
- package/dist/esm/api/types/ProductSeatBasedVolumeInput.mjs +15 -0
- package/dist/esm/api/types/ProductSimplePricePoint.d.mts +29 -0
- package/dist/esm/api/types/ProductSimplePricePoint.mjs +14 -0
- package/dist/esm/api/types/ProductTieredPricePoint.d.mts +29 -0
- package/dist/esm/api/types/ProductTieredPricePoint.mjs +14 -0
- package/dist/esm/api/types/ProductUsageBracketedPrepaidCreditsInput.d.mts +61 -0
- package/dist/esm/api/types/ProductUsageBracketedPrepaidCreditsInput.mjs +26 -0
- package/dist/esm/api/types/ProductUsageCostPlusInput.d.mts +31 -0
- package/dist/esm/api/types/ProductUsageCostPlusInput.mjs +20 -0
- package/dist/esm/api/types/ProductUsageGraduatedInput.d.mts +31 -0
- package/dist/esm/api/types/ProductUsageGraduatedInput.mjs +20 -0
- package/dist/esm/api/types/ProductUsagePerUnitInput.d.mts +31 -0
- package/dist/esm/api/types/ProductUsagePerUnitInput.mjs +20 -0
- package/dist/esm/api/types/ProductUsagePrepaidCreditsInput.d.mts +50 -0
- package/dist/esm/api/types/ProductUsagePrepaidCreditsInput.mjs +26 -0
- package/dist/esm/api/types/ProductUsageVolumeInput.d.mts +31 -0
- package/dist/esm/api/types/ProductUsageVolumeInput.mjs +20 -0
- package/dist/esm/api/types/ProvisionBillingFrequencyOverride.d.mts +14 -0
- package/dist/esm/api/types/ProvisionBillingFrequencyOverride.mjs +11 -0
- package/dist/esm/api/types/ProvisionContact.d.mts +20 -0
- package/dist/esm/api/types/ProvisionContact.mjs +11 -0
- package/dist/esm/api/types/ProvisionCreatedContact.d.mts +14 -0
- package/dist/esm/api/types/ProvisionCreatedContact.mjs +9 -0
- package/dist/esm/api/types/ProvisionCreatedCustomer.d.mts +14 -0
- package/dist/esm/api/types/ProvisionCreatedCustomer.mjs +9 -0
- package/dist/esm/api/types/ProvisionCreatedOrder.d.mts +17 -0
- package/dist/esm/api/types/ProvisionCreatedOrder.mjs +9 -0
- package/dist/esm/api/types/ProvisionCreatedOrderLine.d.mts +17 -0
- package/dist/esm/api/types/ProvisionCreatedOrderLine.mjs +9 -0
- package/dist/esm/api/types/ProvisionCreditBenefit.d.mts +44 -0
- package/dist/esm/api/types/ProvisionCreditBenefit.mjs +23 -0
- package/dist/esm/api/types/ProvisionCustomer.d.mts +23 -0
- package/dist/esm/api/types/ProvisionCustomer.mjs +9 -0
- package/dist/esm/api/types/ProvisionExternalReference.d.mts +16 -0
- package/dist/esm/api/types/ProvisionExternalReference.mjs +11 -0
- package/dist/esm/api/types/ProvisionOrder.d.mts +39 -0
- package/dist/esm/api/types/ProvisionOrder.mjs +17 -0
- package/dist/esm/api/types/ProvisionOrderLine.d.mts +12 -0
- package/dist/esm/api/types/ProvisionOrderLine.mjs +2 -0
- package/dist/esm/api/types/ProvisionOrderLineAttribute.d.mts +96 -0
- package/dist/esm/api/types/ProvisionOrderLineAttribute.mjs +47 -0
- package/dist/esm/api/types/ProvisionOrderLineType.d.mts +7 -0
- package/dist/esm/api/types/ProvisionOrderLineType.mjs +7 -0
- package/dist/esm/api/types/ProvisionProduct.d.mts +95 -0
- package/dist/esm/api/types/ProvisionProduct.mjs +49 -0
- package/dist/esm/api/types/ProvisionResponse.d.mts +17 -0
- package/dist/esm/api/types/ProvisionResponse.mjs +9 -0
- package/dist/esm/api/types/RenderBundleEdit.d.mts +8 -0
- package/dist/esm/api/types/RenderBundleEdit.mjs +2 -0
- package/dist/esm/api/types/RotateWebhookSecretResponse.d.mts +4 -0
- package/dist/esm/api/types/RotateWebhookSecretResponse.mjs +2 -0
- package/dist/esm/api/types/SeatBasedPrepaidCreditsInput.d.mts +4 -0
- package/dist/esm/api/types/Signal.d.mts +9 -2
- package/dist/esm/api/types/SignalListItem.d.mts +20 -0
- package/dist/esm/api/types/SignalListItem.mjs +2 -0
- package/dist/esm/api/types/SignalListResponse.d.mts +5 -0
- package/dist/esm/api/types/SignalListResponse.mjs +2 -0
- package/dist/esm/api/types/SignalLookupResponse.d.mts +7 -0
- package/dist/esm/api/types/SignalLookupResponse.mjs +2 -0
- package/dist/esm/api/types/SignalSummaryBandsDimension.d.mts +21 -0
- package/dist/esm/api/types/SignalSummaryBandsDimension.mjs +2 -0
- package/dist/esm/api/types/SignalSummaryColumn.d.mts +8 -0
- package/dist/esm/api/types/SignalSummaryColumn.mjs +2 -0
- package/dist/esm/api/types/SignalSummaryDefinitionSpec.d.mts +21 -0
- package/dist/esm/api/types/SignalSummaryDefinitionSpec.mjs +8 -0
- package/dist/esm/api/types/SignalSummaryDefinitionSpecDimensionsItem.d.mts +10 -0
- package/dist/esm/api/types/SignalSummaryDefinitionSpecDimensionsItem.mjs +2 -0
- package/dist/esm/api/types/SignalSummaryExport.d.mts +36 -0
- package/dist/esm/api/types/SignalSummaryExport.mjs +15 -0
- package/dist/esm/api/types/SignalSummaryGroups.d.mts +9 -0
- package/dist/esm/api/types/SignalSummaryGroups.mjs +2 -0
- package/dist/esm/api/types/SignalSummaryMeasure.d.mts +16 -0
- package/dist/esm/api/types/SignalSummaryMeasure.mjs +11 -0
- package/dist/esm/api/types/SignalSummaryPage.d.mts +8 -0
- package/dist/esm/api/types/SignalSummaryPage.mjs +2 -0
- package/dist/esm/api/types/SignalSummaryPoint.d.mts +16 -0
- package/dist/esm/api/types/SignalSummaryPoint.mjs +2 -0
- package/dist/esm/api/types/SignalSummaryPresenceDimension.d.mts +23 -0
- package/dist/esm/api/types/SignalSummaryPresenceDimension.mjs +2 -0
- package/dist/esm/api/types/SignalSummaryResponse.d.mts +29 -0
- package/dist/esm/api/types/SignalSummaryResponse.mjs +16 -0
- package/dist/esm/api/types/SignalSummarySignalSelection.d.mts +8 -0
- package/dist/esm/api/types/SignalSummarySignalSelection.mjs +2 -0
- package/dist/esm/api/types/SignalSummarySpecInput.d.mts +21 -0
- package/dist/esm/api/types/SignalSummarySpecInput.mjs +8 -0
- package/dist/esm/api/types/SignalSummarySpecInputDimensionsItem.d.mts +10 -0
- package/dist/esm/api/types/SignalSummarySpecInputDimensionsItem.mjs +2 -0
- package/dist/esm/api/types/SignalsMetadataResponse.d.mts +49 -0
- package/dist/esm/api/types/SignalsMetadataResponse.mjs +24 -0
- package/dist/esm/api/types/StripeConnection.d.mts +7 -0
- package/dist/esm/api/types/StripeConnection.mjs +2 -0
- package/dist/esm/api/{resources/valueReceipts/client/requests → types}/SyncValueReceiptRequest.d.mts +0 -7
- package/dist/esm/api/types/SyncValueReceiptRequest.mjs +2 -0
- package/dist/esm/api/types/UnifiedAmendmentIntent.d.mts +25 -0
- package/dist/esm/api/types/UnifiedAmendmentIntent.mjs +2 -0
- package/dist/esm/api/types/UnifiedAmendmentResponse.d.mts +19 -0
- package/dist/esm/api/types/UnifiedAmendmentResponse.mjs +2 -0
- package/dist/esm/api/types/UpdateContactRequest.d.mts +1 -0
- package/dist/esm/api/types/UpdateCustomerRequest.d.mts +1 -1
- package/dist/esm/api/types/UpdateLineTermIntent.d.mts +18 -0
- package/dist/esm/api/types/UpdateLineTermIntent.mjs +11 -0
- package/dist/esm/api/types/UpdateOrderTermIntent.d.mts +18 -0
- package/dist/esm/api/types/UpdateOrderTermIntent.mjs +11 -0
- package/dist/esm/api/types/UpdatePlanRequest.d.mts +18 -0
- package/dist/esm/api/types/UpdatePlanRequest.mjs +9 -0
- package/dist/esm/api/types/UpdatePricingIntent.d.mts +22 -0
- package/dist/esm/api/types/UpdatePricingIntent.mjs +11 -0
- package/dist/esm/api/types/UpdateProductRequest.d.mts +2 -0
- package/dist/esm/api/types/UpdateQuantityIntent.d.mts +18 -0
- package/dist/esm/api/types/UpdateQuantityIntent.mjs +11 -0
- package/dist/esm/api/types/UsageAttributionAxisOptions.d.mts +23 -0
- package/dist/esm/api/types/UsageAttributionAxisOptions.mjs +2 -0
- package/dist/esm/api/types/UsageAttributionAxisValue.d.mts +6 -0
- package/dist/esm/api/types/UsageAttributionAxisValue.mjs +6 -0
- package/dist/esm/api/types/UsageBracketedPrepaidCreditsInput.d.mts +61 -0
- package/dist/esm/api/types/UsageBracketedPrepaidCreditsInput.mjs +26 -0
- package/dist/esm/api/types/UsageCostPlusInput.d.mts +8 -0
- package/dist/esm/api/types/UsageCostPlusInput.mjs +5 -0
- package/dist/esm/api/types/UsageGraduatedInput.d.mts +8 -0
- package/dist/esm/api/types/UsageGraduatedInput.mjs +5 -0
- package/dist/esm/api/types/UsagePerUnitInput.d.mts +8 -0
- package/dist/esm/api/types/UsagePerUnitInput.mjs +5 -0
- package/dist/esm/api/types/UsagePrepaidCreditsInput.d.mts +24 -0
- package/dist/esm/api/types/UsagePrepaidCreditsInput.mjs +11 -0
- package/dist/esm/api/types/UsageVolumeInput.d.mts +8 -0
- package/dist/esm/api/types/UsageVolumeInput.mjs +5 -0
- package/dist/esm/api/types/ValidateCustomViewRequest.d.mts +55 -0
- package/dist/esm/api/types/ValidateCustomViewRequest.mjs +23 -0
- package/dist/esm/api/types/ValidateCustomViewResponse.d.mts +7 -0
- package/dist/esm/api/types/ValidateCustomViewResponse.mjs +2 -0
- package/dist/esm/api/types/ValueMetricDetail.d.mts +47 -0
- package/dist/esm/api/types/ValueMetricDetail.mjs +2 -0
- package/dist/esm/api/types/ValueMetricFormula.d.mts +9 -0
- package/dist/esm/api/types/ValueMetricFormula.mjs +2 -0
- package/dist/esm/api/types/ValueMetricFormulaVariable.d.mts +31 -0
- package/dist/esm/api/types/ValueMetricFormulaVariable.mjs +21 -0
- package/dist/esm/api/types/ValueMetricListResponse.d.mts +5 -0
- package/dist/esm/api/types/ValueMetricListResponse.mjs +2 -0
- package/dist/esm/api/types/ValueMetricMonetaryConversion.d.mts +6 -0
- package/dist/esm/api/types/ValueMetricMonetaryConversion.mjs +2 -0
- package/dist/esm/api/types/ValueMetricSignalBinding.d.mts +14 -0
- package/dist/esm/api/types/ValueMetricSignalBinding.mjs +2 -0
- package/dist/esm/api/types/ValueMetricSummary.d.mts +30 -0
- package/dist/esm/api/types/ValueMetricSummary.mjs +2 -0
- package/dist/esm/api/types/ValueMetricUnit.d.mts +27 -0
- package/dist/esm/api/types/ValueMetricUnit.mjs +17 -0
- package/dist/esm/api/types/ValueMetricValidationResponse.d.mts +13 -0
- package/dist/esm/api/types/ValueMetricValidationResponse.mjs +2 -0
- package/dist/esm/api/types/ValueMetricVariableEdit.d.mts +26 -0
- package/dist/esm/api/types/ValueMetricVariableEdit.mjs +16 -0
- package/dist/esm/api/types/ValueMetricWriteAck.d.mts +6 -0
- package/dist/esm/api/types/ValueMetricWriteAck.mjs +2 -0
- package/dist/esm/api/types/ValueModelAuthoringGuide.d.mts +22 -0
- package/dist/esm/api/types/ValueModelAuthoringGuide.mjs +2 -0
- package/dist/esm/api/types/ValueModelContent.d.mts +359 -0
- package/dist/esm/api/types/ValueModelContent.mjs +145 -0
- package/dist/esm/api/types/ValueModelDetail.d.mts +12 -0
- package/dist/esm/api/types/ValueModelDetail.mjs +2 -0
- package/dist/esm/api/types/ValueModelSummary.d.mts +18 -0
- package/dist/esm/api/types/ValueModelSummary.mjs +9 -0
- package/dist/esm/api/types/ValueModelVersionListResponse.d.mts +5 -0
- package/dist/esm/api/types/ValueModelVersionListResponse.mjs +2 -0
- package/dist/esm/api/types/ValueReceiptDetail.d.mts +1 -0
- package/dist/esm/api/types/ValueReceiptSummary.d.mts +1 -0
- package/dist/esm/api/types/ValueReceiptSyncResponse.d.mts +2 -0
- package/dist/esm/api/types/ViewCustomerUnitsResponse.d.mts +7 -0
- package/dist/esm/api/types/ViewCustomerUnitsResponse.mjs +2 -0
- package/dist/esm/api/types/ViewDataResponse.d.mts +6 -0
- package/dist/esm/api/types/ViewDataResponse.mjs +2 -0
- package/dist/esm/api/types/Webhook.d.mts +2 -1
- package/dist/esm/api/types/Webhook.mjs +2 -1
- package/dist/esm/api/types/WebhookListResponse.d.mts +2 -0
- package/dist/esm/api/types/WebhookUpdateResponse.d.mts +27 -0
- package/dist/esm/api/types/WebhookUpdateResponse.mjs +16 -0
- package/dist/esm/api/types/WritableOrderLineType.d.mts +6 -0
- package/dist/esm/api/types/WritableOrderLineType.mjs +6 -0
- package/dist/esm/api/types/WritableProvisionOrderLineType.d.mts +6 -0
- package/dist/esm/api/types/WritableProvisionOrderLineType.mjs +6 -0
- package/dist/esm/api/types/index.d.mts +258 -1
- package/dist/esm/api/types/index.mjs +258 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +7975 -382
- /package/dist/cjs/api/resources/{valueReceipts/client/requests/SyncValueReceiptRequest.js → amendments/client/requests/GetOrderAmendmentOptionsRequest.js} +0 -0
- /package/dist/cjs/api/{types/CustomerBillingAddress.js → resources/analytics/client/requests/GetSignalsMetadataRequest.js} +0 -0
- /package/dist/esm/api/resources/{valueReceipts/client/requests/SyncValueReceiptRequest.mjs → amendments/client/requests/GetOrderAmendmentOptionsRequest.mjs} +0 -0
- /package/dist/esm/api/{types/CustomerBillingAddress.mjs → resources/analytics/client/requests/GetSignalsMetadataRequest.mjs} +0 -0
|
@@ -83,7 +83,7 @@ class Customers {
|
|
|
83
83
|
__listCustomers() {
|
|
84
84
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
85
85
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
86
|
-
const { limit, offset } = request;
|
|
86
|
+
const { limit, offset, name, status, creationState, createdAtFrom, createdAtTo, externalId } = request;
|
|
87
87
|
const _queryParams = {};
|
|
88
88
|
if (limit != null) {
|
|
89
89
|
_queryParams.limit = limit.toString();
|
|
@@ -91,6 +91,24 @@ class Customers {
|
|
|
91
91
|
if (offset != null) {
|
|
92
92
|
_queryParams.offset = offset.toString();
|
|
93
93
|
}
|
|
94
|
+
if (name != null) {
|
|
95
|
+
_queryParams.name = name;
|
|
96
|
+
}
|
|
97
|
+
if (status != null) {
|
|
98
|
+
_queryParams.status = status;
|
|
99
|
+
}
|
|
100
|
+
if (creationState != null) {
|
|
101
|
+
_queryParams.creationState = creationState;
|
|
102
|
+
}
|
|
103
|
+
if (createdAtFrom != null) {
|
|
104
|
+
_queryParams.createdAtFrom = createdAtFrom;
|
|
105
|
+
}
|
|
106
|
+
if (createdAtTo != null) {
|
|
107
|
+
_queryParams.createdAtTo = createdAtTo;
|
|
108
|
+
}
|
|
109
|
+
if (externalId != null) {
|
|
110
|
+
_queryParams.externalId = externalId;
|
|
111
|
+
}
|
|
94
112
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
95
113
|
const _response = yield core.fetcher({
|
|
96
114
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, "customers/"),
|
|
@@ -138,13 +156,14 @@ class Customers {
|
|
|
138
156
|
});
|
|
139
157
|
}
|
|
140
158
|
/**
|
|
141
|
-
* Creates a new customer for the organization
|
|
159
|
+
* Creates a new customer for the organization. `externalId` shares one set of ids with customer unit ids and aliases, unique across the organization and ignoring letter case: an external id that another customer already holds as a unit id or alias, or as its external id in another case, is refused with `409 EXTERNAL_ID_IN_USE`. The same id in the same case is `400 DUPLICATE_EXTERNAL_ID`, as before.
|
|
142
160
|
*
|
|
143
161
|
* @param {Paid.CreateCustomerRequest} request
|
|
144
162
|
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
145
163
|
*
|
|
146
164
|
* @throws {@link Paid.BadRequestError}
|
|
147
165
|
* @throws {@link Paid.ForbiddenError}
|
|
166
|
+
* @throws {@link Paid.ConflictError}
|
|
148
167
|
* @throws {@link Paid.InternalServerError}
|
|
149
168
|
*
|
|
150
169
|
* @example
|
|
@@ -180,6 +199,8 @@ class Customers {
|
|
|
180
199
|
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
181
200
|
case 403:
|
|
182
201
|
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
202
|
+
case 409:
|
|
203
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
183
204
|
case 500:
|
|
184
205
|
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
185
206
|
default:
|
|
@@ -208,33 +229,41 @@ class Customers {
|
|
|
208
229
|
});
|
|
209
230
|
}
|
|
210
231
|
/**
|
|
211
|
-
*
|
|
232
|
+
* List alternate external identifiers that resolve to a customer by Paid display ID.
|
|
212
233
|
*
|
|
213
|
-
* @param {Paid.
|
|
234
|
+
* @param {Paid.ListCustomerAliasesRequest} request
|
|
214
235
|
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
215
236
|
*
|
|
237
|
+
* @throws {@link Paid.BadRequestError}
|
|
216
238
|
* @throws {@link Paid.ForbiddenError}
|
|
217
239
|
* @throws {@link Paid.NotFoundError}
|
|
218
240
|
* @throws {@link Paid.InternalServerError}
|
|
219
241
|
*
|
|
220
242
|
* @example
|
|
221
|
-
* await client.customers.
|
|
222
|
-
* id: "
|
|
243
|
+
* await client.customers.listCustomerAliases({
|
|
244
|
+
* id: "cus_abc123"
|
|
223
245
|
* })
|
|
224
246
|
*/
|
|
225
|
-
|
|
226
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
247
|
+
listCustomerAliases(request, requestOptions) {
|
|
248
|
+
return core.HttpResponsePromise.fromPromise(this.__listCustomerAliases(request, requestOptions));
|
|
227
249
|
}
|
|
228
|
-
|
|
250
|
+
__listCustomerAliases(request, requestOptions) {
|
|
229
251
|
return __awaiter(this, void 0, void 0, function* () {
|
|
230
252
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
231
|
-
const { id } = request;
|
|
253
|
+
const { id, limit, offset } = request;
|
|
254
|
+
const _queryParams = {};
|
|
255
|
+
if (limit != null) {
|
|
256
|
+
_queryParams.limit = limit.toString();
|
|
257
|
+
}
|
|
258
|
+
if (offset != null) {
|
|
259
|
+
_queryParams.offset = offset.toString();
|
|
260
|
+
}
|
|
232
261
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
233
262
|
const _response = yield core.fetcher({
|
|
234
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}`),
|
|
263
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/aliases`),
|
|
235
264
|
method: "GET",
|
|
236
265
|
headers: _headers,
|
|
237
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
266
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
238
267
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
239
268
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
240
269
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -244,6 +273,8 @@ class Customers {
|
|
|
244
273
|
}
|
|
245
274
|
if (_response.error.reason === "status-code") {
|
|
246
275
|
switch (_response.error.statusCode) {
|
|
276
|
+
case 400:
|
|
277
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
247
278
|
case 403:
|
|
248
279
|
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
249
280
|
case 404:
|
|
@@ -266,7 +297,7 @@ class Customers {
|
|
|
266
297
|
rawResponse: _response.rawResponse,
|
|
267
298
|
});
|
|
268
299
|
case "timeout":
|
|
269
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}.");
|
|
300
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}/aliases.");
|
|
270
301
|
case "unknown":
|
|
271
302
|
throw new errors.PaidError({
|
|
272
303
|
message: _response.error.errorMessage,
|
|
@@ -276,33 +307,36 @@ class Customers {
|
|
|
276
307
|
});
|
|
277
308
|
}
|
|
278
309
|
/**
|
|
279
|
-
*
|
|
310
|
+
* Create an alternate external identifier for a customer by Paid display ID. The alias shares one set of ids with customer external ids and unit ids, unique within the organization and ignoring letter case: an alias that another customer already holds as its external id, a unit id or an alias is refused with `409 EXTERNAL_ID_IN_USE` (an exact match keeps its older code, `ALIAS_CONFLICTS_WITH_CUSTOMER_EXTERNAL_ID` or `CUSTOMER_ALIAS_ALREADY_EXISTS`).
|
|
280
311
|
*
|
|
281
|
-
* @param {Paid.
|
|
312
|
+
* @param {Paid.CreateCustomerAliasRequest} request
|
|
282
313
|
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
283
314
|
*
|
|
284
315
|
* @throws {@link Paid.BadRequestError}
|
|
285
316
|
* @throws {@link Paid.ForbiddenError}
|
|
286
317
|
* @throws {@link Paid.NotFoundError}
|
|
318
|
+
* @throws {@link Paid.ConflictError}
|
|
287
319
|
* @throws {@link Paid.InternalServerError}
|
|
288
320
|
*
|
|
289
321
|
* @example
|
|
290
|
-
* await client.customers.
|
|
291
|
-
* id: "
|
|
292
|
-
* body: {
|
|
322
|
+
* await client.customers.createCustomerAlias({
|
|
323
|
+
* id: "cus_abc123",
|
|
324
|
+
* body: {
|
|
325
|
+
* alias: "child-customer-1"
|
|
326
|
+
* }
|
|
293
327
|
* })
|
|
294
328
|
*/
|
|
295
|
-
|
|
296
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
329
|
+
createCustomerAlias(request, requestOptions) {
|
|
330
|
+
return core.HttpResponsePromise.fromPromise(this.__createCustomerAlias(request, requestOptions));
|
|
297
331
|
}
|
|
298
|
-
|
|
332
|
+
__createCustomerAlias(request, requestOptions) {
|
|
299
333
|
return __awaiter(this, void 0, void 0, function* () {
|
|
300
334
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
301
335
|
const { id, body: _body } = request;
|
|
302
336
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
303
337
|
const _response = yield core.fetcher({
|
|
304
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}`),
|
|
305
|
-
method: "
|
|
338
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/aliases`),
|
|
339
|
+
method: "POST",
|
|
306
340
|
headers: _headers,
|
|
307
341
|
contentType: "application/json",
|
|
308
342
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -323,6 +357,8 @@ class Customers {
|
|
|
323
357
|
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
324
358
|
case 404:
|
|
325
359
|
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
360
|
+
case 409:
|
|
361
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
326
362
|
case 500:
|
|
327
363
|
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
328
364
|
default:
|
|
@@ -341,7 +377,7 @@ class Customers {
|
|
|
341
377
|
rawResponse: _response.rawResponse,
|
|
342
378
|
});
|
|
343
379
|
case "timeout":
|
|
344
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling
|
|
380
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers/{id}/aliases.");
|
|
345
381
|
case "unknown":
|
|
346
382
|
throw new errors.PaidError({
|
|
347
383
|
message: _response.error.errorMessage,
|
|
@@ -351,31 +387,31 @@ class Customers {
|
|
|
351
387
|
});
|
|
352
388
|
}
|
|
353
389
|
/**
|
|
354
|
-
*
|
|
390
|
+
* Remove an alternate external identifier from a customer by Paid display ID.
|
|
355
391
|
*
|
|
356
|
-
* @param {Paid.
|
|
392
|
+
* @param {Paid.DeleteCustomerAliasRequest} request
|
|
357
393
|
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
358
394
|
*
|
|
359
|
-
* @throws {@link Paid.BadRequestError}
|
|
360
395
|
* @throws {@link Paid.ForbiddenError}
|
|
361
396
|
* @throws {@link Paid.NotFoundError}
|
|
362
397
|
* @throws {@link Paid.InternalServerError}
|
|
363
398
|
*
|
|
364
399
|
* @example
|
|
365
|
-
* await client.customers.
|
|
366
|
-
* id: "
|
|
400
|
+
* await client.customers.deleteCustomerAlias({
|
|
401
|
+
* id: "cus_abc123",
|
|
402
|
+
* alias: "child-customer-1"
|
|
367
403
|
* })
|
|
368
404
|
*/
|
|
369
|
-
|
|
370
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
405
|
+
deleteCustomerAlias(request, requestOptions) {
|
|
406
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCustomerAlias(request, requestOptions));
|
|
371
407
|
}
|
|
372
|
-
|
|
408
|
+
__deleteCustomerAlias(request, requestOptions) {
|
|
373
409
|
return __awaiter(this, void 0, void 0, function* () {
|
|
374
410
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
375
|
-
const { id } = request;
|
|
411
|
+
const { id, alias } = request;
|
|
376
412
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
377
413
|
const _response = yield core.fetcher({
|
|
378
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}`),
|
|
414
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/aliases/${core.url.encodePathParam(alias)}`),
|
|
379
415
|
method: "DELETE",
|
|
380
416
|
headers: _headers,
|
|
381
417
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -388,8 +424,6 @@ class Customers {
|
|
|
388
424
|
}
|
|
389
425
|
if (_response.error.reason === "status-code") {
|
|
390
426
|
switch (_response.error.statusCode) {
|
|
391
|
-
case 400:
|
|
392
|
-
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
393
427
|
case 403:
|
|
394
428
|
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
395
429
|
case 404:
|
|
@@ -412,7 +446,7 @@ class Customers {
|
|
|
412
446
|
rawResponse: _response.rawResponse,
|
|
413
447
|
});
|
|
414
448
|
case "timeout":
|
|
415
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/{id}.");
|
|
449
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/{id}/aliases/{alias}.");
|
|
416
450
|
case "unknown":
|
|
417
451
|
throw new errors.PaidError({
|
|
418
452
|
message: _response.error.errorMessage,
|
|
@@ -422,9 +456,9 @@ class Customers {
|
|
|
422
456
|
});
|
|
423
457
|
}
|
|
424
458
|
/**
|
|
425
|
-
* Get a customer by
|
|
459
|
+
* Get a customer by Paid display ID. Use the value returned as `customer.id`, for example `cus_abc123`. If you have your own customer ID, use `GET /api/v2/customers/external/{externalId}`.
|
|
426
460
|
*
|
|
427
|
-
* @param {Paid.
|
|
461
|
+
* @param {Paid.GetCustomerByIdRequest} request
|
|
428
462
|
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
429
463
|
*
|
|
430
464
|
* @throws {@link Paid.ForbiddenError}
|
|
@@ -432,20 +466,20 @@ class Customers {
|
|
|
432
466
|
* @throws {@link Paid.InternalServerError}
|
|
433
467
|
*
|
|
434
468
|
* @example
|
|
435
|
-
* await client.customers.
|
|
436
|
-
*
|
|
469
|
+
* await client.customers.getCustomerById({
|
|
470
|
+
* id: "cus_abc123"
|
|
437
471
|
* })
|
|
438
472
|
*/
|
|
439
|
-
|
|
440
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
473
|
+
getCustomerById(request, requestOptions) {
|
|
474
|
+
return core.HttpResponsePromise.fromPromise(this.__getCustomerById(request, requestOptions));
|
|
441
475
|
}
|
|
442
|
-
|
|
476
|
+
__getCustomerById(request, requestOptions) {
|
|
443
477
|
return __awaiter(this, void 0, void 0, function* () {
|
|
444
478
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
445
|
-
const {
|
|
479
|
+
const { id } = request;
|
|
446
480
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
447
481
|
const _response = yield core.fetcher({
|
|
448
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers
|
|
482
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}`),
|
|
449
483
|
method: "GET",
|
|
450
484
|
headers: _headers,
|
|
451
485
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -480,7 +514,7 @@ class Customers {
|
|
|
480
514
|
rawResponse: _response.rawResponse,
|
|
481
515
|
});
|
|
482
516
|
case "timeout":
|
|
483
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/
|
|
517
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}.");
|
|
484
518
|
case "unknown":
|
|
485
519
|
throw new errors.PaidError({
|
|
486
520
|
message: _response.error.errorMessage,
|
|
@@ -490,32 +524,33 @@ class Customers {
|
|
|
490
524
|
});
|
|
491
525
|
}
|
|
492
526
|
/**
|
|
493
|
-
* Update a customer by external
|
|
527
|
+
* Update a customer by Paid display ID. Use the value returned as `customer.id`, for example `cus_abc123`. If you have your own customer ID, use `PUT /api/v2/customers/external/{externalId}`. Changing `externalId` follows the organization-wide id rule: a new id that another customer already holds as its external id, a unit id or an alias, ignoring letter case, is refused with `409 EXTERNAL_ID_IN_USE`; the same id in the same case stays `400 DUPLICATE_EXTERNAL_ID`. When the id changes, the previous id is kept as an alias of the customer, so signals that still use it keep resolving to it.
|
|
494
528
|
*
|
|
495
|
-
* @param {Paid.
|
|
529
|
+
* @param {Paid.UpdateCustomerByIdRequest} request
|
|
496
530
|
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
497
531
|
*
|
|
498
532
|
* @throws {@link Paid.BadRequestError}
|
|
499
533
|
* @throws {@link Paid.ForbiddenError}
|
|
500
534
|
* @throws {@link Paid.NotFoundError}
|
|
535
|
+
* @throws {@link Paid.ConflictError}
|
|
501
536
|
* @throws {@link Paid.InternalServerError}
|
|
502
537
|
*
|
|
503
538
|
* @example
|
|
504
|
-
* await client.customers.
|
|
505
|
-
*
|
|
539
|
+
* await client.customers.updateCustomerById({
|
|
540
|
+
* id: "cus_abc123",
|
|
506
541
|
* body: {}
|
|
507
542
|
* })
|
|
508
543
|
*/
|
|
509
|
-
|
|
510
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
544
|
+
updateCustomerById(request, requestOptions) {
|
|
545
|
+
return core.HttpResponsePromise.fromPromise(this.__updateCustomerById(request, requestOptions));
|
|
511
546
|
}
|
|
512
|
-
|
|
547
|
+
__updateCustomerById(request, requestOptions) {
|
|
513
548
|
return __awaiter(this, void 0, void 0, function* () {
|
|
514
549
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
515
|
-
const {
|
|
550
|
+
const { id, body: _body } = request;
|
|
516
551
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
517
552
|
const _response = yield core.fetcher({
|
|
518
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers
|
|
553
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}`),
|
|
519
554
|
method: "PUT",
|
|
520
555
|
headers: _headers,
|
|
521
556
|
contentType: "application/json",
|
|
@@ -537,6 +572,8 @@ class Customers {
|
|
|
537
572
|
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
538
573
|
case 404:
|
|
539
574
|
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
575
|
+
case 409:
|
|
576
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
540
577
|
case 500:
|
|
541
578
|
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
542
579
|
default:
|
|
@@ -555,7 +592,7 @@ class Customers {
|
|
|
555
592
|
rawResponse: _response.rawResponse,
|
|
556
593
|
});
|
|
557
594
|
case "timeout":
|
|
558
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /customers/
|
|
595
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /customers/{id}.");
|
|
559
596
|
case "unknown":
|
|
560
597
|
throw new errors.PaidError({
|
|
561
598
|
message: _response.error.errorMessage,
|
|
@@ -565,31 +602,32 @@ class Customers {
|
|
|
565
602
|
});
|
|
566
603
|
}
|
|
567
604
|
/**
|
|
568
|
-
* Delete a customer by external
|
|
605
|
+
* Delete a customer by Paid display ID. Use the value returned as `customer.id`, for example `cus_abc123`. If you have your own customer ID, use `DELETE /api/v2/customers/external/{externalId}`. A customer that still has orders, invoices, payments, contacts, child customers or other linked records is not deleted: the request returns 409 `CUSTOMER_HAS_ASSOCIATIONS` and `details` lists what is linked.
|
|
569
606
|
*
|
|
570
|
-
* @param {Paid.
|
|
607
|
+
* @param {Paid.DeleteCustomerByIdRequest} request
|
|
571
608
|
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
572
609
|
*
|
|
573
610
|
* @throws {@link Paid.BadRequestError}
|
|
574
611
|
* @throws {@link Paid.ForbiddenError}
|
|
575
612
|
* @throws {@link Paid.NotFoundError}
|
|
613
|
+
* @throws {@link Paid.ConflictError}
|
|
576
614
|
* @throws {@link Paid.InternalServerError}
|
|
577
615
|
*
|
|
578
616
|
* @example
|
|
579
|
-
* await client.customers.
|
|
580
|
-
*
|
|
617
|
+
* await client.customers.deleteCustomerById({
|
|
618
|
+
* id: "cus_abc123"
|
|
581
619
|
* })
|
|
582
620
|
*/
|
|
583
|
-
|
|
584
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
621
|
+
deleteCustomerById(request, requestOptions) {
|
|
622
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCustomerById(request, requestOptions));
|
|
585
623
|
}
|
|
586
|
-
|
|
624
|
+
__deleteCustomerById(request, requestOptions) {
|
|
587
625
|
return __awaiter(this, void 0, void 0, function* () {
|
|
588
626
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
589
|
-
const {
|
|
627
|
+
const { id } = request;
|
|
590
628
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
591
629
|
const _response = yield core.fetcher({
|
|
592
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers
|
|
630
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}`),
|
|
593
631
|
method: "DELETE",
|
|
594
632
|
headers: _headers,
|
|
595
633
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -608,6 +646,8 @@ class Customers {
|
|
|
608
646
|
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
609
647
|
case 404:
|
|
610
648
|
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
649
|
+
case 409:
|
|
650
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
611
651
|
case 500:
|
|
612
652
|
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
613
653
|
default:
|
|
@@ -626,7 +666,7 @@ class Customers {
|
|
|
626
666
|
rawResponse: _response.rawResponse,
|
|
627
667
|
});
|
|
628
668
|
case "timeout":
|
|
629
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/
|
|
669
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/{id}.");
|
|
630
670
|
case "unknown":
|
|
631
671
|
throw new errors.PaidError({
|
|
632
672
|
message: _response.error.errorMessage,
|
|
@@ -636,9 +676,9 @@ class Customers {
|
|
|
636
676
|
});
|
|
637
677
|
}
|
|
638
678
|
/**
|
|
639
|
-
* Get current customer
|
|
679
|
+
* Get the current customer state by Paid display ID
|
|
640
680
|
*
|
|
641
|
-
* @param {Paid.
|
|
681
|
+
* @param {Paid.GetCustomerStateByIdRequest} request
|
|
642
682
|
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
643
683
|
*
|
|
644
684
|
* @throws {@link Paid.ForbiddenError}
|
|
@@ -646,20 +686,20 @@ class Customers {
|
|
|
646
686
|
* @throws {@link Paid.InternalServerError}
|
|
647
687
|
*
|
|
648
688
|
* @example
|
|
649
|
-
* await client.customers.
|
|
650
|
-
* id: "
|
|
689
|
+
* await client.customers.getCustomerStateById({
|
|
690
|
+
* id: "cus_abc123"
|
|
651
691
|
* })
|
|
652
692
|
*/
|
|
653
|
-
|
|
654
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
693
|
+
getCustomerStateById(request, requestOptions) {
|
|
694
|
+
return core.HttpResponsePromise.fromPromise(this.__getCustomerStateById(request, requestOptions));
|
|
655
695
|
}
|
|
656
|
-
|
|
696
|
+
__getCustomerStateById(request, requestOptions) {
|
|
657
697
|
return __awaiter(this, void 0, void 0, function* () {
|
|
658
698
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
659
699
|
const { id } = request;
|
|
660
700
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
661
701
|
const _response = yield core.fetcher({
|
|
662
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/
|
|
702
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/state`),
|
|
663
703
|
method: "GET",
|
|
664
704
|
headers: _headers,
|
|
665
705
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -694,7 +734,7 @@ class Customers {
|
|
|
694
734
|
rawResponse: _response.rawResponse,
|
|
695
735
|
});
|
|
696
736
|
case "timeout":
|
|
697
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}/
|
|
737
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}/state.");
|
|
698
738
|
case "unknown":
|
|
699
739
|
throw new errors.PaidError({
|
|
700
740
|
message: _response.error.errorMessage,
|
|
@@ -704,33 +744,41 @@ class Customers {
|
|
|
704
744
|
});
|
|
705
745
|
}
|
|
706
746
|
/**
|
|
707
|
-
*
|
|
747
|
+
* List alternate external identifiers that resolve to a customer by external ID.
|
|
708
748
|
*
|
|
709
|
-
* @param {Paid.
|
|
749
|
+
* @param {Paid.ListCustomerAliasesByExternalIdRequest} request
|
|
710
750
|
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
711
751
|
*
|
|
752
|
+
* @throws {@link Paid.BadRequestError}
|
|
712
753
|
* @throws {@link Paid.ForbiddenError}
|
|
713
754
|
* @throws {@link Paid.NotFoundError}
|
|
714
755
|
* @throws {@link Paid.InternalServerError}
|
|
715
756
|
*
|
|
716
757
|
* @example
|
|
717
|
-
* await client.customers.
|
|
718
|
-
* externalId: "
|
|
758
|
+
* await client.customers.listCustomerAliasesByExternalId({
|
|
759
|
+
* externalId: "customer_123"
|
|
719
760
|
* })
|
|
720
761
|
*/
|
|
721
|
-
|
|
722
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
762
|
+
listCustomerAliasesByExternalId(request, requestOptions) {
|
|
763
|
+
return core.HttpResponsePromise.fromPromise(this.__listCustomerAliasesByExternalId(request, requestOptions));
|
|
723
764
|
}
|
|
724
|
-
|
|
765
|
+
__listCustomerAliasesByExternalId(request, requestOptions) {
|
|
725
766
|
return __awaiter(this, void 0, void 0, function* () {
|
|
726
767
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
727
|
-
const { externalId } = request;
|
|
768
|
+
const { externalId, limit, offset } = request;
|
|
769
|
+
const _queryParams = {};
|
|
770
|
+
if (limit != null) {
|
|
771
|
+
_queryParams.limit = limit.toString();
|
|
772
|
+
}
|
|
773
|
+
if (offset != null) {
|
|
774
|
+
_queryParams.offset = offset.toString();
|
|
775
|
+
}
|
|
728
776
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
729
777
|
const _response = yield core.fetcher({
|
|
730
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/
|
|
778
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/aliases`),
|
|
731
779
|
method: "GET",
|
|
732
780
|
headers: _headers,
|
|
733
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
781
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
734
782
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
735
783
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
736
784
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -740,6 +788,8 @@ class Customers {
|
|
|
740
788
|
}
|
|
741
789
|
if (_response.error.reason === "status-code") {
|
|
742
790
|
switch (_response.error.statusCode) {
|
|
791
|
+
case 400:
|
|
792
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
743
793
|
case 403:
|
|
744
794
|
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
745
795
|
case 404:
|
|
@@ -762,7 +812,7 @@ class Customers {
|
|
|
762
812
|
rawResponse: _response.rawResponse,
|
|
763
813
|
});
|
|
764
814
|
case "timeout":
|
|
765
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}/
|
|
815
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}/aliases.");
|
|
766
816
|
case "unknown":
|
|
767
817
|
throw new errors.PaidError({
|
|
768
818
|
message: _response.error.errorMessage,
|
|
@@ -772,33 +822,36 @@ class Customers {
|
|
|
772
822
|
});
|
|
773
823
|
}
|
|
774
824
|
/**
|
|
775
|
-
* Create
|
|
825
|
+
* Create an alternate external identifier for a customer by external ID. The alias shares one set of ids with customer external ids and unit ids, unique within the organization and ignoring letter case: an alias that another customer already holds as its external id, a unit id or an alias is refused with `409 EXTERNAL_ID_IN_USE` (an exact match keeps its older code, `ALIAS_CONFLICTS_WITH_CUSTOMER_EXTERNAL_ID` or `CUSTOMER_ALIAS_ALREADY_EXISTS`).
|
|
776
826
|
*
|
|
777
|
-
* @param {Paid.
|
|
827
|
+
* @param {Paid.CreateCustomerAliasByExternalIdRequest} request
|
|
778
828
|
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
779
829
|
*
|
|
780
830
|
* @throws {@link Paid.BadRequestError}
|
|
781
831
|
* @throws {@link Paid.ForbiddenError}
|
|
782
832
|
* @throws {@link Paid.NotFoundError}
|
|
833
|
+
* @throws {@link Paid.ConflictError}
|
|
783
834
|
* @throws {@link Paid.InternalServerError}
|
|
784
835
|
*
|
|
785
836
|
* @example
|
|
786
|
-
* await client.customers.
|
|
787
|
-
*
|
|
788
|
-
*
|
|
837
|
+
* await client.customers.createCustomerAliasByExternalId({
|
|
838
|
+
* externalId: "customer_123",
|
|
839
|
+
* body: {
|
|
840
|
+
* alias: "child-customer-1"
|
|
841
|
+
* }
|
|
789
842
|
* })
|
|
790
843
|
*/
|
|
791
|
-
|
|
792
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
844
|
+
createCustomerAliasByExternalId(request, requestOptions) {
|
|
845
|
+
return core.HttpResponsePromise.fromPromise(this.__createCustomerAliasByExternalId(request, requestOptions));
|
|
793
846
|
}
|
|
794
|
-
|
|
847
|
+
__createCustomerAliasByExternalId(request, requestOptions) {
|
|
795
848
|
return __awaiter(this, void 0, void 0, function* () {
|
|
796
849
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
797
|
-
const {
|
|
850
|
+
const { externalId, body: _body } = request;
|
|
798
851
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
799
852
|
const _response = yield core.fetcher({
|
|
800
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(
|
|
801
|
-
method: "
|
|
853
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/aliases`),
|
|
854
|
+
method: "POST",
|
|
802
855
|
headers: _headers,
|
|
803
856
|
contentType: "application/json",
|
|
804
857
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -819,6 +872,8 @@ class Customers {
|
|
|
819
872
|
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
820
873
|
case 404:
|
|
821
874
|
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
875
|
+
case 409:
|
|
876
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
822
877
|
case 500:
|
|
823
878
|
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
824
879
|
default:
|
|
@@ -837,7 +892,3957 @@ class Customers {
|
|
|
837
892
|
rawResponse: _response.rawResponse,
|
|
838
893
|
});
|
|
839
894
|
case "timeout":
|
|
840
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling
|
|
895
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers/external/{externalId}/aliases.");
|
|
896
|
+
case "unknown":
|
|
897
|
+
throw new errors.PaidError({
|
|
898
|
+
message: _response.error.errorMessage,
|
|
899
|
+
rawResponse: _response.rawResponse,
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
/**
|
|
905
|
+
* Remove an alternate external identifier from a customer by external ID.
|
|
906
|
+
*
|
|
907
|
+
* @param {Paid.DeleteCustomerAliasByExternalIdRequest} request
|
|
908
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
909
|
+
*
|
|
910
|
+
* @throws {@link Paid.ForbiddenError}
|
|
911
|
+
* @throws {@link Paid.NotFoundError}
|
|
912
|
+
* @throws {@link Paid.InternalServerError}
|
|
913
|
+
*
|
|
914
|
+
* @example
|
|
915
|
+
* await client.customers.deleteCustomerAliasByExternalId({
|
|
916
|
+
* externalId: "customer_123",
|
|
917
|
+
* alias: "child-customer-1"
|
|
918
|
+
* })
|
|
919
|
+
*/
|
|
920
|
+
deleteCustomerAliasByExternalId(request, requestOptions) {
|
|
921
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCustomerAliasByExternalId(request, requestOptions));
|
|
922
|
+
}
|
|
923
|
+
__deleteCustomerAliasByExternalId(request, requestOptions) {
|
|
924
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
925
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
926
|
+
const { externalId, alias } = request;
|
|
927
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
928
|
+
const _response = yield core.fetcher({
|
|
929
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/aliases/${core.url.encodePathParam(alias)}`),
|
|
930
|
+
method: "DELETE",
|
|
931
|
+
headers: _headers,
|
|
932
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
933
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
934
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
935
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
936
|
+
});
|
|
937
|
+
if (_response.ok) {
|
|
938
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
939
|
+
}
|
|
940
|
+
if (_response.error.reason === "status-code") {
|
|
941
|
+
switch (_response.error.statusCode) {
|
|
942
|
+
case 403:
|
|
943
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
944
|
+
case 404:
|
|
945
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
946
|
+
case 500:
|
|
947
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
948
|
+
default:
|
|
949
|
+
throw new errors.PaidError({
|
|
950
|
+
statusCode: _response.error.statusCode,
|
|
951
|
+
body: _response.error.body,
|
|
952
|
+
rawResponse: _response.rawResponse,
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
switch (_response.error.reason) {
|
|
957
|
+
case "non-json":
|
|
958
|
+
throw new errors.PaidError({
|
|
959
|
+
statusCode: _response.error.statusCode,
|
|
960
|
+
body: _response.error.rawBody,
|
|
961
|
+
rawResponse: _response.rawResponse,
|
|
962
|
+
});
|
|
963
|
+
case "timeout":
|
|
964
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/external/{externalId}/aliases/{alias}.");
|
|
965
|
+
case "unknown":
|
|
966
|
+
throw new errors.PaidError({
|
|
967
|
+
message: _response.error.errorMessage,
|
|
968
|
+
rawResponse: _response.rawResponse,
|
|
969
|
+
});
|
|
970
|
+
}
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
/**
|
|
974
|
+
* Get a customer by external ID
|
|
975
|
+
*
|
|
976
|
+
* @param {Paid.GetCustomerByExternalIdRequest} request
|
|
977
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
978
|
+
*
|
|
979
|
+
* @throws {@link Paid.ForbiddenError}
|
|
980
|
+
* @throws {@link Paid.NotFoundError}
|
|
981
|
+
* @throws {@link Paid.InternalServerError}
|
|
982
|
+
*
|
|
983
|
+
* @example
|
|
984
|
+
* await client.customers.getCustomerByExternalId({
|
|
985
|
+
* externalId: "customer_123"
|
|
986
|
+
* })
|
|
987
|
+
*/
|
|
988
|
+
getCustomerByExternalId(request, requestOptions) {
|
|
989
|
+
return core.HttpResponsePromise.fromPromise(this.__getCustomerByExternalId(request, requestOptions));
|
|
990
|
+
}
|
|
991
|
+
__getCustomerByExternalId(request, requestOptions) {
|
|
992
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
993
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
994
|
+
const { externalId } = request;
|
|
995
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
996
|
+
const _response = yield core.fetcher({
|
|
997
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}`),
|
|
998
|
+
method: "GET",
|
|
999
|
+
headers: _headers,
|
|
1000
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1001
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
1002
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
1003
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1004
|
+
});
|
|
1005
|
+
if (_response.ok) {
|
|
1006
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1007
|
+
}
|
|
1008
|
+
if (_response.error.reason === "status-code") {
|
|
1009
|
+
switch (_response.error.statusCode) {
|
|
1010
|
+
case 403:
|
|
1011
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1012
|
+
case 404:
|
|
1013
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1014
|
+
case 500:
|
|
1015
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1016
|
+
default:
|
|
1017
|
+
throw new errors.PaidError({
|
|
1018
|
+
statusCode: _response.error.statusCode,
|
|
1019
|
+
body: _response.error.body,
|
|
1020
|
+
rawResponse: _response.rawResponse,
|
|
1021
|
+
});
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
switch (_response.error.reason) {
|
|
1025
|
+
case "non-json":
|
|
1026
|
+
throw new errors.PaidError({
|
|
1027
|
+
statusCode: _response.error.statusCode,
|
|
1028
|
+
body: _response.error.rawBody,
|
|
1029
|
+
rawResponse: _response.rawResponse,
|
|
1030
|
+
});
|
|
1031
|
+
case "timeout":
|
|
1032
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}.");
|
|
1033
|
+
case "unknown":
|
|
1034
|
+
throw new errors.PaidError({
|
|
1035
|
+
message: _response.error.errorMessage,
|
|
1036
|
+
rawResponse: _response.rawResponse,
|
|
1037
|
+
});
|
|
1038
|
+
}
|
|
1039
|
+
});
|
|
1040
|
+
}
|
|
1041
|
+
/**
|
|
1042
|
+
* Update a customer by external ID. Changing `externalId` follows the organization-wide id rule: a new id that another customer already holds as its external id, a unit id or an alias, ignoring letter case, is refused with `409 EXTERNAL_ID_IN_USE`; the same id in the same case stays `400 DUPLICATE_EXTERNAL_ID`. When the id changes, the previous id is kept as an alias of the customer, so signals that still use it keep resolving to it.
|
|
1043
|
+
*
|
|
1044
|
+
* @param {Paid.UpdateCustomerByExternalIdRequest} request
|
|
1045
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
1046
|
+
*
|
|
1047
|
+
* @throws {@link Paid.BadRequestError}
|
|
1048
|
+
* @throws {@link Paid.ForbiddenError}
|
|
1049
|
+
* @throws {@link Paid.NotFoundError}
|
|
1050
|
+
* @throws {@link Paid.ConflictError}
|
|
1051
|
+
* @throws {@link Paid.InternalServerError}
|
|
1052
|
+
*
|
|
1053
|
+
* @example
|
|
1054
|
+
* await client.customers.updateCustomerByExternalId({
|
|
1055
|
+
* externalId: "customer_123",
|
|
1056
|
+
* body: {}
|
|
1057
|
+
* })
|
|
1058
|
+
*/
|
|
1059
|
+
updateCustomerByExternalId(request, requestOptions) {
|
|
1060
|
+
return core.HttpResponsePromise.fromPromise(this.__updateCustomerByExternalId(request, requestOptions));
|
|
1061
|
+
}
|
|
1062
|
+
__updateCustomerByExternalId(request, requestOptions) {
|
|
1063
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1064
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1065
|
+
const { externalId, body: _body } = request;
|
|
1066
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1067
|
+
const _response = yield core.fetcher({
|
|
1068
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}`),
|
|
1069
|
+
method: "PUT",
|
|
1070
|
+
headers: _headers,
|
|
1071
|
+
contentType: "application/json",
|
|
1072
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1073
|
+
requestType: "json",
|
|
1074
|
+
body: _body,
|
|
1075
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
1076
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
1077
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1078
|
+
});
|
|
1079
|
+
if (_response.ok) {
|
|
1080
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1081
|
+
}
|
|
1082
|
+
if (_response.error.reason === "status-code") {
|
|
1083
|
+
switch (_response.error.statusCode) {
|
|
1084
|
+
case 400:
|
|
1085
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
1086
|
+
case 403:
|
|
1087
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1088
|
+
case 404:
|
|
1089
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1090
|
+
case 409:
|
|
1091
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
1092
|
+
case 500:
|
|
1093
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1094
|
+
default:
|
|
1095
|
+
throw new errors.PaidError({
|
|
1096
|
+
statusCode: _response.error.statusCode,
|
|
1097
|
+
body: _response.error.body,
|
|
1098
|
+
rawResponse: _response.rawResponse,
|
|
1099
|
+
});
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
switch (_response.error.reason) {
|
|
1103
|
+
case "non-json":
|
|
1104
|
+
throw new errors.PaidError({
|
|
1105
|
+
statusCode: _response.error.statusCode,
|
|
1106
|
+
body: _response.error.rawBody,
|
|
1107
|
+
rawResponse: _response.rawResponse,
|
|
1108
|
+
});
|
|
1109
|
+
case "timeout":
|
|
1110
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /customers/external/{externalId}.");
|
|
1111
|
+
case "unknown":
|
|
1112
|
+
throw new errors.PaidError({
|
|
1113
|
+
message: _response.error.errorMessage,
|
|
1114
|
+
rawResponse: _response.rawResponse,
|
|
1115
|
+
});
|
|
1116
|
+
}
|
|
1117
|
+
});
|
|
1118
|
+
}
|
|
1119
|
+
/**
|
|
1120
|
+
* Delete a customer by external ID. A customer that still has orders, invoices, payments, contacts, child customers or other linked records is not deleted: the request returns 409 `CUSTOMER_HAS_ASSOCIATIONS` and `details` lists what is linked.
|
|
1121
|
+
*
|
|
1122
|
+
* @param {Paid.DeleteCustomerByExternalIdRequest} request
|
|
1123
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
1124
|
+
*
|
|
1125
|
+
* @throws {@link Paid.BadRequestError}
|
|
1126
|
+
* @throws {@link Paid.ForbiddenError}
|
|
1127
|
+
* @throws {@link Paid.NotFoundError}
|
|
1128
|
+
* @throws {@link Paid.ConflictError}
|
|
1129
|
+
* @throws {@link Paid.InternalServerError}
|
|
1130
|
+
*
|
|
1131
|
+
* @example
|
|
1132
|
+
* await client.customers.deleteCustomerByExternalId({
|
|
1133
|
+
* externalId: "customer_123"
|
|
1134
|
+
* })
|
|
1135
|
+
*/
|
|
1136
|
+
deleteCustomerByExternalId(request, requestOptions) {
|
|
1137
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCustomerByExternalId(request, requestOptions));
|
|
1138
|
+
}
|
|
1139
|
+
__deleteCustomerByExternalId(request, requestOptions) {
|
|
1140
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1141
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1142
|
+
const { externalId } = request;
|
|
1143
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1144
|
+
const _response = yield core.fetcher({
|
|
1145
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}`),
|
|
1146
|
+
method: "DELETE",
|
|
1147
|
+
headers: _headers,
|
|
1148
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1149
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
1150
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
1151
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1152
|
+
});
|
|
1153
|
+
if (_response.ok) {
|
|
1154
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1155
|
+
}
|
|
1156
|
+
if (_response.error.reason === "status-code") {
|
|
1157
|
+
switch (_response.error.statusCode) {
|
|
1158
|
+
case 400:
|
|
1159
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
1160
|
+
case 403:
|
|
1161
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1162
|
+
case 404:
|
|
1163
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1164
|
+
case 409:
|
|
1165
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
1166
|
+
case 500:
|
|
1167
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1168
|
+
default:
|
|
1169
|
+
throw new errors.PaidError({
|
|
1170
|
+
statusCode: _response.error.statusCode,
|
|
1171
|
+
body: _response.error.body,
|
|
1172
|
+
rawResponse: _response.rawResponse,
|
|
1173
|
+
});
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
switch (_response.error.reason) {
|
|
1177
|
+
case "non-json":
|
|
1178
|
+
throw new errors.PaidError({
|
|
1179
|
+
statusCode: _response.error.statusCode,
|
|
1180
|
+
body: _response.error.rawBody,
|
|
1181
|
+
rawResponse: _response.rawResponse,
|
|
1182
|
+
});
|
|
1183
|
+
case "timeout":
|
|
1184
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/external/{externalId}.");
|
|
1185
|
+
case "unknown":
|
|
1186
|
+
throw new errors.PaidError({
|
|
1187
|
+
message: _response.error.errorMessage,
|
|
1188
|
+
rawResponse: _response.rawResponse,
|
|
1189
|
+
});
|
|
1190
|
+
}
|
|
1191
|
+
});
|
|
1192
|
+
}
|
|
1193
|
+
/**
|
|
1194
|
+
* Primary integration endpoint for agents and programmatic clients using their own customer IDs. Use the value you stored on `customer.externalId`, for example `customer_123`.
|
|
1195
|
+
*
|
|
1196
|
+
* @param {Paid.GetCustomerStateByExternalIdRequest} request
|
|
1197
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
1198
|
+
*
|
|
1199
|
+
* @throws {@link Paid.ForbiddenError}
|
|
1200
|
+
* @throws {@link Paid.NotFoundError}
|
|
1201
|
+
* @throws {@link Paid.InternalServerError}
|
|
1202
|
+
*
|
|
1203
|
+
* @example
|
|
1204
|
+
* await client.customers.getCustomerStateByExternalId({
|
|
1205
|
+
* externalId: "customer_123"
|
|
1206
|
+
* })
|
|
1207
|
+
*/
|
|
1208
|
+
getCustomerStateByExternalId(request, requestOptions) {
|
|
1209
|
+
return core.HttpResponsePromise.fromPromise(this.__getCustomerStateByExternalId(request, requestOptions));
|
|
1210
|
+
}
|
|
1211
|
+
__getCustomerStateByExternalId(request, requestOptions) {
|
|
1212
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1213
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1214
|
+
const { externalId } = request;
|
|
1215
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1216
|
+
const _response = yield core.fetcher({
|
|
1217
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/state`),
|
|
1218
|
+
method: "GET",
|
|
1219
|
+
headers: _headers,
|
|
1220
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1221
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
1222
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
1223
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1224
|
+
});
|
|
1225
|
+
if (_response.ok) {
|
|
1226
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1227
|
+
}
|
|
1228
|
+
if (_response.error.reason === "status-code") {
|
|
1229
|
+
switch (_response.error.statusCode) {
|
|
1230
|
+
case 403:
|
|
1231
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1232
|
+
case 404:
|
|
1233
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1234
|
+
case 500:
|
|
1235
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1236
|
+
default:
|
|
1237
|
+
throw new errors.PaidError({
|
|
1238
|
+
statusCode: _response.error.statusCode,
|
|
1239
|
+
body: _response.error.body,
|
|
1240
|
+
rawResponse: _response.rawResponse,
|
|
1241
|
+
});
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
switch (_response.error.reason) {
|
|
1245
|
+
case "non-json":
|
|
1246
|
+
throw new errors.PaidError({
|
|
1247
|
+
statusCode: _response.error.statusCode,
|
|
1248
|
+
body: _response.error.rawBody,
|
|
1249
|
+
rawResponse: _response.rawResponse,
|
|
1250
|
+
});
|
|
1251
|
+
case "timeout":
|
|
1252
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}/state.");
|
|
1253
|
+
case "unknown":
|
|
1254
|
+
throw new errors.PaidError({
|
|
1255
|
+
message: _response.error.errorMessage,
|
|
1256
|
+
rawResponse: _response.rawResponse,
|
|
1257
|
+
});
|
|
1258
|
+
}
|
|
1259
|
+
});
|
|
1260
|
+
}
|
|
1261
|
+
/**
|
|
1262
|
+
* Get current customer credit balances grouped by currency for a Paid customer display ID. Use the value returned as `customer.id`, for example `cus_abc123`. If you have your own customer ID, use `/api/v2/customers/external/{externalId}/credits/balances`.
|
|
1263
|
+
*
|
|
1264
|
+
* @param {Paid.GetCustomerCreditBalancesRequest} request
|
|
1265
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
1266
|
+
*
|
|
1267
|
+
* @throws {@link Paid.ForbiddenError}
|
|
1268
|
+
* @throws {@link Paid.NotFoundError}
|
|
1269
|
+
* @throws {@link Paid.InternalServerError}
|
|
1270
|
+
*
|
|
1271
|
+
* @example
|
|
1272
|
+
* await client.customers.getCustomerCreditBalances({
|
|
1273
|
+
* id: "cus_abc123"
|
|
1274
|
+
* })
|
|
1275
|
+
*/
|
|
1276
|
+
getCustomerCreditBalances(request, requestOptions) {
|
|
1277
|
+
return core.HttpResponsePromise.fromPromise(this.__getCustomerCreditBalances(request, requestOptions));
|
|
1278
|
+
}
|
|
1279
|
+
__getCustomerCreditBalances(request, requestOptions) {
|
|
1280
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1281
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1282
|
+
const { id } = request;
|
|
1283
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1284
|
+
const _response = yield core.fetcher({
|
|
1285
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/credits/balances`),
|
|
1286
|
+
method: "GET",
|
|
1287
|
+
headers: _headers,
|
|
1288
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1289
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
1290
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
1291
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1292
|
+
});
|
|
1293
|
+
if (_response.ok) {
|
|
1294
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1295
|
+
}
|
|
1296
|
+
if (_response.error.reason === "status-code") {
|
|
1297
|
+
switch (_response.error.statusCode) {
|
|
1298
|
+
case 403:
|
|
1299
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1300
|
+
case 404:
|
|
1301
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1302
|
+
case 500:
|
|
1303
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1304
|
+
default:
|
|
1305
|
+
throw new errors.PaidError({
|
|
1306
|
+
statusCode: _response.error.statusCode,
|
|
1307
|
+
body: _response.error.body,
|
|
1308
|
+
rawResponse: _response.rawResponse,
|
|
1309
|
+
});
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
switch (_response.error.reason) {
|
|
1313
|
+
case "non-json":
|
|
1314
|
+
throw new errors.PaidError({
|
|
1315
|
+
statusCode: _response.error.statusCode,
|
|
1316
|
+
body: _response.error.rawBody,
|
|
1317
|
+
rawResponse: _response.rawResponse,
|
|
1318
|
+
});
|
|
1319
|
+
case "timeout":
|
|
1320
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}/credits/balances.");
|
|
1321
|
+
case "unknown":
|
|
1322
|
+
throw new errors.PaidError({
|
|
1323
|
+
message: _response.error.errorMessage,
|
|
1324
|
+
rawResponse: _response.rawResponse,
|
|
1325
|
+
});
|
|
1326
|
+
}
|
|
1327
|
+
});
|
|
1328
|
+
}
|
|
1329
|
+
/**
|
|
1330
|
+
* Immediately grant credits to a customer using an active credit currency key.
|
|
1331
|
+
*
|
|
1332
|
+
* @param {Paid.GrantCustomerCreditsRequest} request
|
|
1333
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
1334
|
+
*
|
|
1335
|
+
* @throws {@link Paid.BadRequestError}
|
|
1336
|
+
* @throws {@link Paid.ForbiddenError}
|
|
1337
|
+
* @throws {@link Paid.NotFoundError}
|
|
1338
|
+
* @throws {@link Paid.ConflictError}
|
|
1339
|
+
* @throws {@link Paid.InternalServerError}
|
|
1340
|
+
*
|
|
1341
|
+
* @example
|
|
1342
|
+
* await client.customers.grantCustomerCredits({
|
|
1343
|
+
* id: "cus_abc123",
|
|
1344
|
+
* body: {
|
|
1345
|
+
* creditCurrencyKey: "api_credits",
|
|
1346
|
+
* amount: 10000,
|
|
1347
|
+
* startsAt: "2026-06-05T12:00:00Z",
|
|
1348
|
+
* expiresAt: "2026-12-31T23:59:59Z",
|
|
1349
|
+
* idempotencyKey: "grant_acme_2026-06-05"
|
|
1350
|
+
* }
|
|
1351
|
+
* })
|
|
1352
|
+
*/
|
|
1353
|
+
grantCustomerCredits(request, requestOptions) {
|
|
1354
|
+
return core.HttpResponsePromise.fromPromise(this.__grantCustomerCredits(request, requestOptions));
|
|
1355
|
+
}
|
|
1356
|
+
__grantCustomerCredits(request, requestOptions) {
|
|
1357
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1358
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1359
|
+
const { id, body: _body } = request;
|
|
1360
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1361
|
+
const _response = yield core.fetcher({
|
|
1362
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/credits/grants`),
|
|
1363
|
+
method: "POST",
|
|
1364
|
+
headers: _headers,
|
|
1365
|
+
contentType: "application/json",
|
|
1366
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1367
|
+
requestType: "json",
|
|
1368
|
+
body: _body,
|
|
1369
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
1370
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
1371
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1372
|
+
});
|
|
1373
|
+
if (_response.ok) {
|
|
1374
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1375
|
+
}
|
|
1376
|
+
if (_response.error.reason === "status-code") {
|
|
1377
|
+
switch (_response.error.statusCode) {
|
|
1378
|
+
case 400:
|
|
1379
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
1380
|
+
case 403:
|
|
1381
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1382
|
+
case 404:
|
|
1383
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1384
|
+
case 409:
|
|
1385
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
1386
|
+
case 500:
|
|
1387
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1388
|
+
default:
|
|
1389
|
+
throw new errors.PaidError({
|
|
1390
|
+
statusCode: _response.error.statusCode,
|
|
1391
|
+
body: _response.error.body,
|
|
1392
|
+
rawResponse: _response.rawResponse,
|
|
1393
|
+
});
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
switch (_response.error.reason) {
|
|
1397
|
+
case "non-json":
|
|
1398
|
+
throw new errors.PaidError({
|
|
1399
|
+
statusCode: _response.error.statusCode,
|
|
1400
|
+
body: _response.error.rawBody,
|
|
1401
|
+
rawResponse: _response.rawResponse,
|
|
1402
|
+
});
|
|
1403
|
+
case "timeout":
|
|
1404
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers/{id}/credits/grants.");
|
|
1405
|
+
case "unknown":
|
|
1406
|
+
throw new errors.PaidError({
|
|
1407
|
+
message: _response.error.errorMessage,
|
|
1408
|
+
rawResponse: _response.rawResponse,
|
|
1409
|
+
});
|
|
1410
|
+
}
|
|
1411
|
+
});
|
|
1412
|
+
}
|
|
1413
|
+
/**
|
|
1414
|
+
* Get current customer credit balances grouped by currency, looked up by external ID
|
|
1415
|
+
*
|
|
1416
|
+
* @param {Paid.GetCustomerCreditBalancesByExternalIdRequest} request
|
|
1417
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
1418
|
+
*
|
|
1419
|
+
* @throws {@link Paid.ForbiddenError}
|
|
1420
|
+
* @throws {@link Paid.NotFoundError}
|
|
1421
|
+
* @throws {@link Paid.InternalServerError}
|
|
1422
|
+
*
|
|
1423
|
+
* @example
|
|
1424
|
+
* await client.customers.getCustomerCreditBalancesByExternalId({
|
|
1425
|
+
* externalId: "customer_123"
|
|
1426
|
+
* })
|
|
1427
|
+
*/
|
|
1428
|
+
getCustomerCreditBalancesByExternalId(request, requestOptions) {
|
|
1429
|
+
return core.HttpResponsePromise.fromPromise(this.__getCustomerCreditBalancesByExternalId(request, requestOptions));
|
|
1430
|
+
}
|
|
1431
|
+
__getCustomerCreditBalancesByExternalId(request, requestOptions) {
|
|
1432
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1433
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1434
|
+
const { externalId } = request;
|
|
1435
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1436
|
+
const _response = yield core.fetcher({
|
|
1437
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/credits/balances`),
|
|
1438
|
+
method: "GET",
|
|
1439
|
+
headers: _headers,
|
|
1440
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1441
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
1442
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
1443
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1444
|
+
});
|
|
1445
|
+
if (_response.ok) {
|
|
1446
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1447
|
+
}
|
|
1448
|
+
if (_response.error.reason === "status-code") {
|
|
1449
|
+
switch (_response.error.statusCode) {
|
|
1450
|
+
case 403:
|
|
1451
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1452
|
+
case 404:
|
|
1453
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1454
|
+
case 500:
|
|
1455
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1456
|
+
default:
|
|
1457
|
+
throw new errors.PaidError({
|
|
1458
|
+
statusCode: _response.error.statusCode,
|
|
1459
|
+
body: _response.error.body,
|
|
1460
|
+
rawResponse: _response.rawResponse,
|
|
1461
|
+
});
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
switch (_response.error.reason) {
|
|
1465
|
+
case "non-json":
|
|
1466
|
+
throw new errors.PaidError({
|
|
1467
|
+
statusCode: _response.error.statusCode,
|
|
1468
|
+
body: _response.error.rawBody,
|
|
1469
|
+
rawResponse: _response.rawResponse,
|
|
1470
|
+
});
|
|
1471
|
+
case "timeout":
|
|
1472
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}/credits/balances.");
|
|
1473
|
+
case "unknown":
|
|
1474
|
+
throw new errors.PaidError({
|
|
1475
|
+
message: _response.error.errorMessage,
|
|
1476
|
+
rawResponse: _response.rawResponse,
|
|
1477
|
+
});
|
|
1478
|
+
}
|
|
1479
|
+
});
|
|
1480
|
+
}
|
|
1481
|
+
/**
|
|
1482
|
+
* List credit consumption that was recorded before a matching credit pool existed — for example usage that arrived before an invoice was paid or before a new period's credits were granted. Entries leave this list once they are applied to a pool or settled. Use the value returned as `customer.id`, for example `cus_abc123`. If you have your own customer ID, use `/api/v2/customers/external/{externalId}/credits/pending-consumption`.
|
|
1483
|
+
*
|
|
1484
|
+
* @param {Paid.ListCustomerPendingCreditConsumptionRequest} request
|
|
1485
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
1486
|
+
*
|
|
1487
|
+
* @throws {@link Paid.BadRequestError}
|
|
1488
|
+
* @throws {@link Paid.ForbiddenError}
|
|
1489
|
+
* @throws {@link Paid.NotFoundError}
|
|
1490
|
+
* @throws {@link Paid.InternalServerError}
|
|
1491
|
+
*
|
|
1492
|
+
* @example
|
|
1493
|
+
* await client.customers.listCustomerPendingCreditConsumption({
|
|
1494
|
+
* id: "cus_abc123"
|
|
1495
|
+
* })
|
|
1496
|
+
*/
|
|
1497
|
+
listCustomerPendingCreditConsumption(request, requestOptions) {
|
|
1498
|
+
return core.HttpResponsePromise.fromPromise(this.__listCustomerPendingCreditConsumption(request, requestOptions));
|
|
1499
|
+
}
|
|
1500
|
+
__listCustomerPendingCreditConsumption(request, requestOptions) {
|
|
1501
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1502
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1503
|
+
const { id, limit, offset } = request;
|
|
1504
|
+
const _queryParams = {};
|
|
1505
|
+
if (limit != null) {
|
|
1506
|
+
_queryParams.limit = limit.toString();
|
|
1507
|
+
}
|
|
1508
|
+
if (offset != null) {
|
|
1509
|
+
_queryParams.offset = offset.toString();
|
|
1510
|
+
}
|
|
1511
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1512
|
+
const _response = yield core.fetcher({
|
|
1513
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/credits/pending-consumption`),
|
|
1514
|
+
method: "GET",
|
|
1515
|
+
headers: _headers,
|
|
1516
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
1517
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
1518
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
1519
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1520
|
+
});
|
|
1521
|
+
if (_response.ok) {
|
|
1522
|
+
return {
|
|
1523
|
+
data: _response.body,
|
|
1524
|
+
rawResponse: _response.rawResponse,
|
|
1525
|
+
};
|
|
1526
|
+
}
|
|
1527
|
+
if (_response.error.reason === "status-code") {
|
|
1528
|
+
switch (_response.error.statusCode) {
|
|
1529
|
+
case 400:
|
|
1530
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
1531
|
+
case 403:
|
|
1532
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1533
|
+
case 404:
|
|
1534
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1535
|
+
case 500:
|
|
1536
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1537
|
+
default:
|
|
1538
|
+
throw new errors.PaidError({
|
|
1539
|
+
statusCode: _response.error.statusCode,
|
|
1540
|
+
body: _response.error.body,
|
|
1541
|
+
rawResponse: _response.rawResponse,
|
|
1542
|
+
});
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
switch (_response.error.reason) {
|
|
1546
|
+
case "non-json":
|
|
1547
|
+
throw new errors.PaidError({
|
|
1548
|
+
statusCode: _response.error.statusCode,
|
|
1549
|
+
body: _response.error.rawBody,
|
|
1550
|
+
rawResponse: _response.rawResponse,
|
|
1551
|
+
});
|
|
1552
|
+
case "timeout":
|
|
1553
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}/credits/pending-consumption.");
|
|
1554
|
+
case "unknown":
|
|
1555
|
+
throw new errors.PaidError({
|
|
1556
|
+
message: _response.error.errorMessage,
|
|
1557
|
+
rawResponse: _response.rawResponse,
|
|
1558
|
+
});
|
|
1559
|
+
}
|
|
1560
|
+
});
|
|
1561
|
+
}
|
|
1562
|
+
/**
|
|
1563
|
+
* List credit consumption recorded before a matching credit pool existed, for a customer looked up by external ID.
|
|
1564
|
+
*
|
|
1565
|
+
* @param {Paid.ListCustomerPendingCreditConsumptionByExternalIdRequest} request
|
|
1566
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
1567
|
+
*
|
|
1568
|
+
* @throws {@link Paid.BadRequestError}
|
|
1569
|
+
* @throws {@link Paid.ForbiddenError}
|
|
1570
|
+
* @throws {@link Paid.NotFoundError}
|
|
1571
|
+
* @throws {@link Paid.InternalServerError}
|
|
1572
|
+
*
|
|
1573
|
+
* @example
|
|
1574
|
+
* await client.customers.listCustomerPendingCreditConsumptionByExternalId({
|
|
1575
|
+
* externalId: "customer_123"
|
|
1576
|
+
* })
|
|
1577
|
+
*/
|
|
1578
|
+
listCustomerPendingCreditConsumptionByExternalId(request, requestOptions) {
|
|
1579
|
+
return core.HttpResponsePromise.fromPromise(this.__listCustomerPendingCreditConsumptionByExternalId(request, requestOptions));
|
|
1580
|
+
}
|
|
1581
|
+
__listCustomerPendingCreditConsumptionByExternalId(request, requestOptions) {
|
|
1582
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1583
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1584
|
+
const { externalId, limit, offset } = request;
|
|
1585
|
+
const _queryParams = {};
|
|
1586
|
+
if (limit != null) {
|
|
1587
|
+
_queryParams.limit = limit.toString();
|
|
1588
|
+
}
|
|
1589
|
+
if (offset != null) {
|
|
1590
|
+
_queryParams.offset = offset.toString();
|
|
1591
|
+
}
|
|
1592
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1593
|
+
const _response = yield core.fetcher({
|
|
1594
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/credits/pending-consumption`),
|
|
1595
|
+
method: "GET",
|
|
1596
|
+
headers: _headers,
|
|
1597
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
1598
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
1599
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
1600
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1601
|
+
});
|
|
1602
|
+
if (_response.ok) {
|
|
1603
|
+
return {
|
|
1604
|
+
data: _response.body,
|
|
1605
|
+
rawResponse: _response.rawResponse,
|
|
1606
|
+
};
|
|
1607
|
+
}
|
|
1608
|
+
if (_response.error.reason === "status-code") {
|
|
1609
|
+
switch (_response.error.statusCode) {
|
|
1610
|
+
case 400:
|
|
1611
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
1612
|
+
case 403:
|
|
1613
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1614
|
+
case 404:
|
|
1615
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1616
|
+
case 500:
|
|
1617
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1618
|
+
default:
|
|
1619
|
+
throw new errors.PaidError({
|
|
1620
|
+
statusCode: _response.error.statusCode,
|
|
1621
|
+
body: _response.error.body,
|
|
1622
|
+
rawResponse: _response.rawResponse,
|
|
1623
|
+
});
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
switch (_response.error.reason) {
|
|
1627
|
+
case "non-json":
|
|
1628
|
+
throw new errors.PaidError({
|
|
1629
|
+
statusCode: _response.error.statusCode,
|
|
1630
|
+
body: _response.error.rawBody,
|
|
1631
|
+
rawResponse: _response.rawResponse,
|
|
1632
|
+
});
|
|
1633
|
+
case "timeout":
|
|
1634
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}/credits/pending-consumption.");
|
|
1635
|
+
case "unknown":
|
|
1636
|
+
throw new errors.PaidError({
|
|
1637
|
+
message: _response.error.errorMessage,
|
|
1638
|
+
rawResponse: _response.rawResponse,
|
|
1639
|
+
});
|
|
1640
|
+
}
|
|
1641
|
+
});
|
|
1642
|
+
}
|
|
1643
|
+
/**
|
|
1644
|
+
* Immediately grant credits to a customer looked up by external ID using an active credit currency key.
|
|
1645
|
+
*
|
|
1646
|
+
* @param {Paid.GrantCustomerCreditsByExternalIdRequest} request
|
|
1647
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
1648
|
+
*
|
|
1649
|
+
* @throws {@link Paid.BadRequestError}
|
|
1650
|
+
* @throws {@link Paid.ForbiddenError}
|
|
1651
|
+
* @throws {@link Paid.NotFoundError}
|
|
1652
|
+
* @throws {@link Paid.ConflictError}
|
|
1653
|
+
* @throws {@link Paid.InternalServerError}
|
|
1654
|
+
*
|
|
1655
|
+
* @example
|
|
1656
|
+
* await client.customers.grantCustomerCreditsByExternalId({
|
|
1657
|
+
* externalId: "customer_123",
|
|
1658
|
+
* body: {
|
|
1659
|
+
* creditCurrencyKey: "api_credits",
|
|
1660
|
+
* amount: 10000,
|
|
1661
|
+
* startsAt: "2026-06-05T12:00:00Z",
|
|
1662
|
+
* expiresAt: "2026-12-31T23:59:59Z",
|
|
1663
|
+
* idempotencyKey: "grant_acme_2026-06-05"
|
|
1664
|
+
* }
|
|
1665
|
+
* })
|
|
1666
|
+
*/
|
|
1667
|
+
grantCustomerCreditsByExternalId(request, requestOptions) {
|
|
1668
|
+
return core.HttpResponsePromise.fromPromise(this.__grantCustomerCreditsByExternalId(request, requestOptions));
|
|
1669
|
+
}
|
|
1670
|
+
__grantCustomerCreditsByExternalId(request, requestOptions) {
|
|
1671
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1672
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1673
|
+
const { externalId, body: _body } = request;
|
|
1674
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1675
|
+
const _response = yield core.fetcher({
|
|
1676
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/credits/grants`),
|
|
1677
|
+
method: "POST",
|
|
1678
|
+
headers: _headers,
|
|
1679
|
+
contentType: "application/json",
|
|
1680
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1681
|
+
requestType: "json",
|
|
1682
|
+
body: _body,
|
|
1683
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
1684
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
1685
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1686
|
+
});
|
|
1687
|
+
if (_response.ok) {
|
|
1688
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1689
|
+
}
|
|
1690
|
+
if (_response.error.reason === "status-code") {
|
|
1691
|
+
switch (_response.error.statusCode) {
|
|
1692
|
+
case 400:
|
|
1693
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
1694
|
+
case 403:
|
|
1695
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1696
|
+
case 404:
|
|
1697
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1698
|
+
case 409:
|
|
1699
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
1700
|
+
case 500:
|
|
1701
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1702
|
+
default:
|
|
1703
|
+
throw new errors.PaidError({
|
|
1704
|
+
statusCode: _response.error.statusCode,
|
|
1705
|
+
body: _response.error.body,
|
|
1706
|
+
rawResponse: _response.rawResponse,
|
|
1707
|
+
});
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
switch (_response.error.reason) {
|
|
1711
|
+
case "non-json":
|
|
1712
|
+
throw new errors.PaidError({
|
|
1713
|
+
statusCode: _response.error.statusCode,
|
|
1714
|
+
body: _response.error.rawBody,
|
|
1715
|
+
rawResponse: _response.rawResponse,
|
|
1716
|
+
});
|
|
1717
|
+
case "timeout":
|
|
1718
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers/external/{externalId}/credits/grants.");
|
|
1719
|
+
case "unknown":
|
|
1720
|
+
throw new errors.PaidError({
|
|
1721
|
+
message: _response.error.errorMessage,
|
|
1722
|
+
rawResponse: _response.rawResponse,
|
|
1723
|
+
});
|
|
1724
|
+
}
|
|
1725
|
+
});
|
|
1726
|
+
}
|
|
1727
|
+
/**
|
|
1728
|
+
* Create or update a customer user using customer and user external IDs
|
|
1729
|
+
*
|
|
1730
|
+
* @param {Paid.UpsertCustomerUserRequest} request
|
|
1731
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
1732
|
+
*
|
|
1733
|
+
* @throws {@link Paid.BadRequestError}
|
|
1734
|
+
* @throws {@link Paid.ForbiddenError}
|
|
1735
|
+
* @throws {@link Paid.NotFoundError}
|
|
1736
|
+
* @throws {@link Paid.InternalServerError}
|
|
1737
|
+
*
|
|
1738
|
+
* @example
|
|
1739
|
+
* await client.customers.upsertCustomerUserByExternalId({
|
|
1740
|
+
* customerExternalId: "customerExternalId",
|
|
1741
|
+
* userExternalId: "userExternalId"
|
|
1742
|
+
* })
|
|
1743
|
+
*/
|
|
1744
|
+
upsertCustomerUserByExternalId(request, requestOptions) {
|
|
1745
|
+
return core.HttpResponsePromise.fromPromise(this.__upsertCustomerUserByExternalId(request, requestOptions));
|
|
1746
|
+
}
|
|
1747
|
+
__upsertCustomerUserByExternalId(request, requestOptions) {
|
|
1748
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1749
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1750
|
+
const { customerExternalId, userExternalId } = request, _body = __rest(request, ["customerExternalId", "userExternalId"]);
|
|
1751
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1752
|
+
const _response = yield core.fetcher({
|
|
1753
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(customerExternalId)}/users/${core.url.encodePathParam(userExternalId)}`),
|
|
1754
|
+
method: "PUT",
|
|
1755
|
+
headers: _headers,
|
|
1756
|
+
contentType: "application/json",
|
|
1757
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1758
|
+
requestType: "json",
|
|
1759
|
+
body: _body,
|
|
1760
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
1761
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
1762
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1763
|
+
});
|
|
1764
|
+
if (_response.ok) {
|
|
1765
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1766
|
+
}
|
|
1767
|
+
if (_response.error.reason === "status-code") {
|
|
1768
|
+
switch (_response.error.statusCode) {
|
|
1769
|
+
case 400:
|
|
1770
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
1771
|
+
case 403:
|
|
1772
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1773
|
+
case 404:
|
|
1774
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1775
|
+
case 500:
|
|
1776
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1777
|
+
default:
|
|
1778
|
+
throw new errors.PaidError({
|
|
1779
|
+
statusCode: _response.error.statusCode,
|
|
1780
|
+
body: _response.error.body,
|
|
1781
|
+
rawResponse: _response.rawResponse,
|
|
1782
|
+
});
|
|
1783
|
+
}
|
|
1784
|
+
}
|
|
1785
|
+
switch (_response.error.reason) {
|
|
1786
|
+
case "non-json":
|
|
1787
|
+
throw new errors.PaidError({
|
|
1788
|
+
statusCode: _response.error.statusCode,
|
|
1789
|
+
body: _response.error.rawBody,
|
|
1790
|
+
rawResponse: _response.rawResponse,
|
|
1791
|
+
});
|
|
1792
|
+
case "timeout":
|
|
1793
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /customers/{customerExternalId}/users/{userExternalId}.");
|
|
1794
|
+
case "unknown":
|
|
1795
|
+
throw new errors.PaidError({
|
|
1796
|
+
message: _response.error.errorMessage,
|
|
1797
|
+
rawResponse: _response.rawResponse,
|
|
1798
|
+
});
|
|
1799
|
+
}
|
|
1800
|
+
});
|
|
1801
|
+
}
|
|
1802
|
+
/**
|
|
1803
|
+
* Returns the virtual bank account (Stripe funding instructions) a customer can pay by bank transfer into, by Paid display ID.
|
|
1804
|
+
*
|
|
1805
|
+
* @param {Paid.GetCustomerFundingInstructionsRequest} request
|
|
1806
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
1807
|
+
*
|
|
1808
|
+
* @throws {@link Paid.BadRequestError}
|
|
1809
|
+
* @throws {@link Paid.ForbiddenError}
|
|
1810
|
+
* @throws {@link Paid.NotFoundError}
|
|
1811
|
+
* @throws {@link Paid.InternalServerError}
|
|
1812
|
+
*
|
|
1813
|
+
* @example
|
|
1814
|
+
* await client.customers.getCustomerFundingInstructions({
|
|
1815
|
+
* id: "cus_abc123",
|
|
1816
|
+
* currency: "USD"
|
|
1817
|
+
* })
|
|
1818
|
+
*/
|
|
1819
|
+
getCustomerFundingInstructions(request, requestOptions) {
|
|
1820
|
+
return core.HttpResponsePromise.fromPromise(this.__getCustomerFundingInstructions(request, requestOptions));
|
|
1821
|
+
}
|
|
1822
|
+
__getCustomerFundingInstructions(request, requestOptions) {
|
|
1823
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1824
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1825
|
+
const { id, currency } = request;
|
|
1826
|
+
const _queryParams = {};
|
|
1827
|
+
if (currency != null) {
|
|
1828
|
+
_queryParams.currency = currency;
|
|
1829
|
+
}
|
|
1830
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1831
|
+
const _response = yield core.fetcher({
|
|
1832
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/funding-instructions`),
|
|
1833
|
+
method: "GET",
|
|
1834
|
+
headers: _headers,
|
|
1835
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
1836
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
1837
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
1838
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1839
|
+
});
|
|
1840
|
+
if (_response.ok) {
|
|
1841
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1842
|
+
}
|
|
1843
|
+
if (_response.error.reason === "status-code") {
|
|
1844
|
+
switch (_response.error.statusCode) {
|
|
1845
|
+
case 400:
|
|
1846
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
1847
|
+
case 403:
|
|
1848
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1849
|
+
case 404:
|
|
1850
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1851
|
+
case 500:
|
|
1852
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1853
|
+
default:
|
|
1854
|
+
throw new errors.PaidError({
|
|
1855
|
+
statusCode: _response.error.statusCode,
|
|
1856
|
+
body: _response.error.body,
|
|
1857
|
+
rawResponse: _response.rawResponse,
|
|
1858
|
+
});
|
|
1859
|
+
}
|
|
1860
|
+
}
|
|
1861
|
+
switch (_response.error.reason) {
|
|
1862
|
+
case "non-json":
|
|
1863
|
+
throw new errors.PaidError({
|
|
1864
|
+
statusCode: _response.error.statusCode,
|
|
1865
|
+
body: _response.error.rawBody,
|
|
1866
|
+
rawResponse: _response.rawResponse,
|
|
1867
|
+
});
|
|
1868
|
+
case "timeout":
|
|
1869
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}/funding-instructions.");
|
|
1870
|
+
case "unknown":
|
|
1871
|
+
throw new errors.PaidError({
|
|
1872
|
+
message: _response.error.errorMessage,
|
|
1873
|
+
rawResponse: _response.rawResponse,
|
|
1874
|
+
});
|
|
1875
|
+
}
|
|
1876
|
+
});
|
|
1877
|
+
}
|
|
1878
|
+
/**
|
|
1879
|
+
* Creates a dedicated virtual bank account for the customer to pay invoices by bank transfer, by Paid display ID. Returns the existing account if one already exists for the currency. Requires a live-mode organization with Stripe connected and Bank Transfers enabled on the Stripe account.
|
|
1880
|
+
*
|
|
1881
|
+
* @param {Paid.CreateCustomerFundingInstructionsRequest} request
|
|
1882
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
1883
|
+
*
|
|
1884
|
+
* @throws {@link Paid.BadRequestError}
|
|
1885
|
+
* @throws {@link Paid.ForbiddenError}
|
|
1886
|
+
* @throws {@link Paid.NotFoundError}
|
|
1887
|
+
* @throws {@link Paid.UnprocessableEntityError}
|
|
1888
|
+
* @throws {@link Paid.InternalServerError}
|
|
1889
|
+
*
|
|
1890
|
+
* @example
|
|
1891
|
+
* await client.customers.createCustomerFundingInstructions({
|
|
1892
|
+
* id: "cus_abc123",
|
|
1893
|
+
* body: {}
|
|
1894
|
+
* })
|
|
1895
|
+
*/
|
|
1896
|
+
createCustomerFundingInstructions(request, requestOptions) {
|
|
1897
|
+
return core.HttpResponsePromise.fromPromise(this.__createCustomerFundingInstructions(request, requestOptions));
|
|
1898
|
+
}
|
|
1899
|
+
__createCustomerFundingInstructions(request, requestOptions) {
|
|
1900
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1901
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1902
|
+
const { id, body: _body } = request;
|
|
1903
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1904
|
+
const _response = yield core.fetcher({
|
|
1905
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/funding-instructions`),
|
|
1906
|
+
method: "POST",
|
|
1907
|
+
headers: _headers,
|
|
1908
|
+
contentType: "application/json",
|
|
1909
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1910
|
+
requestType: "json",
|
|
1911
|
+
body: _body,
|
|
1912
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
1913
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
1914
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1915
|
+
});
|
|
1916
|
+
if (_response.ok) {
|
|
1917
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1918
|
+
}
|
|
1919
|
+
if (_response.error.reason === "status-code") {
|
|
1920
|
+
switch (_response.error.statusCode) {
|
|
1921
|
+
case 400:
|
|
1922
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
1923
|
+
case 403:
|
|
1924
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1925
|
+
case 404:
|
|
1926
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1927
|
+
case 422:
|
|
1928
|
+
throw new Paid.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1929
|
+
case 500:
|
|
1930
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
1931
|
+
default:
|
|
1932
|
+
throw new errors.PaidError({
|
|
1933
|
+
statusCode: _response.error.statusCode,
|
|
1934
|
+
body: _response.error.body,
|
|
1935
|
+
rawResponse: _response.rawResponse,
|
|
1936
|
+
});
|
|
1937
|
+
}
|
|
1938
|
+
}
|
|
1939
|
+
switch (_response.error.reason) {
|
|
1940
|
+
case "non-json":
|
|
1941
|
+
throw new errors.PaidError({
|
|
1942
|
+
statusCode: _response.error.statusCode,
|
|
1943
|
+
body: _response.error.rawBody,
|
|
1944
|
+
rawResponse: _response.rawResponse,
|
|
1945
|
+
});
|
|
1946
|
+
case "timeout":
|
|
1947
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers/{id}/funding-instructions.");
|
|
1948
|
+
case "unknown":
|
|
1949
|
+
throw new errors.PaidError({
|
|
1950
|
+
message: _response.error.errorMessage,
|
|
1951
|
+
rawResponse: _response.rawResponse,
|
|
1952
|
+
});
|
|
1953
|
+
}
|
|
1954
|
+
});
|
|
1955
|
+
}
|
|
1956
|
+
/**
|
|
1957
|
+
* Returns the virtual bank account (Stripe funding instructions) a customer can pay by bank transfer into, by your external ID.
|
|
1958
|
+
*
|
|
1959
|
+
* @param {Paid.GetCustomerFundingInstructionsByExternalIdRequest} request
|
|
1960
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
1961
|
+
*
|
|
1962
|
+
* @throws {@link Paid.BadRequestError}
|
|
1963
|
+
* @throws {@link Paid.ForbiddenError}
|
|
1964
|
+
* @throws {@link Paid.NotFoundError}
|
|
1965
|
+
* @throws {@link Paid.InternalServerError}
|
|
1966
|
+
*
|
|
1967
|
+
* @example
|
|
1968
|
+
* await client.customers.getCustomerFundingInstructionsByExternalId({
|
|
1969
|
+
* externalId: "externalId",
|
|
1970
|
+
* currency: "USD"
|
|
1971
|
+
* })
|
|
1972
|
+
*/
|
|
1973
|
+
getCustomerFundingInstructionsByExternalId(request, requestOptions) {
|
|
1974
|
+
return core.HttpResponsePromise.fromPromise(this.__getCustomerFundingInstructionsByExternalId(request, requestOptions));
|
|
1975
|
+
}
|
|
1976
|
+
__getCustomerFundingInstructionsByExternalId(request, requestOptions) {
|
|
1977
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1978
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1979
|
+
const { externalId, currency } = request;
|
|
1980
|
+
const _queryParams = {};
|
|
1981
|
+
if (currency != null) {
|
|
1982
|
+
_queryParams.currency = currency;
|
|
1983
|
+
}
|
|
1984
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1985
|
+
const _response = yield core.fetcher({
|
|
1986
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/funding-instructions`),
|
|
1987
|
+
method: "GET",
|
|
1988
|
+
headers: _headers,
|
|
1989
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
1990
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
1991
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
1992
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1993
|
+
});
|
|
1994
|
+
if (_response.ok) {
|
|
1995
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
1996
|
+
}
|
|
1997
|
+
if (_response.error.reason === "status-code") {
|
|
1998
|
+
switch (_response.error.statusCode) {
|
|
1999
|
+
case 400:
|
|
2000
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
2001
|
+
case 403:
|
|
2002
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2003
|
+
case 404:
|
|
2004
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2005
|
+
case 500:
|
|
2006
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
2007
|
+
default:
|
|
2008
|
+
throw new errors.PaidError({
|
|
2009
|
+
statusCode: _response.error.statusCode,
|
|
2010
|
+
body: _response.error.body,
|
|
2011
|
+
rawResponse: _response.rawResponse,
|
|
2012
|
+
});
|
|
2013
|
+
}
|
|
2014
|
+
}
|
|
2015
|
+
switch (_response.error.reason) {
|
|
2016
|
+
case "non-json":
|
|
2017
|
+
throw new errors.PaidError({
|
|
2018
|
+
statusCode: _response.error.statusCode,
|
|
2019
|
+
body: _response.error.rawBody,
|
|
2020
|
+
rawResponse: _response.rawResponse,
|
|
2021
|
+
});
|
|
2022
|
+
case "timeout":
|
|
2023
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}/funding-instructions.");
|
|
2024
|
+
case "unknown":
|
|
2025
|
+
throw new errors.PaidError({
|
|
2026
|
+
message: _response.error.errorMessage,
|
|
2027
|
+
rawResponse: _response.rawResponse,
|
|
2028
|
+
});
|
|
2029
|
+
}
|
|
2030
|
+
});
|
|
2031
|
+
}
|
|
2032
|
+
/**
|
|
2033
|
+
* Creates a dedicated virtual bank account for the customer to pay invoices by bank transfer, by your external ID. Returns the existing account if one already exists for the currency. Requires a live-mode organization with Stripe connected and Bank Transfers enabled on the Stripe account.
|
|
2034
|
+
*
|
|
2035
|
+
* @param {Paid.CreateCustomerFundingInstructionsByExternalIdRequest} request
|
|
2036
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
2037
|
+
*
|
|
2038
|
+
* @throws {@link Paid.BadRequestError}
|
|
2039
|
+
* @throws {@link Paid.ForbiddenError}
|
|
2040
|
+
* @throws {@link Paid.NotFoundError}
|
|
2041
|
+
* @throws {@link Paid.UnprocessableEntityError}
|
|
2042
|
+
* @throws {@link Paid.InternalServerError}
|
|
2043
|
+
*
|
|
2044
|
+
* @example
|
|
2045
|
+
* await client.customers.createCustomerFundingInstructionsByExternalId({
|
|
2046
|
+
* externalId: "externalId",
|
|
2047
|
+
* body: {}
|
|
2048
|
+
* })
|
|
2049
|
+
*/
|
|
2050
|
+
createCustomerFundingInstructionsByExternalId(request, requestOptions) {
|
|
2051
|
+
return core.HttpResponsePromise.fromPromise(this.__createCustomerFundingInstructionsByExternalId(request, requestOptions));
|
|
2052
|
+
}
|
|
2053
|
+
__createCustomerFundingInstructionsByExternalId(request, requestOptions) {
|
|
2054
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2055
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2056
|
+
const { externalId, body: _body } = request;
|
|
2057
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2058
|
+
const _response = yield core.fetcher({
|
|
2059
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/funding-instructions`),
|
|
2060
|
+
method: "POST",
|
|
2061
|
+
headers: _headers,
|
|
2062
|
+
contentType: "application/json",
|
|
2063
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
2064
|
+
requestType: "json",
|
|
2065
|
+
body: _body,
|
|
2066
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
2067
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
2068
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2069
|
+
});
|
|
2070
|
+
if (_response.ok) {
|
|
2071
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2072
|
+
}
|
|
2073
|
+
if (_response.error.reason === "status-code") {
|
|
2074
|
+
switch (_response.error.statusCode) {
|
|
2075
|
+
case 400:
|
|
2076
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
2077
|
+
case 403:
|
|
2078
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2079
|
+
case 404:
|
|
2080
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2081
|
+
case 422:
|
|
2082
|
+
throw new Paid.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
2083
|
+
case 500:
|
|
2084
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
2085
|
+
default:
|
|
2086
|
+
throw new errors.PaidError({
|
|
2087
|
+
statusCode: _response.error.statusCode,
|
|
2088
|
+
body: _response.error.body,
|
|
2089
|
+
rawResponse: _response.rawResponse,
|
|
2090
|
+
});
|
|
2091
|
+
}
|
|
2092
|
+
}
|
|
2093
|
+
switch (_response.error.reason) {
|
|
2094
|
+
case "non-json":
|
|
2095
|
+
throw new errors.PaidError({
|
|
2096
|
+
statusCode: _response.error.statusCode,
|
|
2097
|
+
body: _response.error.rawBody,
|
|
2098
|
+
rawResponse: _response.rawResponse,
|
|
2099
|
+
});
|
|
2100
|
+
case "timeout":
|
|
2101
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers/external/{externalId}/funding-instructions.");
|
|
2102
|
+
case "unknown":
|
|
2103
|
+
throw new errors.PaidError({
|
|
2104
|
+
message: _response.error.errorMessage,
|
|
2105
|
+
rawResponse: _response.rawResponse,
|
|
2106
|
+
});
|
|
2107
|
+
}
|
|
2108
|
+
});
|
|
2109
|
+
}
|
|
2110
|
+
/**
|
|
2111
|
+
* Lists the customer's units as a flat list, newest last; assemble the tree from `parentExternalId` (`null` on the root unit, `isRoot: true`). Deleted units are hidden unless `status=DELETED` is given, drafts unless `status=DRAFT`. Filter by `externalType`, or by `parentExternalId` for one level of the tree. Addresses the customer by your external customer id.
|
|
2112
|
+
*
|
|
2113
|
+
* @param {Paid.ListCustomerUnitsByExternalIdRequest} request
|
|
2114
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
2115
|
+
*
|
|
2116
|
+
* @throws {@link Paid.BadRequestError}
|
|
2117
|
+
* @throws {@link Paid.ForbiddenError}
|
|
2118
|
+
* @throws {@link Paid.NotFoundError}
|
|
2119
|
+
* @throws {@link Paid.InternalServerError}
|
|
2120
|
+
*
|
|
2121
|
+
* @example
|
|
2122
|
+
* await client.customers.listCustomerUnitsByExternalId({
|
|
2123
|
+
* externalId: "customer_123",
|
|
2124
|
+
* parentExternalId: "dept-rnd"
|
|
2125
|
+
* })
|
|
2126
|
+
*/
|
|
2127
|
+
listCustomerUnitsByExternalId(request, requestOptions) {
|
|
2128
|
+
return core.HttpResponsePromise.fromPromise(this.__listCustomerUnitsByExternalId(request, requestOptions));
|
|
2129
|
+
}
|
|
2130
|
+
__listCustomerUnitsByExternalId(request, requestOptions) {
|
|
2131
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2132
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2133
|
+
const { externalId, limit, offset, status, externalType, parentExternalId } = request;
|
|
2134
|
+
const _queryParams = {};
|
|
2135
|
+
if (limit != null) {
|
|
2136
|
+
_queryParams.limit = limit.toString();
|
|
2137
|
+
}
|
|
2138
|
+
if (offset != null) {
|
|
2139
|
+
_queryParams.offset = offset.toString();
|
|
2140
|
+
}
|
|
2141
|
+
if (status != null) {
|
|
2142
|
+
_queryParams.status = status;
|
|
2143
|
+
}
|
|
2144
|
+
if (externalType != null) {
|
|
2145
|
+
_queryParams.externalType = externalType;
|
|
2146
|
+
}
|
|
2147
|
+
if (parentExternalId != null) {
|
|
2148
|
+
_queryParams.parentExternalId = parentExternalId;
|
|
2149
|
+
}
|
|
2150
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2151
|
+
const _response = yield core.fetcher({
|
|
2152
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/customer-units`),
|
|
2153
|
+
method: "GET",
|
|
2154
|
+
headers: _headers,
|
|
2155
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
2156
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
2157
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
2158
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2159
|
+
});
|
|
2160
|
+
if (_response.ok) {
|
|
2161
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2162
|
+
}
|
|
2163
|
+
if (_response.error.reason === "status-code") {
|
|
2164
|
+
switch (_response.error.statusCode) {
|
|
2165
|
+
case 400:
|
|
2166
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
2167
|
+
case 403:
|
|
2168
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2169
|
+
case 404:
|
|
2170
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2171
|
+
case 500:
|
|
2172
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
2173
|
+
default:
|
|
2174
|
+
throw new errors.PaidError({
|
|
2175
|
+
statusCode: _response.error.statusCode,
|
|
2176
|
+
body: _response.error.body,
|
|
2177
|
+
rawResponse: _response.rawResponse,
|
|
2178
|
+
});
|
|
2179
|
+
}
|
|
2180
|
+
}
|
|
2181
|
+
switch (_response.error.reason) {
|
|
2182
|
+
case "non-json":
|
|
2183
|
+
throw new errors.PaidError({
|
|
2184
|
+
statusCode: _response.error.statusCode,
|
|
2185
|
+
body: _response.error.rawBody,
|
|
2186
|
+
rawResponse: _response.rawResponse,
|
|
2187
|
+
});
|
|
2188
|
+
case "timeout":
|
|
2189
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}/customer-units.");
|
|
2190
|
+
case "unknown":
|
|
2191
|
+
throw new errors.PaidError({
|
|
2192
|
+
message: _response.error.errorMessage,
|
|
2193
|
+
rawResponse: _response.rawResponse,
|
|
2194
|
+
});
|
|
2195
|
+
}
|
|
2196
|
+
});
|
|
2197
|
+
}
|
|
2198
|
+
/**
|
|
2199
|
+
* Creates a unit for this customer. `externalId` is your own key for it: required, immutable, and unique within the organization (no other customer's unit id, external id or alias may be the same, ignoring letter case); every unit route addresses the unit by it, and `name` defaults to it. Omit `parentExternalId` to create the customer's root unit (its first unit; `409 ROOT_EXISTS` if it already has one — a customer created with an external id usable as a unit key already has its root, keyed by that external id, so name it as the parent instead); otherwise the parent must exist (`409 PARENT_NOT_FOUND`) and be ACTIVE. A create whose `externalId` is one of this customer's `DRAFT` units promotes the draft in place: same unit, same id, now ACTIVE with the request's name, type, metadata and parent (`parentExternalId` is required; a draft sits under the root). A signal that names a unit before it exists is accepted; with draft units enabled for your organization it creates a `DRAFT` unit under the customer's root that holds the key, and creating the unit with that key later promotes the draft; otherwise its spend attaches to the unit once you create it with that key. `409` also when the externalId is taken on this customer (`CUSTOMER_UNIT_EXISTS`) or by another customer of the organization (`EXTERNAL_ID_IN_USE`), the tree would get too deep, the customer is on seat-based billing, or a root unit is sent with `billable: false` (`ROOT_UNIT_ALWAYS_BILLABLE`). `403 FEATURE_NOT_ENABLED` for `billable: false` when non-billable units are not enabled for your organization. Addresses the customer by your external customer id.
|
|
2200
|
+
*
|
|
2201
|
+
* @param {Paid.CreateCustomerUnitByExternalIdRequest} request
|
|
2202
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
2203
|
+
*
|
|
2204
|
+
* @throws {@link Paid.BadRequestError}
|
|
2205
|
+
* @throws {@link Paid.ForbiddenError}
|
|
2206
|
+
* @throws {@link Paid.NotFoundError}
|
|
2207
|
+
* @throws {@link Paid.ConflictError}
|
|
2208
|
+
* @throws {@link Paid.InternalServerError}
|
|
2209
|
+
*
|
|
2210
|
+
* @example
|
|
2211
|
+
* await client.customers.createCustomerUnitByExternalId({
|
|
2212
|
+
* externalId: "customer_123",
|
|
2213
|
+
* body: {
|
|
2214
|
+
* externalId: "team-research"
|
|
2215
|
+
* }
|
|
2216
|
+
* })
|
|
2217
|
+
*/
|
|
2218
|
+
createCustomerUnitByExternalId(request, requestOptions) {
|
|
2219
|
+
return core.HttpResponsePromise.fromPromise(this.__createCustomerUnitByExternalId(request, requestOptions));
|
|
2220
|
+
}
|
|
2221
|
+
__createCustomerUnitByExternalId(request, requestOptions) {
|
|
2222
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2223
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2224
|
+
const { externalId, body: _body } = request;
|
|
2225
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2226
|
+
const _response = yield core.fetcher({
|
|
2227
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/customer-units`),
|
|
2228
|
+
method: "POST",
|
|
2229
|
+
headers: _headers,
|
|
2230
|
+
contentType: "application/json",
|
|
2231
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
2232
|
+
requestType: "json",
|
|
2233
|
+
body: _body,
|
|
2234
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
2235
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
2236
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2237
|
+
});
|
|
2238
|
+
if (_response.ok) {
|
|
2239
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2240
|
+
}
|
|
2241
|
+
if (_response.error.reason === "status-code") {
|
|
2242
|
+
switch (_response.error.statusCode) {
|
|
2243
|
+
case 400:
|
|
2244
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
2245
|
+
case 403:
|
|
2246
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2247
|
+
case 404:
|
|
2248
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2249
|
+
case 409:
|
|
2250
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
2251
|
+
case 500:
|
|
2252
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
2253
|
+
default:
|
|
2254
|
+
throw new errors.PaidError({
|
|
2255
|
+
statusCode: _response.error.statusCode,
|
|
2256
|
+
body: _response.error.body,
|
|
2257
|
+
rawResponse: _response.rawResponse,
|
|
2258
|
+
});
|
|
2259
|
+
}
|
|
2260
|
+
}
|
|
2261
|
+
switch (_response.error.reason) {
|
|
2262
|
+
case "non-json":
|
|
2263
|
+
throw new errors.PaidError({
|
|
2264
|
+
statusCode: _response.error.statusCode,
|
|
2265
|
+
body: _response.error.rawBody,
|
|
2266
|
+
rawResponse: _response.rawResponse,
|
|
2267
|
+
});
|
|
2268
|
+
case "timeout":
|
|
2269
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers/external/{externalId}/customer-units.");
|
|
2270
|
+
case "unknown":
|
|
2271
|
+
throw new errors.PaidError({
|
|
2272
|
+
message: _response.error.errorMessage,
|
|
2273
|
+
rawResponse: _response.rawResponse,
|
|
2274
|
+
});
|
|
2275
|
+
}
|
|
2276
|
+
});
|
|
2277
|
+
}
|
|
2278
|
+
/**
|
|
2279
|
+
* Returns one unit of this customer by its `externalId`, including a deleted one. `404` when the unit does not exist or belongs to another customer. Addresses the customer by your external customer id.
|
|
2280
|
+
*
|
|
2281
|
+
* @param {Paid.GetCustomerUnitByExternalIdRequest} request
|
|
2282
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
2283
|
+
*
|
|
2284
|
+
* @throws {@link Paid.BadRequestError}
|
|
2285
|
+
* @throws {@link Paid.ForbiddenError}
|
|
2286
|
+
* @throws {@link Paid.NotFoundError}
|
|
2287
|
+
* @throws {@link Paid.InternalServerError}
|
|
2288
|
+
*
|
|
2289
|
+
* @example
|
|
2290
|
+
* await client.customers.getCustomerUnitByExternalId({
|
|
2291
|
+
* externalId: "customer_123",
|
|
2292
|
+
* externalCustomerUnitId: "team-research"
|
|
2293
|
+
* })
|
|
2294
|
+
*/
|
|
2295
|
+
getCustomerUnitByExternalId(request, requestOptions) {
|
|
2296
|
+
return core.HttpResponsePromise.fromPromise(this.__getCustomerUnitByExternalId(request, requestOptions));
|
|
2297
|
+
}
|
|
2298
|
+
__getCustomerUnitByExternalId(request, requestOptions) {
|
|
2299
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2300
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2301
|
+
const { externalId, externalCustomerUnitId } = request;
|
|
2302
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2303
|
+
const _response = yield core.fetcher({
|
|
2304
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}`),
|
|
2305
|
+
method: "GET",
|
|
2306
|
+
headers: _headers,
|
|
2307
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
2308
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
2309
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
2310
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2311
|
+
});
|
|
2312
|
+
if (_response.ok) {
|
|
2313
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2314
|
+
}
|
|
2315
|
+
if (_response.error.reason === "status-code") {
|
|
2316
|
+
switch (_response.error.statusCode) {
|
|
2317
|
+
case 400:
|
|
2318
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
2319
|
+
case 403:
|
|
2320
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2321
|
+
case 404:
|
|
2322
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2323
|
+
case 500:
|
|
2324
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
2325
|
+
default:
|
|
2326
|
+
throw new errors.PaidError({
|
|
2327
|
+
statusCode: _response.error.statusCode,
|
|
2328
|
+
body: _response.error.body,
|
|
2329
|
+
rawResponse: _response.rawResponse,
|
|
2330
|
+
});
|
|
2331
|
+
}
|
|
2332
|
+
}
|
|
2333
|
+
switch (_response.error.reason) {
|
|
2334
|
+
case "non-json":
|
|
2335
|
+
throw new errors.PaidError({
|
|
2336
|
+
statusCode: _response.error.statusCode,
|
|
2337
|
+
body: _response.error.rawBody,
|
|
2338
|
+
rawResponse: _response.rawResponse,
|
|
2339
|
+
});
|
|
2340
|
+
case "timeout":
|
|
2341
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}/customer-units/{externalCustomerUnitId}.");
|
|
2342
|
+
case "unknown":
|
|
2343
|
+
throw new errors.PaidError({
|
|
2344
|
+
message: _response.error.errorMessage,
|
|
2345
|
+
rawResponse: _response.rawResponse,
|
|
2346
|
+
});
|
|
2347
|
+
}
|
|
2348
|
+
});
|
|
2349
|
+
}
|
|
2350
|
+
/**
|
|
2351
|
+
* Soft-deletes a unit: it stays readable with `status: DELETED` and cannot be reactivated. Spend history that references it is kept, and signals that keep naming it are still attributed to it. A `DRAFT` unit is deleted the same way: it stays readable as DELETED, its key stays reserved, and spend already keyed to it stays its own. `409` while the unit has ACTIVE or DRAFT children or a cap in force or scheduled; the root follows the same rules, and once it is deleted a new root can be created. Addresses the customer by your external customer id.
|
|
2352
|
+
*
|
|
2353
|
+
* @param {Paid.DeleteCustomerUnitByExternalIdRequest} request
|
|
2354
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
2355
|
+
*
|
|
2356
|
+
* @throws {@link Paid.BadRequestError}
|
|
2357
|
+
* @throws {@link Paid.ForbiddenError}
|
|
2358
|
+
* @throws {@link Paid.NotFoundError}
|
|
2359
|
+
* @throws {@link Paid.ConflictError}
|
|
2360
|
+
* @throws {@link Paid.InternalServerError}
|
|
2361
|
+
*
|
|
2362
|
+
* @example
|
|
2363
|
+
* await client.customers.deleteCustomerUnitByExternalId({
|
|
2364
|
+
* externalId: "customer_123",
|
|
2365
|
+
* externalCustomerUnitId: "team-research"
|
|
2366
|
+
* })
|
|
2367
|
+
*/
|
|
2368
|
+
deleteCustomerUnitByExternalId(request, requestOptions) {
|
|
2369
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCustomerUnitByExternalId(request, requestOptions));
|
|
2370
|
+
}
|
|
2371
|
+
__deleteCustomerUnitByExternalId(request, requestOptions) {
|
|
2372
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2373
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2374
|
+
const { externalId, externalCustomerUnitId } = request;
|
|
2375
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2376
|
+
const _response = yield core.fetcher({
|
|
2377
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}`),
|
|
2378
|
+
method: "DELETE",
|
|
2379
|
+
headers: _headers,
|
|
2380
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
2381
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
2382
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
2383
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2384
|
+
});
|
|
2385
|
+
if (_response.ok) {
|
|
2386
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2387
|
+
}
|
|
2388
|
+
if (_response.error.reason === "status-code") {
|
|
2389
|
+
switch (_response.error.statusCode) {
|
|
2390
|
+
case 400:
|
|
2391
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
2392
|
+
case 403:
|
|
2393
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2394
|
+
case 404:
|
|
2395
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2396
|
+
case 409:
|
|
2397
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
2398
|
+
case 500:
|
|
2399
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
2400
|
+
default:
|
|
2401
|
+
throw new errors.PaidError({
|
|
2402
|
+
statusCode: _response.error.statusCode,
|
|
2403
|
+
body: _response.error.body,
|
|
2404
|
+
rawResponse: _response.rawResponse,
|
|
2405
|
+
});
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
switch (_response.error.reason) {
|
|
2409
|
+
case "non-json":
|
|
2410
|
+
throw new errors.PaidError({
|
|
2411
|
+
statusCode: _response.error.statusCode,
|
|
2412
|
+
body: _response.error.rawBody,
|
|
2413
|
+
rawResponse: _response.rawResponse,
|
|
2414
|
+
});
|
|
2415
|
+
case "timeout":
|
|
2416
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/external/{externalId}/customer-units/{externalCustomerUnitId}.");
|
|
2417
|
+
case "unknown":
|
|
2418
|
+
throw new errors.PaidError({
|
|
2419
|
+
message: _response.error.errorMessage,
|
|
2420
|
+
rawResponse: _response.rawResponse,
|
|
2421
|
+
});
|
|
2422
|
+
}
|
|
2423
|
+
});
|
|
2424
|
+
}
|
|
2425
|
+
/**
|
|
2426
|
+
* Renames, re-types, re-parents or annotates a unit, the root included. `externalId` cannot change. Re-parenting (`parentExternalId`) moves the unit with everything under it. Spend already recorded keeps naming the unit it landed on; caps are evaluated on the current tree, so from the move on the unit's spend in the running cap period counts toward its new ancestors' caps and no longer toward the old ones. `billable` flips the unit's own setting; moving a unit under a non-billable one makes it non-billable in effect (`effectiveBillable`). `409` for a deleted unit (`CUSTOMER_UNIT_DELETED`), a draft (`CUSTOMER_UNIT_DRAFT`), a parent that does not exist or is not ACTIVE, a move of the root (`ROOT_UNIT_IMMOVABLE`), `billable: false` on the root (`ROOT_UNIT_ALWAYS_BILLABLE`), a move under the unit's own subtree, or a tree that would get too deep. `403 FEATURE_NOT_ENABLED` for `billable: false` when non-billable units are not enabled for your organization. Addresses the customer by your external customer id.
|
|
2427
|
+
*
|
|
2428
|
+
* @param {Paid.UpdateCustomerUnitByExternalIdRequest} request
|
|
2429
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
2430
|
+
*
|
|
2431
|
+
* @throws {@link Paid.BadRequestError}
|
|
2432
|
+
* @throws {@link Paid.ForbiddenError}
|
|
2433
|
+
* @throws {@link Paid.NotFoundError}
|
|
2434
|
+
* @throws {@link Paid.ConflictError}
|
|
2435
|
+
* @throws {@link Paid.InternalServerError}
|
|
2436
|
+
*
|
|
2437
|
+
* @example
|
|
2438
|
+
* await client.customers.updateCustomerUnitByExternalId({
|
|
2439
|
+
* externalId: "customer_123",
|
|
2440
|
+
* externalCustomerUnitId: "team-research",
|
|
2441
|
+
* body: {}
|
|
2442
|
+
* })
|
|
2443
|
+
*/
|
|
2444
|
+
updateCustomerUnitByExternalId(request, requestOptions) {
|
|
2445
|
+
return core.HttpResponsePromise.fromPromise(this.__updateCustomerUnitByExternalId(request, requestOptions));
|
|
2446
|
+
}
|
|
2447
|
+
__updateCustomerUnitByExternalId(request, requestOptions) {
|
|
2448
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2449
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2450
|
+
const { externalId, externalCustomerUnitId, body: _body } = request;
|
|
2451
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2452
|
+
const _response = yield core.fetcher({
|
|
2453
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}`),
|
|
2454
|
+
method: "PATCH",
|
|
2455
|
+
headers: _headers,
|
|
2456
|
+
contentType: "application/json",
|
|
2457
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
2458
|
+
requestType: "json",
|
|
2459
|
+
body: _body,
|
|
2460
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
2461
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
2462
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2463
|
+
});
|
|
2464
|
+
if (_response.ok) {
|
|
2465
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2466
|
+
}
|
|
2467
|
+
if (_response.error.reason === "status-code") {
|
|
2468
|
+
switch (_response.error.statusCode) {
|
|
2469
|
+
case 400:
|
|
2470
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
2471
|
+
case 403:
|
|
2472
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2473
|
+
case 404:
|
|
2474
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2475
|
+
case 409:
|
|
2476
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
2477
|
+
case 500:
|
|
2478
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
2479
|
+
default:
|
|
2480
|
+
throw new errors.PaidError({
|
|
2481
|
+
statusCode: _response.error.statusCode,
|
|
2482
|
+
body: _response.error.body,
|
|
2483
|
+
rawResponse: _response.rawResponse,
|
|
2484
|
+
});
|
|
2485
|
+
}
|
|
2486
|
+
}
|
|
2487
|
+
switch (_response.error.reason) {
|
|
2488
|
+
case "non-json":
|
|
2489
|
+
throw new errors.PaidError({
|
|
2490
|
+
statusCode: _response.error.statusCode,
|
|
2491
|
+
body: _response.error.rawBody,
|
|
2492
|
+
rawResponse: _response.rawResponse,
|
|
2493
|
+
});
|
|
2494
|
+
case "timeout":
|
|
2495
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling PATCH /customers/external/{externalId}/customer-units/{externalCustomerUnitId}.");
|
|
2496
|
+
case "unknown":
|
|
2497
|
+
throw new errors.PaidError({
|
|
2498
|
+
message: _response.error.errorMessage,
|
|
2499
|
+
rawResponse: _response.rawResponse,
|
|
2500
|
+
});
|
|
2501
|
+
}
|
|
2502
|
+
});
|
|
2503
|
+
}
|
|
2504
|
+
/**
|
|
2505
|
+
* Lists the aliases that land signals on this unit. A customer-level alias (created on the customer routes) points at the customer's root unit, so it is listed under the root. Addresses the customer by your external customer id.
|
|
2506
|
+
*
|
|
2507
|
+
* @param {Paid.ListCustomerUnitAliasesByExternalIdRequest} request
|
|
2508
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
2509
|
+
*
|
|
2510
|
+
* @throws {@link Paid.BadRequestError}
|
|
2511
|
+
* @throws {@link Paid.ForbiddenError}
|
|
2512
|
+
* @throws {@link Paid.NotFoundError}
|
|
2513
|
+
* @throws {@link Paid.InternalServerError}
|
|
2514
|
+
*
|
|
2515
|
+
* @example
|
|
2516
|
+
* await client.customers.listCustomerUnitAliasesByExternalId({
|
|
2517
|
+
* externalId: "customer_123",
|
|
2518
|
+
* externalCustomerUnitId: "team-research"
|
|
2519
|
+
* })
|
|
2520
|
+
*/
|
|
2521
|
+
listCustomerUnitAliasesByExternalId(request, requestOptions) {
|
|
2522
|
+
return core.HttpResponsePromise.fromPromise(this.__listCustomerUnitAliasesByExternalId(request, requestOptions));
|
|
2523
|
+
}
|
|
2524
|
+
__listCustomerUnitAliasesByExternalId(request, requestOptions) {
|
|
2525
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2526
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2527
|
+
const { externalId, externalCustomerUnitId, limit, offset } = request;
|
|
2528
|
+
const _queryParams = {};
|
|
2529
|
+
if (limit != null) {
|
|
2530
|
+
_queryParams.limit = limit.toString();
|
|
2531
|
+
}
|
|
2532
|
+
if (offset != null) {
|
|
2533
|
+
_queryParams.offset = offset.toString();
|
|
2534
|
+
}
|
|
2535
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2536
|
+
const _response = yield core.fetcher({
|
|
2537
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/aliases`),
|
|
2538
|
+
method: "GET",
|
|
2539
|
+
headers: _headers,
|
|
2540
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
2541
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
2542
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
2543
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2544
|
+
});
|
|
2545
|
+
if (_response.ok) {
|
|
2546
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2547
|
+
}
|
|
2548
|
+
if (_response.error.reason === "status-code") {
|
|
2549
|
+
switch (_response.error.statusCode) {
|
|
2550
|
+
case 400:
|
|
2551
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
2552
|
+
case 403:
|
|
2553
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2554
|
+
case 404:
|
|
2555
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2556
|
+
case 500:
|
|
2557
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
2558
|
+
default:
|
|
2559
|
+
throw new errors.PaidError({
|
|
2560
|
+
statusCode: _response.error.statusCode,
|
|
2561
|
+
body: _response.error.body,
|
|
2562
|
+
rawResponse: _response.rawResponse,
|
|
2563
|
+
});
|
|
2564
|
+
}
|
|
2565
|
+
}
|
|
2566
|
+
switch (_response.error.reason) {
|
|
2567
|
+
case "non-json":
|
|
2568
|
+
throw new errors.PaidError({
|
|
2569
|
+
statusCode: _response.error.statusCode,
|
|
2570
|
+
body: _response.error.rawBody,
|
|
2571
|
+
rawResponse: _response.rawResponse,
|
|
2572
|
+
});
|
|
2573
|
+
case "timeout":
|
|
2574
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}/customer-units/{externalCustomerUnitId}/aliases.");
|
|
2575
|
+
case "unknown":
|
|
2576
|
+
throw new errors.PaidError({
|
|
2577
|
+
message: _response.error.errorMessage,
|
|
2578
|
+
rawResponse: _response.rawResponse,
|
|
2579
|
+
});
|
|
2580
|
+
}
|
|
2581
|
+
});
|
|
2582
|
+
}
|
|
2583
|
+
/**
|
|
2584
|
+
* Creates an alias that lands signals on this unit: a signal whose `externalCustomerId` is the alias resolves to this customer and, when it names no `customerUnit`, to this unit. The alias shares one set of ids with customer external ids and unit ids, unique within the organization and ignoring letter case: an alias another customer holds is refused with `409 EXTERNAL_ID_IN_USE`. Addresses the customer by your external customer id.
|
|
2585
|
+
*
|
|
2586
|
+
* @param {Paid.CreateCustomerUnitAliasByExternalIdRequest} request
|
|
2587
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
2588
|
+
*
|
|
2589
|
+
* @throws {@link Paid.BadRequestError}
|
|
2590
|
+
* @throws {@link Paid.ForbiddenError}
|
|
2591
|
+
* @throws {@link Paid.NotFoundError}
|
|
2592
|
+
* @throws {@link Paid.ConflictError}
|
|
2593
|
+
* @throws {@link Paid.InternalServerError}
|
|
2594
|
+
*
|
|
2595
|
+
* @example
|
|
2596
|
+
* await client.customers.createCustomerUnitAliasByExternalId({
|
|
2597
|
+
* externalId: "customer_123",
|
|
2598
|
+
* externalCustomerUnitId: "team-research",
|
|
2599
|
+
* body: {
|
|
2600
|
+
* alias: "child-customer-1"
|
|
2601
|
+
* }
|
|
2602
|
+
* })
|
|
2603
|
+
*/
|
|
2604
|
+
createCustomerUnitAliasByExternalId(request, requestOptions) {
|
|
2605
|
+
return core.HttpResponsePromise.fromPromise(this.__createCustomerUnitAliasByExternalId(request, requestOptions));
|
|
2606
|
+
}
|
|
2607
|
+
__createCustomerUnitAliasByExternalId(request, requestOptions) {
|
|
2608
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2609
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2610
|
+
const { externalId, externalCustomerUnitId, body: _body } = request;
|
|
2611
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2612
|
+
const _response = yield core.fetcher({
|
|
2613
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/aliases`),
|
|
2614
|
+
method: "POST",
|
|
2615
|
+
headers: _headers,
|
|
2616
|
+
contentType: "application/json",
|
|
2617
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
2618
|
+
requestType: "json",
|
|
2619
|
+
body: _body,
|
|
2620
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
2621
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
2622
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2623
|
+
});
|
|
2624
|
+
if (_response.ok) {
|
|
2625
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2626
|
+
}
|
|
2627
|
+
if (_response.error.reason === "status-code") {
|
|
2628
|
+
switch (_response.error.statusCode) {
|
|
2629
|
+
case 400:
|
|
2630
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
2631
|
+
case 403:
|
|
2632
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2633
|
+
case 404:
|
|
2634
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2635
|
+
case 409:
|
|
2636
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
2637
|
+
case 500:
|
|
2638
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
2639
|
+
default:
|
|
2640
|
+
throw new errors.PaidError({
|
|
2641
|
+
statusCode: _response.error.statusCode,
|
|
2642
|
+
body: _response.error.body,
|
|
2643
|
+
rawResponse: _response.rawResponse,
|
|
2644
|
+
});
|
|
2645
|
+
}
|
|
2646
|
+
}
|
|
2647
|
+
switch (_response.error.reason) {
|
|
2648
|
+
case "non-json":
|
|
2649
|
+
throw new errors.PaidError({
|
|
2650
|
+
statusCode: _response.error.statusCode,
|
|
2651
|
+
body: _response.error.rawBody,
|
|
2652
|
+
rawResponse: _response.rawResponse,
|
|
2653
|
+
});
|
|
2654
|
+
case "timeout":
|
|
2655
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers/external/{externalId}/customer-units/{externalCustomerUnitId}/aliases.");
|
|
2656
|
+
case "unknown":
|
|
2657
|
+
throw new errors.PaidError({
|
|
2658
|
+
message: _response.error.errorMessage,
|
|
2659
|
+
rawResponse: _response.rawResponse,
|
|
2660
|
+
});
|
|
2661
|
+
}
|
|
2662
|
+
});
|
|
2663
|
+
}
|
|
2664
|
+
/**
|
|
2665
|
+
* Deletes an alias of this unit. Signals still sent with it then resolve to nothing again. Addresses the customer by your external customer id.
|
|
2666
|
+
*
|
|
2667
|
+
* @param {Paid.DeleteCustomerUnitAliasByExternalIdRequest} request
|
|
2668
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
2669
|
+
*
|
|
2670
|
+
* @throws {@link Paid.BadRequestError}
|
|
2671
|
+
* @throws {@link Paid.ForbiddenError}
|
|
2672
|
+
* @throws {@link Paid.NotFoundError}
|
|
2673
|
+
* @throws {@link Paid.InternalServerError}
|
|
2674
|
+
*
|
|
2675
|
+
* @example
|
|
2676
|
+
* await client.customers.deleteCustomerUnitAliasByExternalId({
|
|
2677
|
+
* externalId: "customer_123",
|
|
2678
|
+
* externalCustomerUnitId: "team-research",
|
|
2679
|
+
* alias: "tenant-7-sandbox"
|
|
2680
|
+
* })
|
|
2681
|
+
*/
|
|
2682
|
+
deleteCustomerUnitAliasByExternalId(request, requestOptions) {
|
|
2683
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCustomerUnitAliasByExternalId(request, requestOptions));
|
|
2684
|
+
}
|
|
2685
|
+
__deleteCustomerUnitAliasByExternalId(request, requestOptions) {
|
|
2686
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2687
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2688
|
+
const { externalId, externalCustomerUnitId, alias } = request;
|
|
2689
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2690
|
+
const _response = yield core.fetcher({
|
|
2691
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/aliases/${core.url.encodePathParam(alias)}`),
|
|
2692
|
+
method: "DELETE",
|
|
2693
|
+
headers: _headers,
|
|
2694
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
2695
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
2696
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
2697
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2698
|
+
});
|
|
2699
|
+
if (_response.ok) {
|
|
2700
|
+
return {
|
|
2701
|
+
data: _response.body,
|
|
2702
|
+
rawResponse: _response.rawResponse,
|
|
2703
|
+
};
|
|
2704
|
+
}
|
|
2705
|
+
if (_response.error.reason === "status-code") {
|
|
2706
|
+
switch (_response.error.statusCode) {
|
|
2707
|
+
case 400:
|
|
2708
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
2709
|
+
case 403:
|
|
2710
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2711
|
+
case 404:
|
|
2712
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2713
|
+
case 500:
|
|
2714
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
2715
|
+
default:
|
|
2716
|
+
throw new errors.PaidError({
|
|
2717
|
+
statusCode: _response.error.statusCode,
|
|
2718
|
+
body: _response.error.body,
|
|
2719
|
+
rawResponse: _response.rawResponse,
|
|
2720
|
+
});
|
|
2721
|
+
}
|
|
2722
|
+
}
|
|
2723
|
+
switch (_response.error.reason) {
|
|
2724
|
+
case "non-json":
|
|
2725
|
+
throw new errors.PaidError({
|
|
2726
|
+
statusCode: _response.error.statusCode,
|
|
2727
|
+
body: _response.error.rawBody,
|
|
2728
|
+
rawResponse: _response.rawResponse,
|
|
2729
|
+
});
|
|
2730
|
+
case "timeout":
|
|
2731
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/external/{externalId}/customer-units/{externalCustomerUnitId}/aliases/{alias}.");
|
|
2732
|
+
case "unknown":
|
|
2733
|
+
throw new errors.PaidError({
|
|
2734
|
+
message: _response.error.errorMessage,
|
|
2735
|
+
rawResponse: _response.rawResponse,
|
|
2736
|
+
});
|
|
2737
|
+
}
|
|
2738
|
+
});
|
|
2739
|
+
}
|
|
2740
|
+
/**
|
|
2741
|
+
* Lists the customer's units as a flat list, newest last; assemble the tree from `parentExternalId` (`null` on the root unit, `isRoot: true`). Deleted units are hidden unless `status=DELETED` is given, drafts unless `status=DRAFT`. Filter by `externalType`, or by `parentExternalId` for one level of the tree. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
|
|
2742
|
+
*
|
|
2743
|
+
* @param {Paid.ListCustomerUnitsRequest} request
|
|
2744
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
2745
|
+
*
|
|
2746
|
+
* @throws {@link Paid.BadRequestError}
|
|
2747
|
+
* @throws {@link Paid.ForbiddenError}
|
|
2748
|
+
* @throws {@link Paid.NotFoundError}
|
|
2749
|
+
* @throws {@link Paid.InternalServerError}
|
|
2750
|
+
*
|
|
2751
|
+
* @example
|
|
2752
|
+
* await client.customers.listCustomerUnits({
|
|
2753
|
+
* id: "cus_abc123",
|
|
2754
|
+
* parentExternalId: "dept-rnd"
|
|
2755
|
+
* })
|
|
2756
|
+
*/
|
|
2757
|
+
listCustomerUnits(request, requestOptions) {
|
|
2758
|
+
return core.HttpResponsePromise.fromPromise(this.__listCustomerUnits(request, requestOptions));
|
|
2759
|
+
}
|
|
2760
|
+
__listCustomerUnits(request, requestOptions) {
|
|
2761
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2762
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2763
|
+
const { id, limit, offset, status, externalType, parentExternalId } = request;
|
|
2764
|
+
const _queryParams = {};
|
|
2765
|
+
if (limit != null) {
|
|
2766
|
+
_queryParams.limit = limit.toString();
|
|
2767
|
+
}
|
|
2768
|
+
if (offset != null) {
|
|
2769
|
+
_queryParams.offset = offset.toString();
|
|
2770
|
+
}
|
|
2771
|
+
if (status != null) {
|
|
2772
|
+
_queryParams.status = status;
|
|
2773
|
+
}
|
|
2774
|
+
if (externalType != null) {
|
|
2775
|
+
_queryParams.externalType = externalType;
|
|
2776
|
+
}
|
|
2777
|
+
if (parentExternalId != null) {
|
|
2778
|
+
_queryParams.parentExternalId = parentExternalId;
|
|
2779
|
+
}
|
|
2780
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2781
|
+
const _response = yield core.fetcher({
|
|
2782
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/customer-units`),
|
|
2783
|
+
method: "GET",
|
|
2784
|
+
headers: _headers,
|
|
2785
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
2786
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
2787
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
2788
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2789
|
+
});
|
|
2790
|
+
if (_response.ok) {
|
|
2791
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2792
|
+
}
|
|
2793
|
+
if (_response.error.reason === "status-code") {
|
|
2794
|
+
switch (_response.error.statusCode) {
|
|
2795
|
+
case 400:
|
|
2796
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
2797
|
+
case 403:
|
|
2798
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2799
|
+
case 404:
|
|
2800
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2801
|
+
case 500:
|
|
2802
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
2803
|
+
default:
|
|
2804
|
+
throw new errors.PaidError({
|
|
2805
|
+
statusCode: _response.error.statusCode,
|
|
2806
|
+
body: _response.error.body,
|
|
2807
|
+
rawResponse: _response.rawResponse,
|
|
2808
|
+
});
|
|
2809
|
+
}
|
|
2810
|
+
}
|
|
2811
|
+
switch (_response.error.reason) {
|
|
2812
|
+
case "non-json":
|
|
2813
|
+
throw new errors.PaidError({
|
|
2814
|
+
statusCode: _response.error.statusCode,
|
|
2815
|
+
body: _response.error.rawBody,
|
|
2816
|
+
rawResponse: _response.rawResponse,
|
|
2817
|
+
});
|
|
2818
|
+
case "timeout":
|
|
2819
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}/customer-units.");
|
|
2820
|
+
case "unknown":
|
|
2821
|
+
throw new errors.PaidError({
|
|
2822
|
+
message: _response.error.errorMessage,
|
|
2823
|
+
rawResponse: _response.rawResponse,
|
|
2824
|
+
});
|
|
2825
|
+
}
|
|
2826
|
+
});
|
|
2827
|
+
}
|
|
2828
|
+
/**
|
|
2829
|
+
* Creates a unit for this customer. `externalId` is your own key for it: required, immutable, and unique within the organization (no other customer's unit id, external id or alias may be the same, ignoring letter case); every unit route addresses the unit by it, and `name` defaults to it. Omit `parentExternalId` to create the customer's root unit (its first unit; `409 ROOT_EXISTS` if it already has one — a customer created with an external id usable as a unit key already has its root, keyed by that external id, so name it as the parent instead); otherwise the parent must exist (`409 PARENT_NOT_FOUND`) and be ACTIVE. A create whose `externalId` is one of this customer's `DRAFT` units promotes the draft in place: same unit, same id, now ACTIVE with the request's name, type, metadata and parent (`parentExternalId` is required; a draft sits under the root). A signal that names a unit before it exists is accepted; with draft units enabled for your organization it creates a `DRAFT` unit under the customer's root that holds the key, and creating the unit with that key later promotes the draft; otherwise its spend attaches to the unit once you create it with that key. `409` also when the externalId is taken on this customer (`CUSTOMER_UNIT_EXISTS`) or by another customer of the organization (`EXTERNAL_ID_IN_USE`), the tree would get too deep, the customer is on seat-based billing, or a root unit is sent with `billable: false` (`ROOT_UNIT_ALWAYS_BILLABLE`). `403 FEATURE_NOT_ENABLED` for `billable: false` when non-billable units are not enabled for your organization. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
|
|
2830
|
+
*
|
|
2831
|
+
* @param {Paid.CreateCustomerUnitRequest} request
|
|
2832
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
2833
|
+
*
|
|
2834
|
+
* @throws {@link Paid.BadRequestError}
|
|
2835
|
+
* @throws {@link Paid.ForbiddenError}
|
|
2836
|
+
* @throws {@link Paid.NotFoundError}
|
|
2837
|
+
* @throws {@link Paid.ConflictError}
|
|
2838
|
+
* @throws {@link Paid.InternalServerError}
|
|
2839
|
+
*
|
|
2840
|
+
* @example
|
|
2841
|
+
* await client.customers.createCustomerUnit({
|
|
2842
|
+
* id: "cus_abc123",
|
|
2843
|
+
* body: {
|
|
2844
|
+
* externalId: "team-research"
|
|
2845
|
+
* }
|
|
2846
|
+
* })
|
|
2847
|
+
*/
|
|
2848
|
+
createCustomerUnit(request, requestOptions) {
|
|
2849
|
+
return core.HttpResponsePromise.fromPromise(this.__createCustomerUnit(request, requestOptions));
|
|
2850
|
+
}
|
|
2851
|
+
__createCustomerUnit(request, requestOptions) {
|
|
2852
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2853
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2854
|
+
const { id, body: _body } = request;
|
|
2855
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2856
|
+
const _response = yield core.fetcher({
|
|
2857
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/customer-units`),
|
|
2858
|
+
method: "POST",
|
|
2859
|
+
headers: _headers,
|
|
2860
|
+
contentType: "application/json",
|
|
2861
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
2862
|
+
requestType: "json",
|
|
2863
|
+
body: _body,
|
|
2864
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
2865
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
2866
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2867
|
+
});
|
|
2868
|
+
if (_response.ok) {
|
|
2869
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2870
|
+
}
|
|
2871
|
+
if (_response.error.reason === "status-code") {
|
|
2872
|
+
switch (_response.error.statusCode) {
|
|
2873
|
+
case 400:
|
|
2874
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
2875
|
+
case 403:
|
|
2876
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2877
|
+
case 404:
|
|
2878
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2879
|
+
case 409:
|
|
2880
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
2881
|
+
case 500:
|
|
2882
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
2883
|
+
default:
|
|
2884
|
+
throw new errors.PaidError({
|
|
2885
|
+
statusCode: _response.error.statusCode,
|
|
2886
|
+
body: _response.error.body,
|
|
2887
|
+
rawResponse: _response.rawResponse,
|
|
2888
|
+
});
|
|
2889
|
+
}
|
|
2890
|
+
}
|
|
2891
|
+
switch (_response.error.reason) {
|
|
2892
|
+
case "non-json":
|
|
2893
|
+
throw new errors.PaidError({
|
|
2894
|
+
statusCode: _response.error.statusCode,
|
|
2895
|
+
body: _response.error.rawBody,
|
|
2896
|
+
rawResponse: _response.rawResponse,
|
|
2897
|
+
});
|
|
2898
|
+
case "timeout":
|
|
2899
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers/{id}/customer-units.");
|
|
2900
|
+
case "unknown":
|
|
2901
|
+
throw new errors.PaidError({
|
|
2902
|
+
message: _response.error.errorMessage,
|
|
2903
|
+
rawResponse: _response.rawResponse,
|
|
2904
|
+
});
|
|
2905
|
+
}
|
|
2906
|
+
});
|
|
2907
|
+
}
|
|
2908
|
+
/**
|
|
2909
|
+
* Returns one unit of this customer by its `externalId`, including a deleted one. `404` when the unit does not exist or belongs to another customer. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
|
|
2910
|
+
*
|
|
2911
|
+
* @param {Paid.GetCustomerUnitRequest} request
|
|
2912
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
2913
|
+
*
|
|
2914
|
+
* @throws {@link Paid.BadRequestError}
|
|
2915
|
+
* @throws {@link Paid.ForbiddenError}
|
|
2916
|
+
* @throws {@link Paid.NotFoundError}
|
|
2917
|
+
* @throws {@link Paid.InternalServerError}
|
|
2918
|
+
*
|
|
2919
|
+
* @example
|
|
2920
|
+
* await client.customers.getCustomerUnit({
|
|
2921
|
+
* id: "cus_abc123",
|
|
2922
|
+
* externalCustomerUnitId: "team-research"
|
|
2923
|
+
* })
|
|
2924
|
+
*/
|
|
2925
|
+
getCustomerUnit(request, requestOptions) {
|
|
2926
|
+
return core.HttpResponsePromise.fromPromise(this.__getCustomerUnit(request, requestOptions));
|
|
2927
|
+
}
|
|
2928
|
+
__getCustomerUnit(request, requestOptions) {
|
|
2929
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2930
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2931
|
+
const { id, externalCustomerUnitId } = request;
|
|
2932
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
2933
|
+
const _response = yield core.fetcher({
|
|
2934
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}`),
|
|
2935
|
+
method: "GET",
|
|
2936
|
+
headers: _headers,
|
|
2937
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
2938
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
2939
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
2940
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2941
|
+
});
|
|
2942
|
+
if (_response.ok) {
|
|
2943
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
2944
|
+
}
|
|
2945
|
+
if (_response.error.reason === "status-code") {
|
|
2946
|
+
switch (_response.error.statusCode) {
|
|
2947
|
+
case 400:
|
|
2948
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
2949
|
+
case 403:
|
|
2950
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
2951
|
+
case 404:
|
|
2952
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
2953
|
+
case 500:
|
|
2954
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
2955
|
+
default:
|
|
2956
|
+
throw new errors.PaidError({
|
|
2957
|
+
statusCode: _response.error.statusCode,
|
|
2958
|
+
body: _response.error.body,
|
|
2959
|
+
rawResponse: _response.rawResponse,
|
|
2960
|
+
});
|
|
2961
|
+
}
|
|
2962
|
+
}
|
|
2963
|
+
switch (_response.error.reason) {
|
|
2964
|
+
case "non-json":
|
|
2965
|
+
throw new errors.PaidError({
|
|
2966
|
+
statusCode: _response.error.statusCode,
|
|
2967
|
+
body: _response.error.rawBody,
|
|
2968
|
+
rawResponse: _response.rawResponse,
|
|
2969
|
+
});
|
|
2970
|
+
case "timeout":
|
|
2971
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}/customer-units/{externalCustomerUnitId}.");
|
|
2972
|
+
case "unknown":
|
|
2973
|
+
throw new errors.PaidError({
|
|
2974
|
+
message: _response.error.errorMessage,
|
|
2975
|
+
rawResponse: _response.rawResponse,
|
|
2976
|
+
});
|
|
2977
|
+
}
|
|
2978
|
+
});
|
|
2979
|
+
}
|
|
2980
|
+
/**
|
|
2981
|
+
* Soft-deletes a unit: it stays readable with `status: DELETED` and cannot be reactivated. Spend history that references it is kept, and signals that keep naming it are still attributed to it. A `DRAFT` unit is deleted the same way: it stays readable as DELETED, its key stays reserved, and spend already keyed to it stays its own. `409` while the unit has ACTIVE or DRAFT children or a cap in force or scheduled; the root follows the same rules, and once it is deleted a new root can be created. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
|
|
2982
|
+
*
|
|
2983
|
+
* @param {Paid.DeleteCustomerUnitRequest} request
|
|
2984
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
2985
|
+
*
|
|
2986
|
+
* @throws {@link Paid.BadRequestError}
|
|
2987
|
+
* @throws {@link Paid.ForbiddenError}
|
|
2988
|
+
* @throws {@link Paid.NotFoundError}
|
|
2989
|
+
* @throws {@link Paid.ConflictError}
|
|
2990
|
+
* @throws {@link Paid.InternalServerError}
|
|
2991
|
+
*
|
|
2992
|
+
* @example
|
|
2993
|
+
* await client.customers.deleteCustomerUnit({
|
|
2994
|
+
* id: "cus_abc123",
|
|
2995
|
+
* externalCustomerUnitId: "team-research"
|
|
2996
|
+
* })
|
|
2997
|
+
*/
|
|
2998
|
+
deleteCustomerUnit(request, requestOptions) {
|
|
2999
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCustomerUnit(request, requestOptions));
|
|
3000
|
+
}
|
|
3001
|
+
__deleteCustomerUnit(request, requestOptions) {
|
|
3002
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3003
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3004
|
+
const { id, externalCustomerUnitId } = request;
|
|
3005
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3006
|
+
const _response = yield core.fetcher({
|
|
3007
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}`),
|
|
3008
|
+
method: "DELETE",
|
|
3009
|
+
headers: _headers,
|
|
3010
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
3011
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
3012
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
3013
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3014
|
+
});
|
|
3015
|
+
if (_response.ok) {
|
|
3016
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
3017
|
+
}
|
|
3018
|
+
if (_response.error.reason === "status-code") {
|
|
3019
|
+
switch (_response.error.statusCode) {
|
|
3020
|
+
case 400:
|
|
3021
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
3022
|
+
case 403:
|
|
3023
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3024
|
+
case 404:
|
|
3025
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3026
|
+
case 409:
|
|
3027
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
3028
|
+
case 500:
|
|
3029
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
3030
|
+
default:
|
|
3031
|
+
throw new errors.PaidError({
|
|
3032
|
+
statusCode: _response.error.statusCode,
|
|
3033
|
+
body: _response.error.body,
|
|
3034
|
+
rawResponse: _response.rawResponse,
|
|
3035
|
+
});
|
|
3036
|
+
}
|
|
3037
|
+
}
|
|
3038
|
+
switch (_response.error.reason) {
|
|
3039
|
+
case "non-json":
|
|
3040
|
+
throw new errors.PaidError({
|
|
3041
|
+
statusCode: _response.error.statusCode,
|
|
3042
|
+
body: _response.error.rawBody,
|
|
3043
|
+
rawResponse: _response.rawResponse,
|
|
3044
|
+
});
|
|
3045
|
+
case "timeout":
|
|
3046
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/{id}/customer-units/{externalCustomerUnitId}.");
|
|
3047
|
+
case "unknown":
|
|
3048
|
+
throw new errors.PaidError({
|
|
3049
|
+
message: _response.error.errorMessage,
|
|
3050
|
+
rawResponse: _response.rawResponse,
|
|
3051
|
+
});
|
|
3052
|
+
}
|
|
3053
|
+
});
|
|
3054
|
+
}
|
|
3055
|
+
/**
|
|
3056
|
+
* Renames, re-types, re-parents or annotates a unit, the root included. `externalId` cannot change. Re-parenting (`parentExternalId`) moves the unit with everything under it. Spend already recorded keeps naming the unit it landed on; caps are evaluated on the current tree, so from the move on the unit's spend in the running cap period counts toward its new ancestors' caps and no longer toward the old ones. `billable` flips the unit's own setting; moving a unit under a non-billable one makes it non-billable in effect (`effectiveBillable`). `409` for a deleted unit (`CUSTOMER_UNIT_DELETED`), a draft (`CUSTOMER_UNIT_DRAFT`), a parent that does not exist or is not ACTIVE, a move of the root (`ROOT_UNIT_IMMOVABLE`), `billable: false` on the root (`ROOT_UNIT_ALWAYS_BILLABLE`), a move under the unit's own subtree, or a tree that would get too deep. `403 FEATURE_NOT_ENABLED` for `billable: false` when non-billable units are not enabled for your organization. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
|
|
3057
|
+
*
|
|
3058
|
+
* @param {Paid.UpdateCustomerUnitRequest} request
|
|
3059
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
3060
|
+
*
|
|
3061
|
+
* @throws {@link Paid.BadRequestError}
|
|
3062
|
+
* @throws {@link Paid.ForbiddenError}
|
|
3063
|
+
* @throws {@link Paid.NotFoundError}
|
|
3064
|
+
* @throws {@link Paid.ConflictError}
|
|
3065
|
+
* @throws {@link Paid.InternalServerError}
|
|
3066
|
+
*
|
|
3067
|
+
* @example
|
|
3068
|
+
* await client.customers.updateCustomerUnit({
|
|
3069
|
+
* id: "cus_abc123",
|
|
3070
|
+
* externalCustomerUnitId: "team-research",
|
|
3071
|
+
* body: {}
|
|
3072
|
+
* })
|
|
3073
|
+
*/
|
|
3074
|
+
updateCustomerUnit(request, requestOptions) {
|
|
3075
|
+
return core.HttpResponsePromise.fromPromise(this.__updateCustomerUnit(request, requestOptions));
|
|
3076
|
+
}
|
|
3077
|
+
__updateCustomerUnit(request, requestOptions) {
|
|
3078
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3079
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3080
|
+
const { id, externalCustomerUnitId, body: _body } = request;
|
|
3081
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3082
|
+
const _response = yield core.fetcher({
|
|
3083
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}`),
|
|
3084
|
+
method: "PATCH",
|
|
3085
|
+
headers: _headers,
|
|
3086
|
+
contentType: "application/json",
|
|
3087
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
3088
|
+
requestType: "json",
|
|
3089
|
+
body: _body,
|
|
3090
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
3091
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
3092
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3093
|
+
});
|
|
3094
|
+
if (_response.ok) {
|
|
3095
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
3096
|
+
}
|
|
3097
|
+
if (_response.error.reason === "status-code") {
|
|
3098
|
+
switch (_response.error.statusCode) {
|
|
3099
|
+
case 400:
|
|
3100
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
3101
|
+
case 403:
|
|
3102
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3103
|
+
case 404:
|
|
3104
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3105
|
+
case 409:
|
|
3106
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
3107
|
+
case 500:
|
|
3108
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
3109
|
+
default:
|
|
3110
|
+
throw new errors.PaidError({
|
|
3111
|
+
statusCode: _response.error.statusCode,
|
|
3112
|
+
body: _response.error.body,
|
|
3113
|
+
rawResponse: _response.rawResponse,
|
|
3114
|
+
});
|
|
3115
|
+
}
|
|
3116
|
+
}
|
|
3117
|
+
switch (_response.error.reason) {
|
|
3118
|
+
case "non-json":
|
|
3119
|
+
throw new errors.PaidError({
|
|
3120
|
+
statusCode: _response.error.statusCode,
|
|
3121
|
+
body: _response.error.rawBody,
|
|
3122
|
+
rawResponse: _response.rawResponse,
|
|
3123
|
+
});
|
|
3124
|
+
case "timeout":
|
|
3125
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling PATCH /customers/{id}/customer-units/{externalCustomerUnitId}.");
|
|
3126
|
+
case "unknown":
|
|
3127
|
+
throw new errors.PaidError({
|
|
3128
|
+
message: _response.error.errorMessage,
|
|
3129
|
+
rawResponse: _response.rawResponse,
|
|
3130
|
+
});
|
|
3131
|
+
}
|
|
3132
|
+
});
|
|
3133
|
+
}
|
|
3134
|
+
/**
|
|
3135
|
+
* Lists the aliases that land signals on this unit. A customer-level alias (created on the customer routes) points at the customer's root unit, so it is listed under the root. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
|
|
3136
|
+
*
|
|
3137
|
+
* @param {Paid.ListCustomerUnitAliasesRequest} request
|
|
3138
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
3139
|
+
*
|
|
3140
|
+
* @throws {@link Paid.BadRequestError}
|
|
3141
|
+
* @throws {@link Paid.ForbiddenError}
|
|
3142
|
+
* @throws {@link Paid.NotFoundError}
|
|
3143
|
+
* @throws {@link Paid.InternalServerError}
|
|
3144
|
+
*
|
|
3145
|
+
* @example
|
|
3146
|
+
* await client.customers.listCustomerUnitAliases({
|
|
3147
|
+
* id: "cus_abc123",
|
|
3148
|
+
* externalCustomerUnitId: "team-research"
|
|
3149
|
+
* })
|
|
3150
|
+
*/
|
|
3151
|
+
listCustomerUnitAliases(request, requestOptions) {
|
|
3152
|
+
return core.HttpResponsePromise.fromPromise(this.__listCustomerUnitAliases(request, requestOptions));
|
|
3153
|
+
}
|
|
3154
|
+
__listCustomerUnitAliases(request, requestOptions) {
|
|
3155
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3156
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3157
|
+
const { id, externalCustomerUnitId, limit, offset } = request;
|
|
3158
|
+
const _queryParams = {};
|
|
3159
|
+
if (limit != null) {
|
|
3160
|
+
_queryParams.limit = limit.toString();
|
|
3161
|
+
}
|
|
3162
|
+
if (offset != null) {
|
|
3163
|
+
_queryParams.offset = offset.toString();
|
|
3164
|
+
}
|
|
3165
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3166
|
+
const _response = yield core.fetcher({
|
|
3167
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/aliases`),
|
|
3168
|
+
method: "GET",
|
|
3169
|
+
headers: _headers,
|
|
3170
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
3171
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
3172
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
3173
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3174
|
+
});
|
|
3175
|
+
if (_response.ok) {
|
|
3176
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
3177
|
+
}
|
|
3178
|
+
if (_response.error.reason === "status-code") {
|
|
3179
|
+
switch (_response.error.statusCode) {
|
|
3180
|
+
case 400:
|
|
3181
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
3182
|
+
case 403:
|
|
3183
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3184
|
+
case 404:
|
|
3185
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3186
|
+
case 500:
|
|
3187
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
3188
|
+
default:
|
|
3189
|
+
throw new errors.PaidError({
|
|
3190
|
+
statusCode: _response.error.statusCode,
|
|
3191
|
+
body: _response.error.body,
|
|
3192
|
+
rawResponse: _response.rawResponse,
|
|
3193
|
+
});
|
|
3194
|
+
}
|
|
3195
|
+
}
|
|
3196
|
+
switch (_response.error.reason) {
|
|
3197
|
+
case "non-json":
|
|
3198
|
+
throw new errors.PaidError({
|
|
3199
|
+
statusCode: _response.error.statusCode,
|
|
3200
|
+
body: _response.error.rawBody,
|
|
3201
|
+
rawResponse: _response.rawResponse,
|
|
3202
|
+
});
|
|
3203
|
+
case "timeout":
|
|
3204
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}/customer-units/{externalCustomerUnitId}/aliases.");
|
|
3205
|
+
case "unknown":
|
|
3206
|
+
throw new errors.PaidError({
|
|
3207
|
+
message: _response.error.errorMessage,
|
|
3208
|
+
rawResponse: _response.rawResponse,
|
|
3209
|
+
});
|
|
3210
|
+
}
|
|
3211
|
+
});
|
|
3212
|
+
}
|
|
3213
|
+
/**
|
|
3214
|
+
* Creates an alias that lands signals on this unit: a signal whose `externalCustomerId` is the alias resolves to this customer and, when it names no `customerUnit`, to this unit. The alias shares one set of ids with customer external ids and unit ids, unique within the organization and ignoring letter case: an alias another customer holds is refused with `409 EXTERNAL_ID_IN_USE`. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
|
|
3215
|
+
*
|
|
3216
|
+
* @param {Paid.CreateCustomerUnitAliasRequest} request
|
|
3217
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
3218
|
+
*
|
|
3219
|
+
* @throws {@link Paid.BadRequestError}
|
|
3220
|
+
* @throws {@link Paid.ForbiddenError}
|
|
3221
|
+
* @throws {@link Paid.NotFoundError}
|
|
3222
|
+
* @throws {@link Paid.ConflictError}
|
|
3223
|
+
* @throws {@link Paid.InternalServerError}
|
|
3224
|
+
*
|
|
3225
|
+
* @example
|
|
3226
|
+
* await client.customers.createCustomerUnitAlias({
|
|
3227
|
+
* id: "cus_abc123",
|
|
3228
|
+
* externalCustomerUnitId: "team-research",
|
|
3229
|
+
* body: {
|
|
3230
|
+
* alias: "child-customer-1"
|
|
3231
|
+
* }
|
|
3232
|
+
* })
|
|
3233
|
+
*/
|
|
3234
|
+
createCustomerUnitAlias(request, requestOptions) {
|
|
3235
|
+
return core.HttpResponsePromise.fromPromise(this.__createCustomerUnitAlias(request, requestOptions));
|
|
3236
|
+
}
|
|
3237
|
+
__createCustomerUnitAlias(request, requestOptions) {
|
|
3238
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3239
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3240
|
+
const { id, externalCustomerUnitId, body: _body } = request;
|
|
3241
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3242
|
+
const _response = yield core.fetcher({
|
|
3243
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/aliases`),
|
|
3244
|
+
method: "POST",
|
|
3245
|
+
headers: _headers,
|
|
3246
|
+
contentType: "application/json",
|
|
3247
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
3248
|
+
requestType: "json",
|
|
3249
|
+
body: _body,
|
|
3250
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
3251
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
3252
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3253
|
+
});
|
|
3254
|
+
if (_response.ok) {
|
|
3255
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
3256
|
+
}
|
|
3257
|
+
if (_response.error.reason === "status-code") {
|
|
3258
|
+
switch (_response.error.statusCode) {
|
|
3259
|
+
case 400:
|
|
3260
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
3261
|
+
case 403:
|
|
3262
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3263
|
+
case 404:
|
|
3264
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3265
|
+
case 409:
|
|
3266
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
3267
|
+
case 500:
|
|
3268
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
3269
|
+
default:
|
|
3270
|
+
throw new errors.PaidError({
|
|
3271
|
+
statusCode: _response.error.statusCode,
|
|
3272
|
+
body: _response.error.body,
|
|
3273
|
+
rawResponse: _response.rawResponse,
|
|
3274
|
+
});
|
|
3275
|
+
}
|
|
3276
|
+
}
|
|
3277
|
+
switch (_response.error.reason) {
|
|
3278
|
+
case "non-json":
|
|
3279
|
+
throw new errors.PaidError({
|
|
3280
|
+
statusCode: _response.error.statusCode,
|
|
3281
|
+
body: _response.error.rawBody,
|
|
3282
|
+
rawResponse: _response.rawResponse,
|
|
3283
|
+
});
|
|
3284
|
+
case "timeout":
|
|
3285
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers/{id}/customer-units/{externalCustomerUnitId}/aliases.");
|
|
3286
|
+
case "unknown":
|
|
3287
|
+
throw new errors.PaidError({
|
|
3288
|
+
message: _response.error.errorMessage,
|
|
3289
|
+
rawResponse: _response.rawResponse,
|
|
3290
|
+
});
|
|
3291
|
+
}
|
|
3292
|
+
});
|
|
3293
|
+
}
|
|
3294
|
+
/**
|
|
3295
|
+
* Deletes an alias of this unit. Signals still sent with it then resolve to nothing again. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
|
|
3296
|
+
*
|
|
3297
|
+
* @param {Paid.DeleteCustomerUnitAliasRequest} request
|
|
3298
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
3299
|
+
*
|
|
3300
|
+
* @throws {@link Paid.BadRequestError}
|
|
3301
|
+
* @throws {@link Paid.ForbiddenError}
|
|
3302
|
+
* @throws {@link Paid.NotFoundError}
|
|
3303
|
+
* @throws {@link Paid.InternalServerError}
|
|
3304
|
+
*
|
|
3305
|
+
* @example
|
|
3306
|
+
* await client.customers.deleteCustomerUnitAlias({
|
|
3307
|
+
* id: "cus_abc123",
|
|
3308
|
+
* externalCustomerUnitId: "team-research",
|
|
3309
|
+
* alias: "tenant-7-sandbox"
|
|
3310
|
+
* })
|
|
3311
|
+
*/
|
|
3312
|
+
deleteCustomerUnitAlias(request, requestOptions) {
|
|
3313
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCustomerUnitAlias(request, requestOptions));
|
|
3314
|
+
}
|
|
3315
|
+
__deleteCustomerUnitAlias(request, requestOptions) {
|
|
3316
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3317
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3318
|
+
const { id, externalCustomerUnitId, alias } = request;
|
|
3319
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3320
|
+
const _response = yield core.fetcher({
|
|
3321
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/aliases/${core.url.encodePathParam(alias)}`),
|
|
3322
|
+
method: "DELETE",
|
|
3323
|
+
headers: _headers,
|
|
3324
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
3325
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
3326
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
3327
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3328
|
+
});
|
|
3329
|
+
if (_response.ok) {
|
|
3330
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
3331
|
+
}
|
|
3332
|
+
if (_response.error.reason === "status-code") {
|
|
3333
|
+
switch (_response.error.statusCode) {
|
|
3334
|
+
case 400:
|
|
3335
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
3336
|
+
case 403:
|
|
3337
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3338
|
+
case 404:
|
|
3339
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3340
|
+
case 500:
|
|
3341
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
3342
|
+
default:
|
|
3343
|
+
throw new errors.PaidError({
|
|
3344
|
+
statusCode: _response.error.statusCode,
|
|
3345
|
+
body: _response.error.body,
|
|
3346
|
+
rawResponse: _response.rawResponse,
|
|
3347
|
+
});
|
|
3348
|
+
}
|
|
3349
|
+
}
|
|
3350
|
+
switch (_response.error.reason) {
|
|
3351
|
+
case "non-json":
|
|
3352
|
+
throw new errors.PaidError({
|
|
3353
|
+
statusCode: _response.error.statusCode,
|
|
3354
|
+
body: _response.error.rawBody,
|
|
3355
|
+
rawResponse: _response.rawResponse,
|
|
3356
|
+
});
|
|
3357
|
+
case "timeout":
|
|
3358
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/{id}/customer-units/{externalCustomerUnitId}/aliases/{alias}.");
|
|
3359
|
+
case "unknown":
|
|
3360
|
+
throw new errors.PaidError({
|
|
3361
|
+
message: _response.error.errorMessage,
|
|
3362
|
+
rawResponse: _response.rawResponse,
|
|
3363
|
+
});
|
|
3364
|
+
}
|
|
3365
|
+
});
|
|
3366
|
+
}
|
|
3367
|
+
/**
|
|
3368
|
+
* Returns a unit by its key without naming its customer. The answer carries the customer's ids (`customerId`, `customerExternalId`) so the customer routes are one hop away, but, like the create on this path, not Paid's unit id: a caller of these routes names units by key. The key is looked up across the organization ignoring letter case. When more than one unit carries it in another letter case (legacy duplicates across customers, or case variants on one customer), the exact spelling decides; when that does not single one out either, the answer is `409 CUSTOMER_UNIT_AMBIGUOUS`: use the customer's unit routes, where the key is exact.
|
|
3369
|
+
*
|
|
3370
|
+
* @param {Paid.GetCustomerUnitByKeyRequest} request
|
|
3371
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
3372
|
+
*
|
|
3373
|
+
* @throws {@link Paid.BadRequestError}
|
|
3374
|
+
* @throws {@link Paid.ForbiddenError}
|
|
3375
|
+
* @throws {@link Paid.NotFoundError}
|
|
3376
|
+
* @throws {@link Paid.ConflictError}
|
|
3377
|
+
* @throws {@link Paid.InternalServerError}
|
|
3378
|
+
*
|
|
3379
|
+
* @example
|
|
3380
|
+
* await client.customers.getCustomerUnitByKey({
|
|
3381
|
+
* externalCustomerUnitId: "team-research"
|
|
3382
|
+
* })
|
|
3383
|
+
*/
|
|
3384
|
+
getCustomerUnitByKey(request, requestOptions) {
|
|
3385
|
+
return core.HttpResponsePromise.fromPromise(this.__getCustomerUnitByKey(request, requestOptions));
|
|
3386
|
+
}
|
|
3387
|
+
__getCustomerUnitByKey(request, requestOptions) {
|
|
3388
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3389
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3390
|
+
const { externalCustomerUnitId } = request;
|
|
3391
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3392
|
+
const _response = yield core.fetcher({
|
|
3393
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customer-units/external/${core.url.encodePathParam(externalCustomerUnitId)}`),
|
|
3394
|
+
method: "GET",
|
|
3395
|
+
headers: _headers,
|
|
3396
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
3397
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
3398
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
3399
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3400
|
+
});
|
|
3401
|
+
if (_response.ok) {
|
|
3402
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
3403
|
+
}
|
|
3404
|
+
if (_response.error.reason === "status-code") {
|
|
3405
|
+
switch (_response.error.statusCode) {
|
|
3406
|
+
case 400:
|
|
3407
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
3408
|
+
case 403:
|
|
3409
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3410
|
+
case 404:
|
|
3411
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3412
|
+
case 409:
|
|
3413
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
3414
|
+
case 500:
|
|
3415
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
3416
|
+
default:
|
|
3417
|
+
throw new errors.PaidError({
|
|
3418
|
+
statusCode: _response.error.statusCode,
|
|
3419
|
+
body: _response.error.body,
|
|
3420
|
+
rawResponse: _response.rawResponse,
|
|
3421
|
+
});
|
|
3422
|
+
}
|
|
3423
|
+
}
|
|
3424
|
+
switch (_response.error.reason) {
|
|
3425
|
+
case "non-json":
|
|
3426
|
+
throw new errors.PaidError({
|
|
3427
|
+
statusCode: _response.error.statusCode,
|
|
3428
|
+
body: _response.error.rawBody,
|
|
3429
|
+
rawResponse: _response.rawResponse,
|
|
3430
|
+
});
|
|
3431
|
+
case "timeout":
|
|
3432
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customer-units/external/{externalCustomerUnitId}.");
|
|
3433
|
+
case "unknown":
|
|
3434
|
+
throw new errors.PaidError({
|
|
3435
|
+
message: _response.error.errorMessage,
|
|
3436
|
+
rawResponse: _response.rawResponse,
|
|
3437
|
+
});
|
|
3438
|
+
}
|
|
3439
|
+
});
|
|
3440
|
+
}
|
|
3441
|
+
/**
|
|
3442
|
+
* Lists the aliases that land signals on this unit, without naming its customer. The key is looked up across the organization ignoring letter case. When more than one unit carries it in another letter case (legacy duplicates across customers, or case variants on one customer), the exact spelling decides; when that does not single one out either, the answer is `409 CUSTOMER_UNIT_AMBIGUOUS`: use the customer's unit routes, where the key is exact.
|
|
3443
|
+
*
|
|
3444
|
+
* @param {Paid.ListCustomerUnitAliasesByKeyRequest} request
|
|
3445
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
3446
|
+
*
|
|
3447
|
+
* @throws {@link Paid.BadRequestError}
|
|
3448
|
+
* @throws {@link Paid.ForbiddenError}
|
|
3449
|
+
* @throws {@link Paid.NotFoundError}
|
|
3450
|
+
* @throws {@link Paid.ConflictError}
|
|
3451
|
+
* @throws {@link Paid.InternalServerError}
|
|
3452
|
+
*
|
|
3453
|
+
* @example
|
|
3454
|
+
* await client.customers.listCustomerUnitAliasesByKey({
|
|
3455
|
+
* externalCustomerUnitId: "team-research"
|
|
3456
|
+
* })
|
|
3457
|
+
*/
|
|
3458
|
+
listCustomerUnitAliasesByKey(request, requestOptions) {
|
|
3459
|
+
return core.HttpResponsePromise.fromPromise(this.__listCustomerUnitAliasesByKey(request, requestOptions));
|
|
3460
|
+
}
|
|
3461
|
+
__listCustomerUnitAliasesByKey(request, requestOptions) {
|
|
3462
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3463
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3464
|
+
const { externalCustomerUnitId, limit, offset } = request;
|
|
3465
|
+
const _queryParams = {};
|
|
3466
|
+
if (limit != null) {
|
|
3467
|
+
_queryParams.limit = limit.toString();
|
|
3468
|
+
}
|
|
3469
|
+
if (offset != null) {
|
|
3470
|
+
_queryParams.offset = offset.toString();
|
|
3471
|
+
}
|
|
3472
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3473
|
+
const _response = yield core.fetcher({
|
|
3474
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customer-units/external/${core.url.encodePathParam(externalCustomerUnitId)}/aliases`),
|
|
3475
|
+
method: "GET",
|
|
3476
|
+
headers: _headers,
|
|
3477
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
3478
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
3479
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
3480
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3481
|
+
});
|
|
3482
|
+
if (_response.ok) {
|
|
3483
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
3484
|
+
}
|
|
3485
|
+
if (_response.error.reason === "status-code") {
|
|
3486
|
+
switch (_response.error.statusCode) {
|
|
3487
|
+
case 400:
|
|
3488
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
3489
|
+
case 403:
|
|
3490
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3491
|
+
case 404:
|
|
3492
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3493
|
+
case 409:
|
|
3494
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
3495
|
+
case 500:
|
|
3496
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
3497
|
+
default:
|
|
3498
|
+
throw new errors.PaidError({
|
|
3499
|
+
statusCode: _response.error.statusCode,
|
|
3500
|
+
body: _response.error.body,
|
|
3501
|
+
rawResponse: _response.rawResponse,
|
|
3502
|
+
});
|
|
3503
|
+
}
|
|
3504
|
+
}
|
|
3505
|
+
switch (_response.error.reason) {
|
|
3506
|
+
case "non-json":
|
|
3507
|
+
throw new errors.PaidError({
|
|
3508
|
+
statusCode: _response.error.statusCode,
|
|
3509
|
+
body: _response.error.rawBody,
|
|
3510
|
+
rawResponse: _response.rawResponse,
|
|
3511
|
+
});
|
|
3512
|
+
case "timeout":
|
|
3513
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customer-units/external/{externalCustomerUnitId}/aliases.");
|
|
3514
|
+
case "unknown":
|
|
3515
|
+
throw new errors.PaidError({
|
|
3516
|
+
message: _response.error.errorMessage,
|
|
3517
|
+
rawResponse: _response.rawResponse,
|
|
3518
|
+
});
|
|
3519
|
+
}
|
|
3520
|
+
});
|
|
3521
|
+
}
|
|
3522
|
+
/**
|
|
3523
|
+
* Creates an alias that lands signals on this unit, without naming its customer: a signal whose `externalCustomerId` is the alias resolves to the unit's customer and is attributed to this unit. The alias must be unique within the organization ignoring letter case (`409 EXTERNAL_ID_IN_USE`). The key is looked up across the organization ignoring letter case. When more than one unit carries it in another letter case (legacy duplicates across customers, or case variants on one customer), the exact spelling decides; when that does not single one out either, the answer is `409 CUSTOMER_UNIT_AMBIGUOUS`: use the customer's unit routes, where the key is exact.
|
|
3524
|
+
*
|
|
3525
|
+
* @param {Paid.CreateCustomerUnitAliasByKeyRequest} request
|
|
3526
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
3527
|
+
*
|
|
3528
|
+
* @throws {@link Paid.BadRequestError}
|
|
3529
|
+
* @throws {@link Paid.ForbiddenError}
|
|
3530
|
+
* @throws {@link Paid.NotFoundError}
|
|
3531
|
+
* @throws {@link Paid.ConflictError}
|
|
3532
|
+
* @throws {@link Paid.InternalServerError}
|
|
3533
|
+
*
|
|
3534
|
+
* @example
|
|
3535
|
+
* await client.customers.createCustomerUnitAliasByKey({
|
|
3536
|
+
* externalCustomerUnitId: "team-research",
|
|
3537
|
+
* body: {
|
|
3538
|
+
* alias: "child-customer-1"
|
|
3539
|
+
* }
|
|
3540
|
+
* })
|
|
3541
|
+
*/
|
|
3542
|
+
createCustomerUnitAliasByKey(request, requestOptions) {
|
|
3543
|
+
return core.HttpResponsePromise.fromPromise(this.__createCustomerUnitAliasByKey(request, requestOptions));
|
|
3544
|
+
}
|
|
3545
|
+
__createCustomerUnitAliasByKey(request, requestOptions) {
|
|
3546
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3547
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3548
|
+
const { externalCustomerUnitId, body: _body } = request;
|
|
3549
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3550
|
+
const _response = yield core.fetcher({
|
|
3551
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customer-units/external/${core.url.encodePathParam(externalCustomerUnitId)}/aliases`),
|
|
3552
|
+
method: "POST",
|
|
3553
|
+
headers: _headers,
|
|
3554
|
+
contentType: "application/json",
|
|
3555
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
3556
|
+
requestType: "json",
|
|
3557
|
+
body: _body,
|
|
3558
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
3559
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
3560
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3561
|
+
});
|
|
3562
|
+
if (_response.ok) {
|
|
3563
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
3564
|
+
}
|
|
3565
|
+
if (_response.error.reason === "status-code") {
|
|
3566
|
+
switch (_response.error.statusCode) {
|
|
3567
|
+
case 400:
|
|
3568
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
3569
|
+
case 403:
|
|
3570
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3571
|
+
case 404:
|
|
3572
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3573
|
+
case 409:
|
|
3574
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
3575
|
+
case 500:
|
|
3576
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
3577
|
+
default:
|
|
3578
|
+
throw new errors.PaidError({
|
|
3579
|
+
statusCode: _response.error.statusCode,
|
|
3580
|
+
body: _response.error.body,
|
|
3581
|
+
rawResponse: _response.rawResponse,
|
|
3582
|
+
});
|
|
3583
|
+
}
|
|
3584
|
+
}
|
|
3585
|
+
switch (_response.error.reason) {
|
|
3586
|
+
case "non-json":
|
|
3587
|
+
throw new errors.PaidError({
|
|
3588
|
+
statusCode: _response.error.statusCode,
|
|
3589
|
+
body: _response.error.rawBody,
|
|
3590
|
+
rawResponse: _response.rawResponse,
|
|
3591
|
+
});
|
|
3592
|
+
case "timeout":
|
|
3593
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customer-units/external/{externalCustomerUnitId}/aliases.");
|
|
3594
|
+
case "unknown":
|
|
3595
|
+
throw new errors.PaidError({
|
|
3596
|
+
message: _response.error.errorMessage,
|
|
3597
|
+
rawResponse: _response.rawResponse,
|
|
3598
|
+
});
|
|
3599
|
+
}
|
|
3600
|
+
});
|
|
3601
|
+
}
|
|
3602
|
+
/**
|
|
3603
|
+
* Deletes an alias of this unit, without naming its customer. Signals still sent with it then resolve to nothing again. The key is looked up across the organization ignoring letter case. When more than one unit carries it in another letter case (legacy duplicates across customers, or case variants on one customer), the exact spelling decides; when that does not single one out either, the answer is `409 CUSTOMER_UNIT_AMBIGUOUS`: use the customer's unit routes, where the key is exact.
|
|
3604
|
+
*
|
|
3605
|
+
* @param {Paid.DeleteCustomerUnitAliasByKeyRequest} request
|
|
3606
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
3607
|
+
*
|
|
3608
|
+
* @throws {@link Paid.BadRequestError}
|
|
3609
|
+
* @throws {@link Paid.ForbiddenError}
|
|
3610
|
+
* @throws {@link Paid.NotFoundError}
|
|
3611
|
+
* @throws {@link Paid.ConflictError}
|
|
3612
|
+
* @throws {@link Paid.InternalServerError}
|
|
3613
|
+
*
|
|
3614
|
+
* @example
|
|
3615
|
+
* await client.customers.deleteCustomerUnitAliasByKey({
|
|
3616
|
+
* externalCustomerUnitId: "team-research",
|
|
3617
|
+
* alias: "tenant-7"
|
|
3618
|
+
* })
|
|
3619
|
+
*/
|
|
3620
|
+
deleteCustomerUnitAliasByKey(request, requestOptions) {
|
|
3621
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCustomerUnitAliasByKey(request, requestOptions));
|
|
3622
|
+
}
|
|
3623
|
+
__deleteCustomerUnitAliasByKey(request, requestOptions) {
|
|
3624
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3625
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3626
|
+
const { externalCustomerUnitId, alias } = request;
|
|
3627
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3628
|
+
const _response = yield core.fetcher({
|
|
3629
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customer-units/external/${core.url.encodePathParam(externalCustomerUnitId)}/aliases/${core.url.encodePathParam(alias)}`),
|
|
3630
|
+
method: "DELETE",
|
|
3631
|
+
headers: _headers,
|
|
3632
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
3633
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
3634
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
3635
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3636
|
+
});
|
|
3637
|
+
if (_response.ok) {
|
|
3638
|
+
return {
|
|
3639
|
+
data: _response.body,
|
|
3640
|
+
rawResponse: _response.rawResponse,
|
|
3641
|
+
};
|
|
3642
|
+
}
|
|
3643
|
+
if (_response.error.reason === "status-code") {
|
|
3644
|
+
switch (_response.error.statusCode) {
|
|
3645
|
+
case 400:
|
|
3646
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
3647
|
+
case 403:
|
|
3648
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3649
|
+
case 404:
|
|
3650
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3651
|
+
case 409:
|
|
3652
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
3653
|
+
case 500:
|
|
3654
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
3655
|
+
default:
|
|
3656
|
+
throw new errors.PaidError({
|
|
3657
|
+
statusCode: _response.error.statusCode,
|
|
3658
|
+
body: _response.error.body,
|
|
3659
|
+
rawResponse: _response.rawResponse,
|
|
3660
|
+
});
|
|
3661
|
+
}
|
|
3662
|
+
}
|
|
3663
|
+
switch (_response.error.reason) {
|
|
3664
|
+
case "non-json":
|
|
3665
|
+
throw new errors.PaidError({
|
|
3666
|
+
statusCode: _response.error.statusCode,
|
|
3667
|
+
body: _response.error.rawBody,
|
|
3668
|
+
rawResponse: _response.rawResponse,
|
|
3669
|
+
});
|
|
3670
|
+
case "timeout":
|
|
3671
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customer-units/external/{externalCustomerUnitId}/aliases/{alias}.");
|
|
3672
|
+
case "unknown":
|
|
3673
|
+
throw new errors.PaidError({
|
|
3674
|
+
message: _response.error.errorMessage,
|
|
3675
|
+
rawResponse: _response.rawResponse,
|
|
3676
|
+
});
|
|
3677
|
+
}
|
|
3678
|
+
});
|
|
3679
|
+
}
|
|
3680
|
+
/**
|
|
3681
|
+
* Creates a unit by naming its parent alone; the customer is whoever the parent belongs to, so a caller that only knows its own ids never needs the customer routes. `parentExternalId` is looked up across the organization, ignoring letter case, among unit ids, customer external ids and aliases: a unit becomes the parent; a customer (by external id or alias) stands for the top of its tree, so the new unit goes under the root unit, or becomes the root when the customer has none. The parent is only ever named by your id, never by a Paid id, so a customer with no external id takes its units through the customer's unit routes. The answer carries the unit's `externalId` and its customer's ids, not Paid's unit id. `externalId` follows the same rules as on the customer-scoped create: required, immutable, unique within the organization ignoring letter case. `409 PARENT_NOT_FOUND` when nothing matches, `PARENT_NOT_ACTIVE` for a deleted or draft parent, `PARENT_AMBIGUOUS` when legacy rows let the id name more than one customer (use that customer's unit routes), `PARENT_CHANGED` when the reference pointed elsewhere by the time the create ran (send it again), and otherwise the customer-scoped create's 409s (`CUSTOMER_UNIT_EXISTS`, `EXTERNAL_ID_IN_USE`, `DEPTH_EXCEEDED`, `SEAT_BILLING`, and `ROOT_UNIT_ALWAYS_BILLABLE` for `billable: false` on a unit that would become the root). `403 FEATURE_NOT_ENABLED` for `billable: false` when non-billable units are not enabled for your organization.
|
|
3682
|
+
*
|
|
3683
|
+
* @param {Paid.CustomerUnitCreateUnderParent} request
|
|
3684
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
3685
|
+
*
|
|
3686
|
+
* @throws {@link Paid.BadRequestError}
|
|
3687
|
+
* @throws {@link Paid.ForbiddenError}
|
|
3688
|
+
* @throws {@link Paid.ConflictError}
|
|
3689
|
+
* @throws {@link Paid.InternalServerError}
|
|
3690
|
+
*
|
|
3691
|
+
* @example
|
|
3692
|
+
* await client.customers.createCustomerUnitUnderParent({
|
|
3693
|
+
* externalId: "team-research",
|
|
3694
|
+
* parentExternalId: "dept-rnd"
|
|
3695
|
+
* })
|
|
3696
|
+
*/
|
|
3697
|
+
createCustomerUnitUnderParent(request, requestOptions) {
|
|
3698
|
+
return core.HttpResponsePromise.fromPromise(this.__createCustomerUnitUnderParent(request, requestOptions));
|
|
3699
|
+
}
|
|
3700
|
+
__createCustomerUnitUnderParent(request, requestOptions) {
|
|
3701
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3702
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3703
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3704
|
+
const _response = yield core.fetcher({
|
|
3705
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, "customer-units/"),
|
|
3706
|
+
method: "POST",
|
|
3707
|
+
headers: _headers,
|
|
3708
|
+
contentType: "application/json",
|
|
3709
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
3710
|
+
requestType: "json",
|
|
3711
|
+
body: request,
|
|
3712
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
3713
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
3714
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3715
|
+
});
|
|
3716
|
+
if (_response.ok) {
|
|
3717
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
3718
|
+
}
|
|
3719
|
+
if (_response.error.reason === "status-code") {
|
|
3720
|
+
switch (_response.error.statusCode) {
|
|
3721
|
+
case 400:
|
|
3722
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
3723
|
+
case 403:
|
|
3724
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3725
|
+
case 409:
|
|
3726
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
3727
|
+
case 500:
|
|
3728
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
3729
|
+
default:
|
|
3730
|
+
throw new errors.PaidError({
|
|
3731
|
+
statusCode: _response.error.statusCode,
|
|
3732
|
+
body: _response.error.body,
|
|
3733
|
+
rawResponse: _response.rawResponse,
|
|
3734
|
+
});
|
|
3735
|
+
}
|
|
3736
|
+
}
|
|
3737
|
+
switch (_response.error.reason) {
|
|
3738
|
+
case "non-json":
|
|
3739
|
+
throw new errors.PaidError({
|
|
3740
|
+
statusCode: _response.error.statusCode,
|
|
3741
|
+
body: _response.error.rawBody,
|
|
3742
|
+
rawResponse: _response.rawResponse,
|
|
3743
|
+
});
|
|
3744
|
+
case "timeout":
|
|
3745
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customer-units/.");
|
|
3746
|
+
case "unknown":
|
|
3747
|
+
throw new errors.PaidError({
|
|
3748
|
+
message: _response.error.errorMessage,
|
|
3749
|
+
rawResponse: _response.rawResponse,
|
|
3750
|
+
});
|
|
3751
|
+
}
|
|
3752
|
+
});
|
|
3753
|
+
}
|
|
3754
|
+
/**
|
|
3755
|
+
* Lists this customer's API keys, newest first and paginated, revoked and expired ones included. The secret is never returned; `keyPrefix` and `last4` identify each key. Addresses the customer by your external customer id.
|
|
3756
|
+
*
|
|
3757
|
+
* @param {Paid.ListCustomerApiKeysByExternalIdRequest} request
|
|
3758
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
3759
|
+
*
|
|
3760
|
+
* @throws {@link Paid.BadRequestError}
|
|
3761
|
+
* @throws {@link Paid.ForbiddenError}
|
|
3762
|
+
* @throws {@link Paid.NotFoundError}
|
|
3763
|
+
* @throws {@link Paid.InternalServerError}
|
|
3764
|
+
*
|
|
3765
|
+
* @example
|
|
3766
|
+
* await client.customers.listCustomerApiKeysByExternalId({
|
|
3767
|
+
* externalId: "customer_123"
|
|
3768
|
+
* })
|
|
3769
|
+
*/
|
|
3770
|
+
listCustomerApiKeysByExternalId(request, requestOptions) {
|
|
3771
|
+
return core.HttpResponsePromise.fromPromise(this.__listCustomerApiKeysByExternalId(request, requestOptions));
|
|
3772
|
+
}
|
|
3773
|
+
__listCustomerApiKeysByExternalId(request, requestOptions) {
|
|
3774
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3775
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3776
|
+
const { externalId, limit, offset } = request;
|
|
3777
|
+
const _queryParams = {};
|
|
3778
|
+
if (limit != null) {
|
|
3779
|
+
_queryParams.limit = limit.toString();
|
|
3780
|
+
}
|
|
3781
|
+
if (offset != null) {
|
|
3782
|
+
_queryParams.offset = offset.toString();
|
|
3783
|
+
}
|
|
3784
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3785
|
+
const _response = yield core.fetcher({
|
|
3786
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/api-keys`),
|
|
3787
|
+
method: "GET",
|
|
3788
|
+
headers: _headers,
|
|
3789
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
3790
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
3791
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
3792
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3793
|
+
});
|
|
3794
|
+
if (_response.ok) {
|
|
3795
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
3796
|
+
}
|
|
3797
|
+
if (_response.error.reason === "status-code") {
|
|
3798
|
+
switch (_response.error.statusCode) {
|
|
3799
|
+
case 400:
|
|
3800
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
3801
|
+
case 403:
|
|
3802
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3803
|
+
case 404:
|
|
3804
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3805
|
+
case 500:
|
|
3806
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
3807
|
+
default:
|
|
3808
|
+
throw new errors.PaidError({
|
|
3809
|
+
statusCode: _response.error.statusCode,
|
|
3810
|
+
body: _response.error.body,
|
|
3811
|
+
rawResponse: _response.rawResponse,
|
|
3812
|
+
});
|
|
3813
|
+
}
|
|
3814
|
+
}
|
|
3815
|
+
switch (_response.error.reason) {
|
|
3816
|
+
case "non-json":
|
|
3817
|
+
throw new errors.PaidError({
|
|
3818
|
+
statusCode: _response.error.statusCode,
|
|
3819
|
+
body: _response.error.rawBody,
|
|
3820
|
+
rawResponse: _response.rawResponse,
|
|
3821
|
+
});
|
|
3822
|
+
case "timeout":
|
|
3823
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}/api-keys.");
|
|
3824
|
+
case "unknown":
|
|
3825
|
+
throw new errors.PaidError({
|
|
3826
|
+
message: _response.error.errorMessage,
|
|
3827
|
+
rawResponse: _response.rawResponse,
|
|
3828
|
+
});
|
|
3829
|
+
}
|
|
3830
|
+
});
|
|
3831
|
+
}
|
|
3832
|
+
/**
|
|
3833
|
+
* Creates an API key bound to this customer. The response carries the secret in `key`, returned only this once: store it immediately, as Paid keeps only its hash. The key acts for this customer alone: it can send signals for this customer through `POST /api/v2/signals/bulk`, and every other route refuses it. Requires `write:api-keys`, which full-access keys hold; a restricted key needs the scope granted explicitly. Addresses the customer by your external customer id.
|
|
3834
|
+
*
|
|
3835
|
+
* @param {Paid.CreateCustomerApiKeyByExternalIdRequest} request
|
|
3836
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
3837
|
+
*
|
|
3838
|
+
* @throws {@link Paid.BadRequestError}
|
|
3839
|
+
* @throws {@link Paid.ForbiddenError}
|
|
3840
|
+
* @throws {@link Paid.NotFoundError}
|
|
3841
|
+
* @throws {@link Paid.InternalServerError}
|
|
3842
|
+
*
|
|
3843
|
+
* @example
|
|
3844
|
+
* await client.customers.createCustomerApiKeyByExternalId({
|
|
3845
|
+
* externalId: "customer_123",
|
|
3846
|
+
* body: {
|
|
3847
|
+
* name: "Tenant runtime (production)"
|
|
3848
|
+
* }
|
|
3849
|
+
* })
|
|
3850
|
+
*/
|
|
3851
|
+
createCustomerApiKeyByExternalId(request, requestOptions) {
|
|
3852
|
+
return core.HttpResponsePromise.fromPromise(this.__createCustomerApiKeyByExternalId(request, requestOptions));
|
|
3853
|
+
}
|
|
3854
|
+
__createCustomerApiKeyByExternalId(request, requestOptions) {
|
|
3855
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3856
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3857
|
+
const { externalId, body: _body } = request;
|
|
3858
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3859
|
+
const _response = yield core.fetcher({
|
|
3860
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/api-keys`),
|
|
3861
|
+
method: "POST",
|
|
3862
|
+
headers: _headers,
|
|
3863
|
+
contentType: "application/json",
|
|
3864
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
3865
|
+
requestType: "json",
|
|
3866
|
+
body: _body,
|
|
3867
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
3868
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
3869
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3870
|
+
});
|
|
3871
|
+
if (_response.ok) {
|
|
3872
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
3873
|
+
}
|
|
3874
|
+
if (_response.error.reason === "status-code") {
|
|
3875
|
+
switch (_response.error.statusCode) {
|
|
3876
|
+
case 400:
|
|
3877
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
3878
|
+
case 403:
|
|
3879
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3880
|
+
case 404:
|
|
3881
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3882
|
+
case 500:
|
|
3883
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
3884
|
+
default:
|
|
3885
|
+
throw new errors.PaidError({
|
|
3886
|
+
statusCode: _response.error.statusCode,
|
|
3887
|
+
body: _response.error.body,
|
|
3888
|
+
rawResponse: _response.rawResponse,
|
|
3889
|
+
});
|
|
3890
|
+
}
|
|
3891
|
+
}
|
|
3892
|
+
switch (_response.error.reason) {
|
|
3893
|
+
case "non-json":
|
|
3894
|
+
throw new errors.PaidError({
|
|
3895
|
+
statusCode: _response.error.statusCode,
|
|
3896
|
+
body: _response.error.rawBody,
|
|
3897
|
+
rawResponse: _response.rawResponse,
|
|
3898
|
+
});
|
|
3899
|
+
case "timeout":
|
|
3900
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers/external/{externalId}/api-keys.");
|
|
3901
|
+
case "unknown":
|
|
3902
|
+
throw new errors.PaidError({
|
|
3903
|
+
message: _response.error.errorMessage,
|
|
3904
|
+
rawResponse: _response.rawResponse,
|
|
3905
|
+
});
|
|
3906
|
+
}
|
|
3907
|
+
});
|
|
3908
|
+
}
|
|
3909
|
+
/**
|
|
3910
|
+
* Revokes one of this customer's keys, which then stops authenticating. Keys are never deleted: a revoked key stays listed with `revokedAt` set, and deleting the customer revokes its keys too. Revoking an already revoked key returns it unchanged. `404` when the key does not belong to this customer. Addresses the customer by your external customer id.
|
|
3911
|
+
*
|
|
3912
|
+
* @param {Paid.RevokeCustomerApiKeyByExternalIdRequest} request
|
|
3913
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
3914
|
+
*
|
|
3915
|
+
* @throws {@link Paid.BadRequestError}
|
|
3916
|
+
* @throws {@link Paid.ForbiddenError}
|
|
3917
|
+
* @throws {@link Paid.NotFoundError}
|
|
3918
|
+
* @throws {@link Paid.InternalServerError}
|
|
3919
|
+
*
|
|
3920
|
+
* @example
|
|
3921
|
+
* await client.customers.revokeCustomerApiKeyByExternalId({
|
|
3922
|
+
* externalId: "customer_123",
|
|
3923
|
+
* apiKeyId: "apiKeyId"
|
|
3924
|
+
* })
|
|
3925
|
+
*/
|
|
3926
|
+
revokeCustomerApiKeyByExternalId(request, requestOptions) {
|
|
3927
|
+
return core.HttpResponsePromise.fromPromise(this.__revokeCustomerApiKeyByExternalId(request, requestOptions));
|
|
3928
|
+
}
|
|
3929
|
+
__revokeCustomerApiKeyByExternalId(request, requestOptions) {
|
|
3930
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3931
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3932
|
+
const { externalId, apiKeyId } = request;
|
|
3933
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
3934
|
+
const _response = yield core.fetcher({
|
|
3935
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/api-keys/${core.url.encodePathParam(apiKeyId)}`),
|
|
3936
|
+
method: "DELETE",
|
|
3937
|
+
headers: _headers,
|
|
3938
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
3939
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
3940
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
3941
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3942
|
+
});
|
|
3943
|
+
if (_response.ok) {
|
|
3944
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
3945
|
+
}
|
|
3946
|
+
if (_response.error.reason === "status-code") {
|
|
3947
|
+
switch (_response.error.statusCode) {
|
|
3948
|
+
case 400:
|
|
3949
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
3950
|
+
case 403:
|
|
3951
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
3952
|
+
case 404:
|
|
3953
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
3954
|
+
case 500:
|
|
3955
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
3956
|
+
default:
|
|
3957
|
+
throw new errors.PaidError({
|
|
3958
|
+
statusCode: _response.error.statusCode,
|
|
3959
|
+
body: _response.error.body,
|
|
3960
|
+
rawResponse: _response.rawResponse,
|
|
3961
|
+
});
|
|
3962
|
+
}
|
|
3963
|
+
}
|
|
3964
|
+
switch (_response.error.reason) {
|
|
3965
|
+
case "non-json":
|
|
3966
|
+
throw new errors.PaidError({
|
|
3967
|
+
statusCode: _response.error.statusCode,
|
|
3968
|
+
body: _response.error.rawBody,
|
|
3969
|
+
rawResponse: _response.rawResponse,
|
|
3970
|
+
});
|
|
3971
|
+
case "timeout":
|
|
3972
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/external/{externalId}/api-keys/{apiKeyId}.");
|
|
3973
|
+
case "unknown":
|
|
3974
|
+
throw new errors.PaidError({
|
|
3975
|
+
message: _response.error.errorMessage,
|
|
3976
|
+
rawResponse: _response.rawResponse,
|
|
3977
|
+
});
|
|
3978
|
+
}
|
|
3979
|
+
});
|
|
3980
|
+
}
|
|
3981
|
+
/**
|
|
3982
|
+
* Lists this customer's API keys, newest first and paginated, revoked and expired ones included. The secret is never returned; `keyPrefix` and `last4` identify each key. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
|
|
3983
|
+
*
|
|
3984
|
+
* @param {Paid.ListCustomerApiKeysRequest} request
|
|
3985
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
3986
|
+
*
|
|
3987
|
+
* @throws {@link Paid.BadRequestError}
|
|
3988
|
+
* @throws {@link Paid.ForbiddenError}
|
|
3989
|
+
* @throws {@link Paid.NotFoundError}
|
|
3990
|
+
* @throws {@link Paid.InternalServerError}
|
|
3991
|
+
*
|
|
3992
|
+
* @example
|
|
3993
|
+
* await client.customers.listCustomerApiKeys({
|
|
3994
|
+
* id: "cus_abc123"
|
|
3995
|
+
* })
|
|
3996
|
+
*/
|
|
3997
|
+
listCustomerApiKeys(request, requestOptions) {
|
|
3998
|
+
return core.HttpResponsePromise.fromPromise(this.__listCustomerApiKeys(request, requestOptions));
|
|
3999
|
+
}
|
|
4000
|
+
__listCustomerApiKeys(request, requestOptions) {
|
|
4001
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4002
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4003
|
+
const { id, limit, offset } = request;
|
|
4004
|
+
const _queryParams = {};
|
|
4005
|
+
if (limit != null) {
|
|
4006
|
+
_queryParams.limit = limit.toString();
|
|
4007
|
+
}
|
|
4008
|
+
if (offset != null) {
|
|
4009
|
+
_queryParams.offset = offset.toString();
|
|
4010
|
+
}
|
|
4011
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
4012
|
+
const _response = yield core.fetcher({
|
|
4013
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/api-keys`),
|
|
4014
|
+
method: "GET",
|
|
4015
|
+
headers: _headers,
|
|
4016
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
4017
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
4018
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
4019
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
4020
|
+
});
|
|
4021
|
+
if (_response.ok) {
|
|
4022
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4023
|
+
}
|
|
4024
|
+
if (_response.error.reason === "status-code") {
|
|
4025
|
+
switch (_response.error.statusCode) {
|
|
4026
|
+
case 400:
|
|
4027
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
4028
|
+
case 403:
|
|
4029
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4030
|
+
case 404:
|
|
4031
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
4032
|
+
case 500:
|
|
4033
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
4034
|
+
default:
|
|
4035
|
+
throw new errors.PaidError({
|
|
4036
|
+
statusCode: _response.error.statusCode,
|
|
4037
|
+
body: _response.error.body,
|
|
4038
|
+
rawResponse: _response.rawResponse,
|
|
4039
|
+
});
|
|
4040
|
+
}
|
|
4041
|
+
}
|
|
4042
|
+
switch (_response.error.reason) {
|
|
4043
|
+
case "non-json":
|
|
4044
|
+
throw new errors.PaidError({
|
|
4045
|
+
statusCode: _response.error.statusCode,
|
|
4046
|
+
body: _response.error.rawBody,
|
|
4047
|
+
rawResponse: _response.rawResponse,
|
|
4048
|
+
});
|
|
4049
|
+
case "timeout":
|
|
4050
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}/api-keys.");
|
|
4051
|
+
case "unknown":
|
|
4052
|
+
throw new errors.PaidError({
|
|
4053
|
+
message: _response.error.errorMessage,
|
|
4054
|
+
rawResponse: _response.rawResponse,
|
|
4055
|
+
});
|
|
4056
|
+
}
|
|
4057
|
+
});
|
|
4058
|
+
}
|
|
4059
|
+
/**
|
|
4060
|
+
* Creates an API key bound to this customer. The response carries the secret in `key`, returned only this once: store it immediately, as Paid keeps only its hash. The key acts for this customer alone: it can send signals for this customer through `POST /api/v2/signals/bulk`, and every other route refuses it. Requires `write:api-keys`, which full-access keys hold; a restricted key needs the scope granted explicitly. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
|
|
4061
|
+
*
|
|
4062
|
+
* @param {Paid.CreateCustomerApiKeyRequest} request
|
|
4063
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
4064
|
+
*
|
|
4065
|
+
* @throws {@link Paid.BadRequestError}
|
|
4066
|
+
* @throws {@link Paid.ForbiddenError}
|
|
4067
|
+
* @throws {@link Paid.NotFoundError}
|
|
4068
|
+
* @throws {@link Paid.InternalServerError}
|
|
4069
|
+
*
|
|
4070
|
+
* @example
|
|
4071
|
+
* await client.customers.createCustomerApiKey({
|
|
4072
|
+
* id: "cus_abc123",
|
|
4073
|
+
* body: {
|
|
4074
|
+
* name: "Tenant runtime (production)"
|
|
4075
|
+
* }
|
|
4076
|
+
* })
|
|
4077
|
+
*/
|
|
4078
|
+
createCustomerApiKey(request, requestOptions) {
|
|
4079
|
+
return core.HttpResponsePromise.fromPromise(this.__createCustomerApiKey(request, requestOptions));
|
|
4080
|
+
}
|
|
4081
|
+
__createCustomerApiKey(request, requestOptions) {
|
|
4082
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4083
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4084
|
+
const { id, body: _body } = request;
|
|
4085
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
4086
|
+
const _response = yield core.fetcher({
|
|
4087
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/api-keys`),
|
|
4088
|
+
method: "POST",
|
|
4089
|
+
headers: _headers,
|
|
4090
|
+
contentType: "application/json",
|
|
4091
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
4092
|
+
requestType: "json",
|
|
4093
|
+
body: _body,
|
|
4094
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
4095
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
4096
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
4097
|
+
});
|
|
4098
|
+
if (_response.ok) {
|
|
4099
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4100
|
+
}
|
|
4101
|
+
if (_response.error.reason === "status-code") {
|
|
4102
|
+
switch (_response.error.statusCode) {
|
|
4103
|
+
case 400:
|
|
4104
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
4105
|
+
case 403:
|
|
4106
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4107
|
+
case 404:
|
|
4108
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
4109
|
+
case 500:
|
|
4110
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
4111
|
+
default:
|
|
4112
|
+
throw new errors.PaidError({
|
|
4113
|
+
statusCode: _response.error.statusCode,
|
|
4114
|
+
body: _response.error.body,
|
|
4115
|
+
rawResponse: _response.rawResponse,
|
|
4116
|
+
});
|
|
4117
|
+
}
|
|
4118
|
+
}
|
|
4119
|
+
switch (_response.error.reason) {
|
|
4120
|
+
case "non-json":
|
|
4121
|
+
throw new errors.PaidError({
|
|
4122
|
+
statusCode: _response.error.statusCode,
|
|
4123
|
+
body: _response.error.rawBody,
|
|
4124
|
+
rawResponse: _response.rawResponse,
|
|
4125
|
+
});
|
|
4126
|
+
case "timeout":
|
|
4127
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers/{id}/api-keys.");
|
|
4128
|
+
case "unknown":
|
|
4129
|
+
throw new errors.PaidError({
|
|
4130
|
+
message: _response.error.errorMessage,
|
|
4131
|
+
rawResponse: _response.rawResponse,
|
|
4132
|
+
});
|
|
4133
|
+
}
|
|
4134
|
+
});
|
|
4135
|
+
}
|
|
4136
|
+
/**
|
|
4137
|
+
* Revokes one of this customer's keys, which then stops authenticating. Keys are never deleted: a revoked key stays listed with `revokedAt` set, and deleting the customer revokes its keys too. Revoking an already revoked key returns it unchanged. `404` when the key does not belong to this customer. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
|
|
4138
|
+
*
|
|
4139
|
+
* @param {Paid.RevokeCustomerApiKeyRequest} request
|
|
4140
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
4141
|
+
*
|
|
4142
|
+
* @throws {@link Paid.BadRequestError}
|
|
4143
|
+
* @throws {@link Paid.ForbiddenError}
|
|
4144
|
+
* @throws {@link Paid.NotFoundError}
|
|
4145
|
+
* @throws {@link Paid.InternalServerError}
|
|
4146
|
+
*
|
|
4147
|
+
* @example
|
|
4148
|
+
* await client.customers.revokeCustomerApiKey({
|
|
4149
|
+
* id: "cus_abc123",
|
|
4150
|
+
* apiKeyId: "apiKeyId"
|
|
4151
|
+
* })
|
|
4152
|
+
*/
|
|
4153
|
+
revokeCustomerApiKey(request, requestOptions) {
|
|
4154
|
+
return core.HttpResponsePromise.fromPromise(this.__revokeCustomerApiKey(request, requestOptions));
|
|
4155
|
+
}
|
|
4156
|
+
__revokeCustomerApiKey(request, requestOptions) {
|
|
4157
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4158
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4159
|
+
const { id, apiKeyId } = request;
|
|
4160
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
4161
|
+
const _response = yield core.fetcher({
|
|
4162
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/api-keys/${core.url.encodePathParam(apiKeyId)}`),
|
|
4163
|
+
method: "DELETE",
|
|
4164
|
+
headers: _headers,
|
|
4165
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
4166
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
4167
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
4168
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
4169
|
+
});
|
|
4170
|
+
if (_response.ok) {
|
|
4171
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4172
|
+
}
|
|
4173
|
+
if (_response.error.reason === "status-code") {
|
|
4174
|
+
switch (_response.error.statusCode) {
|
|
4175
|
+
case 400:
|
|
4176
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
4177
|
+
case 403:
|
|
4178
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4179
|
+
case 404:
|
|
4180
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
4181
|
+
case 500:
|
|
4182
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
4183
|
+
default:
|
|
4184
|
+
throw new errors.PaidError({
|
|
4185
|
+
statusCode: _response.error.statusCode,
|
|
4186
|
+
body: _response.error.body,
|
|
4187
|
+
rawResponse: _response.rawResponse,
|
|
4188
|
+
});
|
|
4189
|
+
}
|
|
4190
|
+
}
|
|
4191
|
+
switch (_response.error.reason) {
|
|
4192
|
+
case "non-json":
|
|
4193
|
+
throw new errors.PaidError({
|
|
4194
|
+
statusCode: _response.error.statusCode,
|
|
4195
|
+
body: _response.error.rawBody,
|
|
4196
|
+
rawResponse: _response.rawResponse,
|
|
4197
|
+
});
|
|
4198
|
+
case "timeout":
|
|
4199
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/{id}/api-keys/{apiKeyId}.");
|
|
4200
|
+
case "unknown":
|
|
4201
|
+
throw new errors.PaidError({
|
|
4202
|
+
message: _response.error.errorMessage,
|
|
4203
|
+
rawResponse: _response.rawResponse,
|
|
4204
|
+
});
|
|
4205
|
+
}
|
|
4206
|
+
});
|
|
4207
|
+
}
|
|
4208
|
+
/**
|
|
4209
|
+
* Returns the cap in force on this customer unit for one credits currency, with usage in the current period when available. Select the currency with `creditsCurrencyId`; it may be omitted only when the organization has exactly one credits currency, which is then used and echoed back. `404` when the customer or the unit does not exist, or the unit has no cap in force for that currency. The usage figures are advisory: other spend may land between this read and the next burn. Addresses the customer by your external customer id.
|
|
4210
|
+
*
|
|
4211
|
+
* @param {Paid.GetCustomerUnitCapByExternalIdRequest} request
|
|
4212
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
4213
|
+
*
|
|
4214
|
+
* @throws {@link Paid.BadRequestError}
|
|
4215
|
+
* @throws {@link Paid.ForbiddenError}
|
|
4216
|
+
* @throws {@link Paid.NotFoundError}
|
|
4217
|
+
* @throws {@link Paid.InternalServerError}
|
|
4218
|
+
*
|
|
4219
|
+
* @example
|
|
4220
|
+
* await client.customers.getCustomerUnitCapByExternalId({
|
|
4221
|
+
* externalId: "customer_123",
|
|
4222
|
+
* externalCustomerUnitId: "tenant-a",
|
|
4223
|
+
* creditsCurrencyId: "7f4f5d4c-55e9-4d5b-a3e7-c9eb3d2d01bf"
|
|
4224
|
+
* })
|
|
4225
|
+
*/
|
|
4226
|
+
getCustomerUnitCapByExternalId(request, requestOptions) {
|
|
4227
|
+
return core.HttpResponsePromise.fromPromise(this.__getCustomerUnitCapByExternalId(request, requestOptions));
|
|
4228
|
+
}
|
|
4229
|
+
__getCustomerUnitCapByExternalId(request, requestOptions) {
|
|
4230
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4231
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4232
|
+
const { externalId, externalCustomerUnitId, creditsCurrencyId } = request;
|
|
4233
|
+
const _queryParams = {};
|
|
4234
|
+
if (creditsCurrencyId != null) {
|
|
4235
|
+
_queryParams.creditsCurrencyId = creditsCurrencyId;
|
|
4236
|
+
}
|
|
4237
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
4238
|
+
const _response = yield core.fetcher({
|
|
4239
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/cap`),
|
|
4240
|
+
method: "GET",
|
|
4241
|
+
headers: _headers,
|
|
4242
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
4243
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
4244
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
4245
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
4246
|
+
});
|
|
4247
|
+
if (_response.ok) {
|
|
4248
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4249
|
+
}
|
|
4250
|
+
if (_response.error.reason === "status-code") {
|
|
4251
|
+
switch (_response.error.statusCode) {
|
|
4252
|
+
case 400:
|
|
4253
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
4254
|
+
case 403:
|
|
4255
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4256
|
+
case 404:
|
|
4257
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
4258
|
+
case 500:
|
|
4259
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
4260
|
+
default:
|
|
4261
|
+
throw new errors.PaidError({
|
|
4262
|
+
statusCode: _response.error.statusCode,
|
|
4263
|
+
body: _response.error.body,
|
|
4264
|
+
rawResponse: _response.rawResponse,
|
|
4265
|
+
});
|
|
4266
|
+
}
|
|
4267
|
+
}
|
|
4268
|
+
switch (_response.error.reason) {
|
|
4269
|
+
case "non-json":
|
|
4270
|
+
throw new errors.PaidError({
|
|
4271
|
+
statusCode: _response.error.statusCode,
|
|
4272
|
+
body: _response.error.rawBody,
|
|
4273
|
+
rawResponse: _response.rawResponse,
|
|
4274
|
+
});
|
|
4275
|
+
case "timeout":
|
|
4276
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}/customer-units/{externalCustomerUnitId}/cap.");
|
|
4277
|
+
case "unknown":
|
|
4278
|
+
throw new errors.PaidError({
|
|
4279
|
+
message: _response.error.errorMessage,
|
|
4280
|
+
rawResponse: _response.rawResponse,
|
|
4281
|
+
});
|
|
4282
|
+
}
|
|
4283
|
+
});
|
|
4284
|
+
}
|
|
4285
|
+
/**
|
|
4286
|
+
* Sets the cap on this customer unit for one credits currency. Returns `changed: false` without creating a version when the effective timeline is unchanged; otherwise records a new version, preserving earlier rows. The newest version wins where they overlap. `effectiveFrom` controls applicability; `schedule` defines monthly UTC boundaries independently. Omit schedule to inherit the version covering effectiveFrom, or use the creation-time UTC day if none applies. Select the currency with `creditsCurrencyId` in the body; it may be omitted only when the organization has exactly one credits currency. A cap covers the unit and every unit beneath it, so a cap on the customer's root unit covers every unit of that customer; spend from a signal that names no unit counts toward no cap. `404` when the customer or the unit does not exist. `409` for customers on seat-based billing, a deleted unit (`CUSTOMER_UNIT_DELETED`) or a draft (`CUSTOMER_UNIT_DRAFT`). Addresses the customer by your external customer id.
|
|
4287
|
+
*
|
|
4288
|
+
* @param {Paid.SetCustomerUnitCapByExternalIdRequest} request
|
|
4289
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
4290
|
+
*
|
|
4291
|
+
* @throws {@link Paid.BadRequestError}
|
|
4292
|
+
* @throws {@link Paid.ForbiddenError}
|
|
4293
|
+
* @throws {@link Paid.NotFoundError}
|
|
4294
|
+
* @throws {@link Paid.ConflictError}
|
|
4295
|
+
* @throws {@link Paid.InternalServerError}
|
|
4296
|
+
*
|
|
4297
|
+
* @example
|
|
4298
|
+
* await client.customers.setCustomerUnitCapByExternalId({
|
|
4299
|
+
* externalId: "customer_123",
|
|
4300
|
+
* externalCustomerUnitId: "tenant-a",
|
|
4301
|
+
* body: {
|
|
4302
|
+
* amount: 10000
|
|
4303
|
+
* }
|
|
4304
|
+
* })
|
|
4305
|
+
*/
|
|
4306
|
+
setCustomerUnitCapByExternalId(request, requestOptions) {
|
|
4307
|
+
return core.HttpResponsePromise.fromPromise(this.__setCustomerUnitCapByExternalId(request, requestOptions));
|
|
4308
|
+
}
|
|
4309
|
+
__setCustomerUnitCapByExternalId(request, requestOptions) {
|
|
4310
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4311
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4312
|
+
const { externalId, externalCustomerUnitId, body: _body } = request;
|
|
4313
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
4314
|
+
const _response = yield core.fetcher({
|
|
4315
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/cap`),
|
|
4316
|
+
method: "PUT",
|
|
4317
|
+
headers: _headers,
|
|
4318
|
+
contentType: "application/json",
|
|
4319
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
4320
|
+
requestType: "json",
|
|
4321
|
+
body: _body,
|
|
4322
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
4323
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
4324
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
4325
|
+
});
|
|
4326
|
+
if (_response.ok) {
|
|
4327
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4328
|
+
}
|
|
4329
|
+
if (_response.error.reason === "status-code") {
|
|
4330
|
+
switch (_response.error.statusCode) {
|
|
4331
|
+
case 400:
|
|
4332
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
4333
|
+
case 403:
|
|
4334
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4335
|
+
case 404:
|
|
4336
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
4337
|
+
case 409:
|
|
4338
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
4339
|
+
case 500:
|
|
4340
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
4341
|
+
default:
|
|
4342
|
+
throw new errors.PaidError({
|
|
4343
|
+
statusCode: _response.error.statusCode,
|
|
4344
|
+
body: _response.error.body,
|
|
4345
|
+
rawResponse: _response.rawResponse,
|
|
4346
|
+
});
|
|
4347
|
+
}
|
|
4348
|
+
}
|
|
4349
|
+
switch (_response.error.reason) {
|
|
4350
|
+
case "non-json":
|
|
4351
|
+
throw new errors.PaidError({
|
|
4352
|
+
statusCode: _response.error.statusCode,
|
|
4353
|
+
body: _response.error.rawBody,
|
|
4354
|
+
rawResponse: _response.rawResponse,
|
|
4355
|
+
});
|
|
4356
|
+
case "timeout":
|
|
4357
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /customers/external/{externalId}/customer-units/{externalCustomerUnitId}/cap.");
|
|
4358
|
+
case "unknown":
|
|
4359
|
+
throw new errors.PaidError({
|
|
4360
|
+
message: _response.error.errorMessage,
|
|
4361
|
+
rawResponse: _response.rawResponse,
|
|
4362
|
+
});
|
|
4363
|
+
}
|
|
4364
|
+
});
|
|
4365
|
+
}
|
|
4366
|
+
/**
|
|
4367
|
+
* Ends the cap on this customer unit for one credits currency by setting `effectiveUntil` to now on every open version — the one in force, older overlapping versions still open, and versions scheduled to start later — so nothing can resurface or activate afterwards; nothing is deleted and history is kept. Select the currency with `creditsCurrencyId`; it may be omitted only when the organization has exactly one credits currency. `404` when the customer or the unit does not exist, or there is no open version for that currency. Addresses the customer by your external customer id.
|
|
4368
|
+
*
|
|
4369
|
+
* @param {Paid.EndCustomerUnitCapByExternalIdRequest} request
|
|
4370
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
4371
|
+
*
|
|
4372
|
+
* @throws {@link Paid.BadRequestError}
|
|
4373
|
+
* @throws {@link Paid.ForbiddenError}
|
|
4374
|
+
* @throws {@link Paid.NotFoundError}
|
|
4375
|
+
* @throws {@link Paid.ConflictError}
|
|
4376
|
+
* @throws {@link Paid.InternalServerError}
|
|
4377
|
+
*
|
|
4378
|
+
* @example
|
|
4379
|
+
* await client.customers.endCustomerUnitCapByExternalId({
|
|
4380
|
+
* externalId: "customer_123",
|
|
4381
|
+
* externalCustomerUnitId: "tenant-a",
|
|
4382
|
+
* creditsCurrencyId: "7f4f5d4c-55e9-4d5b-a3e7-c9eb3d2d01bf"
|
|
4383
|
+
* })
|
|
4384
|
+
*/
|
|
4385
|
+
endCustomerUnitCapByExternalId(request, requestOptions) {
|
|
4386
|
+
return core.HttpResponsePromise.fromPromise(this.__endCustomerUnitCapByExternalId(request, requestOptions));
|
|
4387
|
+
}
|
|
4388
|
+
__endCustomerUnitCapByExternalId(request, requestOptions) {
|
|
4389
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4390
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4391
|
+
const { externalId, externalCustomerUnitId, creditsCurrencyId } = request;
|
|
4392
|
+
const _queryParams = {};
|
|
4393
|
+
if (creditsCurrencyId != null) {
|
|
4394
|
+
_queryParams.creditsCurrencyId = creditsCurrencyId;
|
|
4395
|
+
}
|
|
4396
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
4397
|
+
const _response = yield core.fetcher({
|
|
4398
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/cap`),
|
|
4399
|
+
method: "DELETE",
|
|
4400
|
+
headers: _headers,
|
|
4401
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
4402
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
4403
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
4404
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
4405
|
+
});
|
|
4406
|
+
if (_response.ok) {
|
|
4407
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4408
|
+
}
|
|
4409
|
+
if (_response.error.reason === "status-code") {
|
|
4410
|
+
switch (_response.error.statusCode) {
|
|
4411
|
+
case 400:
|
|
4412
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
4413
|
+
case 403:
|
|
4414
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4415
|
+
case 404:
|
|
4416
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
4417
|
+
case 409:
|
|
4418
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
4419
|
+
case 500:
|
|
4420
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
4421
|
+
default:
|
|
4422
|
+
throw new errors.PaidError({
|
|
4423
|
+
statusCode: _response.error.statusCode,
|
|
4424
|
+
body: _response.error.body,
|
|
4425
|
+
rawResponse: _response.rawResponse,
|
|
4426
|
+
});
|
|
4427
|
+
}
|
|
4428
|
+
}
|
|
4429
|
+
switch (_response.error.reason) {
|
|
4430
|
+
case "non-json":
|
|
4431
|
+
throw new errors.PaidError({
|
|
4432
|
+
statusCode: _response.error.statusCode,
|
|
4433
|
+
body: _response.error.rawBody,
|
|
4434
|
+
rawResponse: _response.rawResponse,
|
|
4435
|
+
});
|
|
4436
|
+
case "timeout":
|
|
4437
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/external/{externalId}/customer-units/{externalCustomerUnitId}/cap.");
|
|
4438
|
+
case "unknown":
|
|
4439
|
+
throw new errors.PaidError({
|
|
4440
|
+
message: _response.error.errorMessage,
|
|
4441
|
+
rawResponse: _response.rawResponse,
|
|
4442
|
+
});
|
|
4443
|
+
}
|
|
4444
|
+
});
|
|
4445
|
+
}
|
|
4446
|
+
/**
|
|
4447
|
+
* Returns the credits of one credits currency spent by this customer unit and every unit beneath it during a window, whether or not the unit has a cap. The window runs from `start` (inclusive) to `end` (exclusive), at most 366 days; omit both for the current calendar month (UTC). For a capped unit over its cap's current period, `spent` equals the cap's `used`. Spend from a signal that names no unit counts toward no unit. Select the currency with `creditsCurrencyId`; it may be omitted only when the organization has exactly one credits currency, which is then used and echoed back. `404` when the customer or the unit does not exist. Addresses the customer by your external customer id.
|
|
4448
|
+
*
|
|
4449
|
+
* @param {Paid.GetCustomerUnitSpendByExternalIdRequest} request
|
|
4450
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
4451
|
+
*
|
|
4452
|
+
* @throws {@link Paid.BadRequestError}
|
|
4453
|
+
* @throws {@link Paid.ForbiddenError}
|
|
4454
|
+
* @throws {@link Paid.NotFoundError}
|
|
4455
|
+
* @throws {@link Paid.InternalServerError}
|
|
4456
|
+
*
|
|
4457
|
+
* @example
|
|
4458
|
+
* await client.customers.getCustomerUnitSpendByExternalId({
|
|
4459
|
+
* externalId: "customer_123",
|
|
4460
|
+
* externalCustomerUnitId: "tenant-a",
|
|
4461
|
+
* creditsCurrencyId: "7f4f5d4c-55e9-4d5b-a3e7-c9eb3d2d01bf",
|
|
4462
|
+
* start: "2026-10-01T00:00:00Z",
|
|
4463
|
+
* end: "2026-11-01T00:00:00Z"
|
|
4464
|
+
* })
|
|
4465
|
+
*/
|
|
4466
|
+
getCustomerUnitSpendByExternalId(request, requestOptions) {
|
|
4467
|
+
return core.HttpResponsePromise.fromPromise(this.__getCustomerUnitSpendByExternalId(request, requestOptions));
|
|
4468
|
+
}
|
|
4469
|
+
__getCustomerUnitSpendByExternalId(request, requestOptions) {
|
|
4470
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4471
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4472
|
+
const { externalId, externalCustomerUnitId, creditsCurrencyId, start, end } = request;
|
|
4473
|
+
const _queryParams = {};
|
|
4474
|
+
if (creditsCurrencyId != null) {
|
|
4475
|
+
_queryParams.creditsCurrencyId = creditsCurrencyId;
|
|
4476
|
+
}
|
|
4477
|
+
if (start != null) {
|
|
4478
|
+
_queryParams.start = start;
|
|
4479
|
+
}
|
|
4480
|
+
if (end != null) {
|
|
4481
|
+
_queryParams.end = end;
|
|
4482
|
+
}
|
|
4483
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
4484
|
+
const _response = yield core.fetcher({
|
|
4485
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/spend`),
|
|
4486
|
+
method: "GET",
|
|
4487
|
+
headers: _headers,
|
|
4488
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
4489
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
4490
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
4491
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
4492
|
+
});
|
|
4493
|
+
if (_response.ok) {
|
|
4494
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4495
|
+
}
|
|
4496
|
+
if (_response.error.reason === "status-code") {
|
|
4497
|
+
switch (_response.error.statusCode) {
|
|
4498
|
+
case 400:
|
|
4499
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
4500
|
+
case 403:
|
|
4501
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4502
|
+
case 404:
|
|
4503
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
4504
|
+
case 500:
|
|
4505
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
4506
|
+
default:
|
|
4507
|
+
throw new errors.PaidError({
|
|
4508
|
+
statusCode: _response.error.statusCode,
|
|
4509
|
+
body: _response.error.body,
|
|
4510
|
+
rawResponse: _response.rawResponse,
|
|
4511
|
+
});
|
|
4512
|
+
}
|
|
4513
|
+
}
|
|
4514
|
+
switch (_response.error.reason) {
|
|
4515
|
+
case "non-json":
|
|
4516
|
+
throw new errors.PaidError({
|
|
4517
|
+
statusCode: _response.error.statusCode,
|
|
4518
|
+
body: _response.error.rawBody,
|
|
4519
|
+
rawResponse: _response.rawResponse,
|
|
4520
|
+
});
|
|
4521
|
+
case "timeout":
|
|
4522
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}/customer-units/{externalCustomerUnitId}/spend.");
|
|
4523
|
+
case "unknown":
|
|
4524
|
+
throw new errors.PaidError({
|
|
4525
|
+
message: _response.error.errorMessage,
|
|
4526
|
+
rawResponse: _response.rawResponse,
|
|
4527
|
+
});
|
|
4528
|
+
}
|
|
4529
|
+
});
|
|
4530
|
+
}
|
|
4531
|
+
/**
|
|
4532
|
+
* Returns the cap in force on this customer unit for one credits currency, with usage in the current period when available. Select the currency with `creditsCurrencyId`; it may be omitted only when the organization has exactly one credits currency, which is then used and echoed back. `404` when the customer or the unit does not exist, or the unit has no cap in force for that currency. The usage figures are advisory: other spend may land between this read and the next burn. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
|
|
4533
|
+
*
|
|
4534
|
+
* @param {Paid.GetCustomerUnitCapRequest} request
|
|
4535
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
4536
|
+
*
|
|
4537
|
+
* @throws {@link Paid.BadRequestError}
|
|
4538
|
+
* @throws {@link Paid.ForbiddenError}
|
|
4539
|
+
* @throws {@link Paid.NotFoundError}
|
|
4540
|
+
* @throws {@link Paid.InternalServerError}
|
|
4541
|
+
*
|
|
4542
|
+
* @example
|
|
4543
|
+
* await client.customers.getCustomerUnitCap({
|
|
4544
|
+
* id: "cus_abc123",
|
|
4545
|
+
* externalCustomerUnitId: "tenant-a",
|
|
4546
|
+
* creditsCurrencyId: "7f4f5d4c-55e9-4d5b-a3e7-c9eb3d2d01bf"
|
|
4547
|
+
* })
|
|
4548
|
+
*/
|
|
4549
|
+
getCustomerUnitCap(request, requestOptions) {
|
|
4550
|
+
return core.HttpResponsePromise.fromPromise(this.__getCustomerUnitCap(request, requestOptions));
|
|
4551
|
+
}
|
|
4552
|
+
__getCustomerUnitCap(request, requestOptions) {
|
|
4553
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4554
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4555
|
+
const { id, externalCustomerUnitId, creditsCurrencyId } = request;
|
|
4556
|
+
const _queryParams = {};
|
|
4557
|
+
if (creditsCurrencyId != null) {
|
|
4558
|
+
_queryParams.creditsCurrencyId = creditsCurrencyId;
|
|
4559
|
+
}
|
|
4560
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
4561
|
+
const _response = yield core.fetcher({
|
|
4562
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/cap`),
|
|
4563
|
+
method: "GET",
|
|
4564
|
+
headers: _headers,
|
|
4565
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
4566
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
4567
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
4568
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
4569
|
+
});
|
|
4570
|
+
if (_response.ok) {
|
|
4571
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4572
|
+
}
|
|
4573
|
+
if (_response.error.reason === "status-code") {
|
|
4574
|
+
switch (_response.error.statusCode) {
|
|
4575
|
+
case 400:
|
|
4576
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
4577
|
+
case 403:
|
|
4578
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4579
|
+
case 404:
|
|
4580
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
4581
|
+
case 500:
|
|
4582
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
4583
|
+
default:
|
|
4584
|
+
throw new errors.PaidError({
|
|
4585
|
+
statusCode: _response.error.statusCode,
|
|
4586
|
+
body: _response.error.body,
|
|
4587
|
+
rawResponse: _response.rawResponse,
|
|
4588
|
+
});
|
|
4589
|
+
}
|
|
4590
|
+
}
|
|
4591
|
+
switch (_response.error.reason) {
|
|
4592
|
+
case "non-json":
|
|
4593
|
+
throw new errors.PaidError({
|
|
4594
|
+
statusCode: _response.error.statusCode,
|
|
4595
|
+
body: _response.error.rawBody,
|
|
4596
|
+
rawResponse: _response.rawResponse,
|
|
4597
|
+
});
|
|
4598
|
+
case "timeout":
|
|
4599
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}/customer-units/{externalCustomerUnitId}/cap.");
|
|
4600
|
+
case "unknown":
|
|
4601
|
+
throw new errors.PaidError({
|
|
4602
|
+
message: _response.error.errorMessage,
|
|
4603
|
+
rawResponse: _response.rawResponse,
|
|
4604
|
+
});
|
|
4605
|
+
}
|
|
4606
|
+
});
|
|
4607
|
+
}
|
|
4608
|
+
/**
|
|
4609
|
+
* Sets the cap on this customer unit for one credits currency. Returns `changed: false` without creating a version when the effective timeline is unchanged; otherwise records a new version, preserving earlier rows. The newest version wins where they overlap. `effectiveFrom` controls applicability; `schedule` defines monthly UTC boundaries independently. Omit schedule to inherit the version covering effectiveFrom, or use the creation-time UTC day if none applies. Select the currency with `creditsCurrencyId` in the body; it may be omitted only when the organization has exactly one credits currency. A cap covers the unit and every unit beneath it, so a cap on the customer's root unit covers every unit of that customer; spend from a signal that names no unit counts toward no cap. `404` when the customer or the unit does not exist. `409` for customers on seat-based billing, a deleted unit (`CUSTOMER_UNIT_DELETED`) or a draft (`CUSTOMER_UNIT_DRAFT`). Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
|
|
4610
|
+
*
|
|
4611
|
+
* @param {Paid.SetCustomerUnitCapRequest} request
|
|
4612
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
4613
|
+
*
|
|
4614
|
+
* @throws {@link Paid.BadRequestError}
|
|
4615
|
+
* @throws {@link Paid.ForbiddenError}
|
|
4616
|
+
* @throws {@link Paid.NotFoundError}
|
|
4617
|
+
* @throws {@link Paid.ConflictError}
|
|
4618
|
+
* @throws {@link Paid.InternalServerError}
|
|
4619
|
+
*
|
|
4620
|
+
* @example
|
|
4621
|
+
* await client.customers.setCustomerUnitCap({
|
|
4622
|
+
* id: "cus_abc123",
|
|
4623
|
+
* externalCustomerUnitId: "tenant-a",
|
|
4624
|
+
* body: {
|
|
4625
|
+
* amount: 10000
|
|
4626
|
+
* }
|
|
4627
|
+
* })
|
|
4628
|
+
*/
|
|
4629
|
+
setCustomerUnitCap(request, requestOptions) {
|
|
4630
|
+
return core.HttpResponsePromise.fromPromise(this.__setCustomerUnitCap(request, requestOptions));
|
|
4631
|
+
}
|
|
4632
|
+
__setCustomerUnitCap(request, requestOptions) {
|
|
4633
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4634
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4635
|
+
const { id, externalCustomerUnitId, body: _body } = request;
|
|
4636
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
4637
|
+
const _response = yield core.fetcher({
|
|
4638
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/cap`),
|
|
4639
|
+
method: "PUT",
|
|
4640
|
+
headers: _headers,
|
|
4641
|
+
contentType: "application/json",
|
|
4642
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
4643
|
+
requestType: "json",
|
|
4644
|
+
body: _body,
|
|
4645
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
4646
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
4647
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
4648
|
+
});
|
|
4649
|
+
if (_response.ok) {
|
|
4650
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4651
|
+
}
|
|
4652
|
+
if (_response.error.reason === "status-code") {
|
|
4653
|
+
switch (_response.error.statusCode) {
|
|
4654
|
+
case 400:
|
|
4655
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
4656
|
+
case 403:
|
|
4657
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4658
|
+
case 404:
|
|
4659
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
4660
|
+
case 409:
|
|
4661
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
4662
|
+
case 500:
|
|
4663
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
4664
|
+
default:
|
|
4665
|
+
throw new errors.PaidError({
|
|
4666
|
+
statusCode: _response.error.statusCode,
|
|
4667
|
+
body: _response.error.body,
|
|
4668
|
+
rawResponse: _response.rawResponse,
|
|
4669
|
+
});
|
|
4670
|
+
}
|
|
4671
|
+
}
|
|
4672
|
+
switch (_response.error.reason) {
|
|
4673
|
+
case "non-json":
|
|
4674
|
+
throw new errors.PaidError({
|
|
4675
|
+
statusCode: _response.error.statusCode,
|
|
4676
|
+
body: _response.error.rawBody,
|
|
4677
|
+
rawResponse: _response.rawResponse,
|
|
4678
|
+
});
|
|
4679
|
+
case "timeout":
|
|
4680
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /customers/{id}/customer-units/{externalCustomerUnitId}/cap.");
|
|
4681
|
+
case "unknown":
|
|
4682
|
+
throw new errors.PaidError({
|
|
4683
|
+
message: _response.error.errorMessage,
|
|
4684
|
+
rawResponse: _response.rawResponse,
|
|
4685
|
+
});
|
|
4686
|
+
}
|
|
4687
|
+
});
|
|
4688
|
+
}
|
|
4689
|
+
/**
|
|
4690
|
+
* Ends the cap on this customer unit for one credits currency by setting `effectiveUntil` to now on every open version — the one in force, older overlapping versions still open, and versions scheduled to start later — so nothing can resurface or activate afterwards; nothing is deleted and history is kept. Select the currency with `creditsCurrencyId`; it may be omitted only when the organization has exactly one credits currency. `404` when the customer or the unit does not exist, or there is no open version for that currency. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
|
|
4691
|
+
*
|
|
4692
|
+
* @param {Paid.EndCustomerUnitCapRequest} request
|
|
4693
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
4694
|
+
*
|
|
4695
|
+
* @throws {@link Paid.BadRequestError}
|
|
4696
|
+
* @throws {@link Paid.ForbiddenError}
|
|
4697
|
+
* @throws {@link Paid.NotFoundError}
|
|
4698
|
+
* @throws {@link Paid.ConflictError}
|
|
4699
|
+
* @throws {@link Paid.InternalServerError}
|
|
4700
|
+
*
|
|
4701
|
+
* @example
|
|
4702
|
+
* await client.customers.endCustomerUnitCap({
|
|
4703
|
+
* id: "cus_abc123",
|
|
4704
|
+
* externalCustomerUnitId: "tenant-a",
|
|
4705
|
+
* creditsCurrencyId: "7f4f5d4c-55e9-4d5b-a3e7-c9eb3d2d01bf"
|
|
4706
|
+
* })
|
|
4707
|
+
*/
|
|
4708
|
+
endCustomerUnitCap(request, requestOptions) {
|
|
4709
|
+
return core.HttpResponsePromise.fromPromise(this.__endCustomerUnitCap(request, requestOptions));
|
|
4710
|
+
}
|
|
4711
|
+
__endCustomerUnitCap(request, requestOptions) {
|
|
4712
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4713
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4714
|
+
const { id, externalCustomerUnitId, creditsCurrencyId } = request;
|
|
4715
|
+
const _queryParams = {};
|
|
4716
|
+
if (creditsCurrencyId != null) {
|
|
4717
|
+
_queryParams.creditsCurrencyId = creditsCurrencyId;
|
|
4718
|
+
}
|
|
4719
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
4720
|
+
const _response = yield core.fetcher({
|
|
4721
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/cap`),
|
|
4722
|
+
method: "DELETE",
|
|
4723
|
+
headers: _headers,
|
|
4724
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
4725
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
4726
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
4727
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
4728
|
+
});
|
|
4729
|
+
if (_response.ok) {
|
|
4730
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4731
|
+
}
|
|
4732
|
+
if (_response.error.reason === "status-code") {
|
|
4733
|
+
switch (_response.error.statusCode) {
|
|
4734
|
+
case 400:
|
|
4735
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
4736
|
+
case 403:
|
|
4737
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4738
|
+
case 404:
|
|
4739
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
4740
|
+
case 409:
|
|
4741
|
+
throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
|
|
4742
|
+
case 500:
|
|
4743
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
4744
|
+
default:
|
|
4745
|
+
throw new errors.PaidError({
|
|
4746
|
+
statusCode: _response.error.statusCode,
|
|
4747
|
+
body: _response.error.body,
|
|
4748
|
+
rawResponse: _response.rawResponse,
|
|
4749
|
+
});
|
|
4750
|
+
}
|
|
4751
|
+
}
|
|
4752
|
+
switch (_response.error.reason) {
|
|
4753
|
+
case "non-json":
|
|
4754
|
+
throw new errors.PaidError({
|
|
4755
|
+
statusCode: _response.error.statusCode,
|
|
4756
|
+
body: _response.error.rawBody,
|
|
4757
|
+
rawResponse: _response.rawResponse,
|
|
4758
|
+
});
|
|
4759
|
+
case "timeout":
|
|
4760
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/{id}/customer-units/{externalCustomerUnitId}/cap.");
|
|
4761
|
+
case "unknown":
|
|
4762
|
+
throw new errors.PaidError({
|
|
4763
|
+
message: _response.error.errorMessage,
|
|
4764
|
+
rawResponse: _response.rawResponse,
|
|
4765
|
+
});
|
|
4766
|
+
}
|
|
4767
|
+
});
|
|
4768
|
+
}
|
|
4769
|
+
/**
|
|
4770
|
+
* Returns the credits of one credits currency spent by this customer unit and every unit beneath it during a window, whether or not the unit has a cap. The window runs from `start` (inclusive) to `end` (exclusive), at most 366 days; omit both for the current calendar month (UTC). For a capped unit over its cap's current period, `spent` equals the cap's `used`. Spend from a signal that names no unit counts toward no unit. Select the currency with `creditsCurrencyId`; it may be omitted only when the organization has exactly one credits currency, which is then used and echoed back. `404` when the customer or the unit does not exist. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
|
|
4771
|
+
*
|
|
4772
|
+
* @param {Paid.GetCustomerUnitSpendRequest} request
|
|
4773
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
4774
|
+
*
|
|
4775
|
+
* @throws {@link Paid.BadRequestError}
|
|
4776
|
+
* @throws {@link Paid.ForbiddenError}
|
|
4777
|
+
* @throws {@link Paid.NotFoundError}
|
|
4778
|
+
* @throws {@link Paid.InternalServerError}
|
|
4779
|
+
*
|
|
4780
|
+
* @example
|
|
4781
|
+
* await client.customers.getCustomerUnitSpend({
|
|
4782
|
+
* id: "cus_abc123",
|
|
4783
|
+
* externalCustomerUnitId: "tenant-a",
|
|
4784
|
+
* creditsCurrencyId: "7f4f5d4c-55e9-4d5b-a3e7-c9eb3d2d01bf",
|
|
4785
|
+
* start: "2026-10-01T00:00:00Z",
|
|
4786
|
+
* end: "2026-11-01T00:00:00Z"
|
|
4787
|
+
* })
|
|
4788
|
+
*/
|
|
4789
|
+
getCustomerUnitSpend(request, requestOptions) {
|
|
4790
|
+
return core.HttpResponsePromise.fromPromise(this.__getCustomerUnitSpend(request, requestOptions));
|
|
4791
|
+
}
|
|
4792
|
+
__getCustomerUnitSpend(request, requestOptions) {
|
|
4793
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4794
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4795
|
+
const { id, externalCustomerUnitId, creditsCurrencyId, start, end } = request;
|
|
4796
|
+
const _queryParams = {};
|
|
4797
|
+
if (creditsCurrencyId != null) {
|
|
4798
|
+
_queryParams.creditsCurrencyId = creditsCurrencyId;
|
|
4799
|
+
}
|
|
4800
|
+
if (start != null) {
|
|
4801
|
+
_queryParams.start = start;
|
|
4802
|
+
}
|
|
4803
|
+
if (end != null) {
|
|
4804
|
+
_queryParams.end = end;
|
|
4805
|
+
}
|
|
4806
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
4807
|
+
const _response = yield core.fetcher({
|
|
4808
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/spend`),
|
|
4809
|
+
method: "GET",
|
|
4810
|
+
headers: _headers,
|
|
4811
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
4812
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
4813
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
4814
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
4815
|
+
});
|
|
4816
|
+
if (_response.ok) {
|
|
4817
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4818
|
+
}
|
|
4819
|
+
if (_response.error.reason === "status-code") {
|
|
4820
|
+
switch (_response.error.statusCode) {
|
|
4821
|
+
case 400:
|
|
4822
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
4823
|
+
case 403:
|
|
4824
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
4825
|
+
case 404:
|
|
4826
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
4827
|
+
case 500:
|
|
4828
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
4829
|
+
default:
|
|
4830
|
+
throw new errors.PaidError({
|
|
4831
|
+
statusCode: _response.error.statusCode,
|
|
4832
|
+
body: _response.error.body,
|
|
4833
|
+
rawResponse: _response.rawResponse,
|
|
4834
|
+
});
|
|
4835
|
+
}
|
|
4836
|
+
}
|
|
4837
|
+
switch (_response.error.reason) {
|
|
4838
|
+
case "non-json":
|
|
4839
|
+
throw new errors.PaidError({
|
|
4840
|
+
statusCode: _response.error.statusCode,
|
|
4841
|
+
body: _response.error.rawBody,
|
|
4842
|
+
rawResponse: _response.rawResponse,
|
|
4843
|
+
});
|
|
4844
|
+
case "timeout":
|
|
4845
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}/customer-units/{externalCustomerUnitId}/spend.");
|
|
841
4846
|
case "unknown":
|
|
842
4847
|
throw new errors.PaidError({
|
|
843
4848
|
message: _response.error.errorMessage,
|