diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index d7cec47..4bc7ff8 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,107 +1,88 @@ lockVersion: 2.0.0 id: bd003db9-613a-4093-838e-6d19bf5f76d7 management: - docChecksum: 509f7f04da4bb45734ebdd8250c8c50d + docChecksum: 147e272cd41193a5889ca5851588a1fe docVersion: 0.1.0 - speakeasyVersion: 1.456.1 - generationVersion: 2.481.0 - releaseVersion: 0.0.2 - configChecksum: 99c212dc45afbe78b86babc237c3e3fc + speakeasyVersion: 1.484.1 + generationVersion: 2.503.2 + releaseVersion: 0.0.3 + configChecksum: 0c3cb121fd6f0630ddaa31ebd733001b + repoURL: https://github.com/polarsource/polar-php.git + installationURL: https://github.com/polarsource/polar-php + published: true features: php: constsAndDefaults: 0.2.0 - core: 3.7.7 + core: 3.7.13 deprecations: 2.81.1 flattening: 2.81.1 globalSecurity: 2.81.7 - globalSecurityFlattening: 0.1.1 + globalSecurityFlattening: 0.1.2 globalServerURLs: 2.82.1 groups: 2.81.2 methodArguments: 0.1.0 nameOverrides: 2.81.2 nullables: 1.0.0 - pagination: 0.1.0 + pagination: 0.1.2 responseFormat: 0.1.0 serverIDs: 2.81.1 unions: 0.1.4 webhooks: 1.0.0 generatedFiles: - .gitattributes - - CONTRIBUTING.md - USAGE.md - composer.json + - config/services.php - docs/Models/Components/Address.md - docs/Models/Components/AdvertisementCampaign.md - docs/Models/Components/AdvertisementCampaignListResource.md - docs/Models/Components/AdvertisementSortProperty.md - - docs/Models/Components/AmountType.md + - docs/Models/Components/Aggregation.md - docs/Models/Components/Assignee.md - docs/Models/Components/AttachedCustomField.md - docs/Models/Components/AttachedCustomFieldCreate.md - docs/Models/Components/Author.md - docs/Models/Components/AuthorizeOrganization.md - docs/Models/Components/AuthorizeResponseOrganization.md - - docs/Models/Components/AuthorizeResponseOrganizationSubType.md - docs/Models/Components/AuthorizeResponseUser.md - - docs/Models/Components/AuthorizeResponseUserSubType.md - docs/Models/Components/AuthorizeUser.md - docs/Models/Components/Benefit.md - docs/Models/Components/BenefitAds.md - docs/Models/Components/BenefitAdsCreate.md - - docs/Models/Components/BenefitAdsCreateType.md - docs/Models/Components/BenefitAdsProperties.md - docs/Models/Components/BenefitAdsSubscriber.md - - docs/Models/Components/BenefitAdsSubscriberType.md - - docs/Models/Components/BenefitAdsType.md - docs/Models/Components/BenefitAdsUpdate.md - - docs/Models/Components/BenefitAdsUpdateType.md - docs/Models/Components/BenefitBase.md - docs/Models/Components/BenefitCreate.md - docs/Models/Components/BenefitCustom.md - docs/Models/Components/BenefitCustomCreate.md - docs/Models/Components/BenefitCustomCreateProperties.md - - docs/Models/Components/BenefitCustomCreateType.md - docs/Models/Components/BenefitCustomProperties.md - docs/Models/Components/BenefitCustomSubscriber.md - docs/Models/Components/BenefitCustomSubscriberProperties.md - - docs/Models/Components/BenefitCustomSubscriberType.md - - docs/Models/Components/BenefitCustomType.md - docs/Models/Components/BenefitCustomUpdate.md - - docs/Models/Components/BenefitCustomUpdateType.md - docs/Models/Components/BenefitDiscord.md - docs/Models/Components/BenefitDiscordCreate.md - docs/Models/Components/BenefitDiscordCreateProperties.md - - docs/Models/Components/BenefitDiscordCreateType.md - docs/Models/Components/BenefitDiscordProperties.md - docs/Models/Components/BenefitDiscordSubscriber.md - docs/Models/Components/BenefitDiscordSubscriberProperties.md - - docs/Models/Components/BenefitDiscordSubscriberType.md - - docs/Models/Components/BenefitDiscordType.md - docs/Models/Components/BenefitDiscordUpdate.md - - docs/Models/Components/BenefitDiscordUpdateType.md - docs/Models/Components/BenefitDownloadables.md - docs/Models/Components/BenefitDownloadablesCreate.md - docs/Models/Components/BenefitDownloadablesCreateProperties.md - - docs/Models/Components/BenefitDownloadablesCreateType.md - docs/Models/Components/BenefitDownloadablesProperties.md - docs/Models/Components/BenefitDownloadablesSubscriber.md - docs/Models/Components/BenefitDownloadablesSubscriberProperties.md - - docs/Models/Components/BenefitDownloadablesSubscriberType.md - - docs/Models/Components/BenefitDownloadablesType.md - docs/Models/Components/BenefitDownloadablesUpdate.md - - docs/Models/Components/BenefitDownloadablesUpdateType.md - docs/Models/Components/BenefitGitHubRepository.md - docs/Models/Components/BenefitGitHubRepositoryCreate.md - docs/Models/Components/BenefitGitHubRepositoryCreateProperties.md - docs/Models/Components/BenefitGitHubRepositoryCreatePropertiesPermission.md - - docs/Models/Components/BenefitGitHubRepositoryCreateType.md - docs/Models/Components/BenefitGitHubRepositoryProperties.md - docs/Models/Components/BenefitGitHubRepositorySubscriber.md - docs/Models/Components/BenefitGitHubRepositorySubscriberProperties.md - - docs/Models/Components/BenefitGitHubRepositorySubscriberType.md - - docs/Models/Components/BenefitGitHubRepositoryType.md - docs/Models/Components/BenefitGitHubRepositoryUpdate.md - - docs/Models/Components/BenefitGitHubRepositoryUpdateType.md - docs/Models/Components/BenefitGrant.md - docs/Models/Components/BenefitGrantAdsProperties.md - docs/Models/Components/BenefitGrantCustomProperties.md @@ -117,14 +98,10 @@ generatedFiles: - docs/Models/Components/BenefitLicenseKeys.md - docs/Models/Components/BenefitLicenseKeysCreate.md - docs/Models/Components/BenefitLicenseKeysCreateProperties.md - - docs/Models/Components/BenefitLicenseKeysCreateType.md - docs/Models/Components/BenefitLicenseKeysProperties.md - docs/Models/Components/BenefitLicenseKeysSubscriber.md - docs/Models/Components/BenefitLicenseKeysSubscriberProperties.md - - docs/Models/Components/BenefitLicenseKeysSubscriberType.md - - docs/Models/Components/BenefitLicenseKeysType.md - docs/Models/Components/BenefitLicenseKeysUpdate.md - - docs/Models/Components/BenefitLicenseKeysUpdateType.md - docs/Models/Components/BenefitType.md - docs/Models/Components/Checkout.md - docs/Models/Components/CheckoutConfirmStripe.md @@ -144,11 +121,9 @@ generatedFiles: - docs/Models/Components/CheckoutLinkMetadata.md - docs/Models/Components/CheckoutLinkPriceCreate.md - docs/Models/Components/CheckoutLinkPriceCreateMetadata.md - - docs/Models/Components/CheckoutLinkPriceCreatePaymentProcessor.md - docs/Models/Components/CheckoutLinkProduct.md - docs/Models/Components/CheckoutLinkProductCreate.md - docs/Models/Components/CheckoutLinkProductCreateMetadata.md - - docs/Models/Components/CheckoutLinkProductCreatePaymentProcessor.md - docs/Models/Components/CheckoutLinkSortProperty.md - docs/Models/Components/CheckoutLinkUpdate.md - docs/Models/Components/CheckoutLinkUpdateMetadata.md @@ -157,112 +132,92 @@ generatedFiles: - docs/Models/Components/CheckoutPriceCreateCustomFieldData.md - docs/Models/Components/CheckoutPriceCreateCustomerMetadata.md - docs/Models/Components/CheckoutPriceCreateMetadata.md - - docs/Models/Components/CheckoutPriceCreatePaymentProcessor.md - docs/Models/Components/CheckoutProduct.md - docs/Models/Components/CheckoutProductCreate.md - docs/Models/Components/CheckoutProductCreateCustomFieldData.md - docs/Models/Components/CheckoutProductCreateCustomerMetadata.md - docs/Models/Components/CheckoutProductCreateMetadata.md - - docs/Models/Components/CheckoutProductCreatePaymentProcessor.md - docs/Models/Components/CheckoutPublic.md - docs/Models/Components/CheckoutPublicConfirmed.md - docs/Models/Components/CheckoutPublicConfirmedCustomFieldData.md - docs/Models/Components/CheckoutPublicConfirmedDiscount.md - - docs/Models/Components/CheckoutPublicConfirmedPaymentProcessorMetadata.md - docs/Models/Components/CheckoutPublicCustomFieldData.md - docs/Models/Components/CheckoutPublicDiscount.md - - docs/Models/Components/CheckoutPublicPaymentProcessorMetadata.md - docs/Models/Components/CheckoutSortProperty.md - docs/Models/Components/CheckoutStatus.md - docs/Models/Components/CheckoutUpdate.md + - docs/Models/Components/CheckoutUpdateCustomFieldData.md - docs/Models/Components/CheckoutUpdateCustomerMetadata.md - docs/Models/Components/CheckoutUpdateMetadata.md - docs/Models/Components/CheckoutUpdatePublic.md - docs/Models/Components/CheckoutUpdatePublicCustomFieldData.md + - docs/Models/Components/Clauses.md - docs/Models/Components/Conditions.md + - docs/Models/Components/CountAggregation.md - docs/Models/Components/CurrencyAmount.md - docs/Models/Components/CustomField.md - docs/Models/Components/CustomFieldCheckbox.md - docs/Models/Components/CustomFieldCheckboxMetadata.md - docs/Models/Components/CustomFieldCheckboxProperties.md - - docs/Models/Components/CustomFieldCheckboxType.md - docs/Models/Components/CustomFieldCreate.md - docs/Models/Components/CustomFieldCreateCheckbox.md - docs/Models/Components/CustomFieldCreateCheckboxMetadata.md - - docs/Models/Components/CustomFieldCreateCheckboxType.md - docs/Models/Components/CustomFieldCreateDate.md - docs/Models/Components/CustomFieldCreateDateMetadata.md - - docs/Models/Components/CustomFieldCreateDateType.md - docs/Models/Components/CustomFieldCreateNumber.md - docs/Models/Components/CustomFieldCreateNumberMetadata.md - - docs/Models/Components/CustomFieldCreateNumberType.md - docs/Models/Components/CustomFieldCreateSelect.md - docs/Models/Components/CustomFieldCreateSelectMetadata.md - - docs/Models/Components/CustomFieldCreateSelectType.md - docs/Models/Components/CustomFieldCreateText.md - docs/Models/Components/CustomFieldCreateTextMetadata.md - - docs/Models/Components/CustomFieldCreateTextType.md - docs/Models/Components/CustomFieldData.md - docs/Models/Components/CustomFieldDate.md - docs/Models/Components/CustomFieldDateMetadata.md - docs/Models/Components/CustomFieldDateProperties.md - - docs/Models/Components/CustomFieldDateType.md - docs/Models/Components/CustomFieldNumber.md - docs/Models/Components/CustomFieldNumberMetadata.md - docs/Models/Components/CustomFieldNumberProperties.md - - docs/Models/Components/CustomFieldNumberType.md - docs/Models/Components/CustomFieldSelect.md - docs/Models/Components/CustomFieldSelectMetadata.md - docs/Models/Components/CustomFieldSelectOption.md - docs/Models/Components/CustomFieldSelectProperties.md - - docs/Models/Components/CustomFieldSelectType.md - docs/Models/Components/CustomFieldSortProperty.md - docs/Models/Components/CustomFieldText.md - docs/Models/Components/CustomFieldTextMetadata.md - docs/Models/Components/CustomFieldTextProperties.md - - docs/Models/Components/CustomFieldTextType.md - docs/Models/Components/CustomFieldType.md - docs/Models/Components/CustomFieldUpdate.md - docs/Models/Components/CustomFieldUpdateCheckbox.md - docs/Models/Components/CustomFieldUpdateCheckboxMetadata.md - - docs/Models/Components/CustomFieldUpdateCheckboxType.md - docs/Models/Components/CustomFieldUpdateDate.md - docs/Models/Components/CustomFieldUpdateDateMetadata.md - - docs/Models/Components/CustomFieldUpdateDateType.md - docs/Models/Components/CustomFieldUpdateNumber.md - docs/Models/Components/CustomFieldUpdateNumberMetadata.md - - docs/Models/Components/CustomFieldUpdateNumberType.md - docs/Models/Components/CustomFieldUpdateSelect.md - docs/Models/Components/CustomFieldUpdateSelectMetadata.md - - docs/Models/Components/CustomFieldUpdateSelectType.md - docs/Models/Components/CustomFieldUpdateText.md - docs/Models/Components/CustomFieldUpdateTextMetadata.md - - docs/Models/Components/CustomFieldUpdateTextType.md - docs/Models/Components/Customer.md - docs/Models/Components/CustomerBenefitGrant.md - docs/Models/Components/CustomerBenefitGrantAds.md - docs/Models/Components/CustomerBenefitGrantAdsUpdate.md - - docs/Models/Components/CustomerBenefitGrantAdsUpdateBenefitType.md - docs/Models/Components/CustomerBenefitGrantCustom.md - docs/Models/Components/CustomerBenefitGrantCustomUpdate.md - - docs/Models/Components/CustomerBenefitGrantCustomUpdateBenefitType.md - docs/Models/Components/CustomerBenefitGrantDiscord.md - docs/Models/Components/CustomerBenefitGrantDiscordPropertiesUpdate.md - docs/Models/Components/CustomerBenefitGrantDiscordUpdate.md - - docs/Models/Components/CustomerBenefitGrantDiscordUpdateBenefitType.md - docs/Models/Components/CustomerBenefitGrantDownloadables.md - docs/Models/Components/CustomerBenefitGrantDownloadablesUpdate.md - - docs/Models/Components/CustomerBenefitGrantDownloadablesUpdateBenefitType.md - docs/Models/Components/CustomerBenefitGrantGitHubRepository.md - docs/Models/Components/CustomerBenefitGrantGitHubRepositoryPropertiesUpdate.md - docs/Models/Components/CustomerBenefitGrantGitHubRepositoryUpdate.md - - docs/Models/Components/CustomerBenefitGrantGitHubRepositoryUpdateBenefitType.md - docs/Models/Components/CustomerBenefitGrantLicenseKeys.md - docs/Models/Components/CustomerBenefitGrantLicenseKeysUpdate.md - - docs/Models/Components/CustomerBenefitGrantLicenseKeysUpdateBenefitType.md - docs/Models/Components/CustomerBenefitGrantSortProperty.md - docs/Models/Components/CustomerBenefitGrantUpdate.md + - docs/Models/Components/CustomerCancellationReason.md - docs/Models/Components/CustomerCreate.md + - docs/Models/Components/CustomerCreateMetadata.md - docs/Models/Components/CustomerCreateTaxId.md - docs/Models/Components/CustomerMetadata.md - docs/Models/Components/CustomerMetadata1.md @@ -278,11 +233,14 @@ generatedFiles: - docs/Models/Components/CustomerSessionCreate.md - docs/Models/Components/CustomerSortProperty.md - docs/Models/Components/CustomerSubscription.md + - docs/Models/Components/CustomerSubscriptionCancel.md - docs/Models/Components/CustomerSubscriptionProduct.md - docs/Models/Components/CustomerSubscriptionSortProperty.md - docs/Models/Components/CustomerSubscriptionUpdate.md + - docs/Models/Components/CustomerSubscriptionUpdatePrice.md - docs/Models/Components/CustomerTaxId.md - docs/Models/Components/CustomerUpdate.md + - docs/Models/Components/CustomerUpdateMetadata.md - docs/Models/Components/CustomerUpdateTaxId.md - docs/Models/Components/Discount.md - docs/Models/Components/DiscountCreate.md @@ -317,10 +275,19 @@ generatedFiles: - docs/Models/Components/DiscountUpdate.md - docs/Models/Components/DiscountUpdateMetadata.md - docs/Models/Components/DownloadableFileCreate.md - - docs/Models/Components/DownloadableFileCreateService.md - docs/Models/Components/DownloadableFileRead.md - - docs/Models/Components/DownloadableFileReadService.md - docs/Models/Components/DownloadableRead.md + - docs/Models/Components/Event.md + - docs/Models/Components/EventCreateCustomer.md + - docs/Models/Components/EventCreateCustomerMetadata.md + - docs/Models/Components/EventCreateExternalCustomer.md + - docs/Models/Components/EventCreateExternalCustomerMetadata.md + - docs/Models/Components/EventMetadata.md + - docs/Models/Components/EventSortProperty.md + - docs/Models/Components/EventSource.md + - docs/Models/Components/Events.md + - docs/Models/Components/EventsIngest.md + - docs/Models/Components/EventsIngestResponse.md - docs/Models/Components/ExistingProductPrice.md - docs/Models/Components/ExternalOrganization.md - docs/Models/Components/ExternalOrganizationSortProperty.md @@ -331,12 +298,14 @@ generatedFiles: - docs/Models/Components/FileServiceTypes.md - docs/Models/Components/FileUpload.md - docs/Models/Components/FileUploadCompleted.md + - docs/Models/Components/Filter.md + - docs/Models/Components/FilterClause.md + - docs/Models/Components/FilterConjunction.md + - docs/Models/Components/FilterOperator.md + - docs/Models/Components/Func.md - docs/Models/Components/Funding.md - - docs/Models/Components/GrantType.md - docs/Models/Components/GrantTypes.md - - docs/Models/Components/Interval.md - docs/Models/Components/IntrospectTokenResponse.md - - docs/Models/Components/IntrospectTokenResponseTokenType.md - docs/Models/Components/Issue.md - docs/Models/Components/Label.md - docs/Models/Components/LicenseKeyActivate.md @@ -366,18 +335,33 @@ generatedFiles: - docs/Models/Components/ListResourceCustomerSubscription.md - docs/Models/Components/ListResourceDiscount.md - docs/Models/Components/ListResourceDownloadableRead.md + - docs/Models/Components/ListResourceEvent.md - docs/Models/Components/ListResourceExternalOrganization.md - docs/Models/Components/ListResourceFileRead.md - docs/Models/Components/ListResourceLicenseKeyRead.md + - docs/Models/Components/ListResourceMeter.md - docs/Models/Components/ListResourceOAuth2Client.md - docs/Models/Components/ListResourceOrder.md - docs/Models/Components/ListResourceOrganization.md - docs/Models/Components/ListResourceProduct.md + - docs/Models/Components/ListResourceRefund.md - docs/Models/Components/ListResourceRepository.md - docs/Models/Components/ListResourceSubscription.md - docs/Models/Components/Loc.md - docs/Models/Components/Meta.md - docs/Models/Components/Metadata.md + - docs/Models/Components/MetadataQuery.md + - docs/Models/Components/Meter.md + - docs/Models/Components/MeterAggregation.md + - docs/Models/Components/MeterCreate.md + - docs/Models/Components/MeterCreateAggregation.md + - docs/Models/Components/MeterCreateMetadata.md + - docs/Models/Components/MeterMetadata.md + - docs/Models/Components/MeterQuantities.md + - docs/Models/Components/MeterQuantity.md + - docs/Models/Components/MeterSortProperty.md + - docs/Models/Components/MeterUpdate.md + - docs/Models/Components/MeterUpdateMetadata.md - docs/Models/Components/Metric.md - docs/Models/Components/MetricPeriod.md - docs/Models/Components/MetricType.md @@ -389,16 +373,13 @@ generatedFiles: - docs/Models/Components/OAuth2Client.md - docs/Models/Components/OAuth2ClientConfiguration.md - docs/Models/Components/OAuth2ClientConfigurationGrantTypes.md - - docs/Models/Components/OAuth2ClientConfigurationResponseTypes.md - docs/Models/Components/OAuth2ClientConfigurationTokenEndpointAuthMethod.md - docs/Models/Components/OAuth2ClientConfigurationUpdate.md - docs/Models/Components/OAuth2ClientConfigurationUpdateGrantTypes.md - - docs/Models/Components/OAuth2ClientConfigurationUpdateResponseTypes.md - docs/Models/Components/OAuth2ClientConfigurationUpdateTokenEndpointAuthMethod.md - docs/Models/Components/OAuth2ClientPublic.md - docs/Models/Components/Onev11oauth21tokenPostXComponentsAuthorizationCodeTokenRequest.md - docs/Models/Components/Onev11oauth21tokenPostXComponentsRefreshTokenRequest.md - - docs/Models/Components/Onev11oauth21tokenPostXComponentsRefreshTokenRequestGrantType.md - docs/Models/Components/Order.md - docs/Models/Components/OrderBillingReason.md - docs/Models/Components/OrderCustomFieldData.md @@ -415,18 +396,16 @@ generatedFiles: - docs/Models/Components/OrderUser.md - docs/Models/Components/Organization.md - docs/Models/Components/OrganizationAvatarFileCreate.md - - docs/Models/Components/OrganizationAvatarFileCreateService.md - docs/Models/Components/OrganizationAvatarFileRead.md - - docs/Models/Components/OrganizationAvatarFileReadService.md - docs/Models/Components/OrganizationCreate.md - docs/Models/Components/OrganizationFeatureSettings.md - docs/Models/Components/OrganizationProfileSettings.md - docs/Models/Components/OrganizationSortProperty.md - docs/Models/Components/OrganizationSubscribePromoteSettings.md + - docs/Models/Components/OrganizationSubscriptionSettings.md - docs/Models/Components/OrganizationUpdate.md - docs/Models/Components/Pagination.md - docs/Models/Components/PaymentProcessor.md - - docs/Models/Components/PaymentProcessorMetadata.md - docs/Models/Components/Permission.md - docs/Models/Components/Platforms.md - docs/Models/Components/Pledge.md @@ -439,7 +418,6 @@ generatedFiles: - docs/Models/Components/ProductBenefitsUpdate.md - docs/Models/Components/ProductCreate.md - docs/Models/Components/ProductMediaFileCreate.md - - docs/Models/Components/ProductMediaFileCreateService.md - docs/Models/Components/ProductMediaFileRead.md - docs/Models/Components/ProductMetadata.md - docs/Models/Components/ProductOneTimeCreate.md @@ -447,52 +425,40 @@ generatedFiles: - docs/Models/Components/ProductPrice.md - docs/Models/Components/ProductPriceOneTime.md - docs/Models/Components/ProductPriceOneTimeCustom.md - - docs/Models/Components/ProductPriceOneTimeCustomAmountType.md - docs/Models/Components/ProductPriceOneTimeCustomCreate.md - - docs/Models/Components/ProductPriceOneTimeCustomCreateAmountType.md - - docs/Models/Components/ProductPriceOneTimeCustomCreateType.md - - docs/Models/Components/ProductPriceOneTimeCustomType.md - docs/Models/Components/ProductPriceOneTimeFixed.md - - docs/Models/Components/ProductPriceOneTimeFixedAmountType.md - docs/Models/Components/ProductPriceOneTimeFixedCreate.md - - docs/Models/Components/ProductPriceOneTimeFixedCreateAmountType.md - - docs/Models/Components/ProductPriceOneTimeFixedCreateType.md - - docs/Models/Components/ProductPriceOneTimeFixedType.md - docs/Models/Components/ProductPriceOneTimeFree.md - - docs/Models/Components/ProductPriceOneTimeFreeAmountType.md - docs/Models/Components/ProductPriceOneTimeFreeCreate.md - - docs/Models/Components/ProductPriceOneTimeFreeCreateAmountType.md - - docs/Models/Components/ProductPriceOneTimeFreeCreateType.md - - docs/Models/Components/ProductPriceOneTimeFreeType.md - docs/Models/Components/ProductPriceRecurring.md - docs/Models/Components/ProductPriceRecurringCustom.md - - docs/Models/Components/ProductPriceRecurringCustomAmountType.md - - docs/Models/Components/ProductPriceRecurringCustomType.md - docs/Models/Components/ProductPriceRecurringFixed.md - docs/Models/Components/ProductPriceRecurringFixedCreate.md - - docs/Models/Components/ProductPriceRecurringFixedCreateAmountType.md - - docs/Models/Components/ProductPriceRecurringFixedCreateType.md - docs/Models/Components/ProductPriceRecurringFree.md - - docs/Models/Components/ProductPriceRecurringFreeAmountType.md - docs/Models/Components/ProductPriceRecurringFreeCreate.md - - docs/Models/Components/ProductPriceRecurringFreeCreateAmountType.md - - docs/Models/Components/ProductPriceRecurringFreeCreateType.md - - docs/Models/Components/ProductPriceRecurringFreeType.md - docs/Models/Components/ProductPriceType.md - docs/Models/Components/ProductRecurringCreate.md - docs/Models/Components/ProductRecurringCreateMetadata.md + - docs/Models/Components/ProductRecurringCreatePrices.md - docs/Models/Components/ProductSortProperty.md - docs/Models/Components/ProductUpdate.md - docs/Models/Components/ProductUpdateMetadata.md - docs/Models/Components/ProductUpdatePrices.md - docs/Models/Components/Properties.md + - docs/Models/Components/PropertyAggregation.md - docs/Models/Components/Reactions.md + - docs/Models/Components/Refund.md + - docs/Models/Components/RefundCreate.md + - docs/Models/Components/RefundCreateMetadata.md + - docs/Models/Components/RefundMetadata.md + - docs/Models/Components/RefundReason.md + - docs/Models/Components/RefundSortProperty.md + - docs/Models/Components/RefundStatus.md - docs/Models/Components/Repository.md - docs/Models/Components/RepositoryProfileSettings.md - docs/Models/Components/RepositoryProfileSettingsUpdate.md - docs/Models/Components/RepositorySortProperty.md - docs/Models/Components/RepositoryUpdate.md - - docs/Models/Components/ResponseTypes.md - docs/Models/Components/RevokeTokenResponse.md - docs/Models/Components/S3DownloadURL.md - docs/Models/Components/S3FileCreateMultipart.md @@ -502,75 +468,62 @@ generatedFiles: - docs/Models/Components/S3FileUploadPart.md - docs/Models/Components/Scope.md - docs/Models/Components/Security.md - - docs/Models/Components/Service.md - docs/Models/Components/State.md - - docs/Models/Components/Status.md - docs/Models/Components/SubType.md - docs/Models/Components/Subscription.md - - docs/Models/Components/SubscriptionCustomFieldData.md + - docs/Models/Components/SubscriptionCancel.md - docs/Models/Components/SubscriptionCustomer.md - docs/Models/Components/SubscriptionCustomerMetadata.md - docs/Models/Components/SubscriptionDiscount.md + - docs/Models/Components/SubscriptionProrationBehavior.md - docs/Models/Components/SubscriptionRecurringInterval.md - docs/Models/Components/SubscriptionSortProperty.md - docs/Models/Components/SubscriptionStatus.md + - docs/Models/Components/SubscriptionUpdate.md + - docs/Models/Components/SubscriptionUpdatePrice.md - docs/Models/Components/SubscriptionUser.md - docs/Models/Components/TaxIDFormat.md - docs/Models/Components/TaxId.md + - docs/Models/Components/TimeInterval.md - docs/Models/Components/Timeframe.md - docs/Models/Components/TokenEndpointAuthMethod.md - docs/Models/Components/TokenResponse.md - docs/Models/Components/TokenType.md - - docs/Models/Components/Type.md - docs/Models/Components/UserInfoOrganization.md - docs/Models/Components/UserInfoUser.md - docs/Models/Components/ValidatedLicenseKey.md - docs/Models/Components/ValidationError.md + - docs/Models/Components/Value.md - docs/Models/Components/WebhookBenefitCreatedPayload.md - - docs/Models/Components/WebhookBenefitCreatedPayloadType.md - docs/Models/Components/WebhookBenefitGrantCreatedPayload.md - - docs/Models/Components/WebhookBenefitGrantCreatedPayloadType.md - docs/Models/Components/WebhookBenefitGrantRevokedPayload.md - - docs/Models/Components/WebhookBenefitGrantRevokedPayloadType.md - docs/Models/Components/WebhookBenefitGrantUpdatedPayload.md - - docs/Models/Components/WebhookBenefitGrantUpdatedPayloadType.md - docs/Models/Components/WebhookBenefitUpdatedPayload.md - - docs/Models/Components/WebhookBenefitUpdatedPayloadType.md - docs/Models/Components/WebhookCheckoutCreatedPayload.md - - docs/Models/Components/WebhookCheckoutCreatedPayloadType.md - docs/Models/Components/WebhookCheckoutUpdatedPayload.md - - docs/Models/Components/WebhookCheckoutUpdatedPayloadType.md - docs/Models/Components/WebhookOrderCreatedPayload.md - - docs/Models/Components/WebhookOrderCreatedPayloadType.md + - docs/Models/Components/WebhookOrderRefundedPayload.md - docs/Models/Components/WebhookOrganizationUpdatedPayload.md - - docs/Models/Components/WebhookOrganizationUpdatedPayloadType.md - docs/Models/Components/WebhookPledgeCreatedPayload.md - - docs/Models/Components/WebhookPledgeCreatedPayloadType.md - docs/Models/Components/WebhookPledgeUpdatedPayload.md - - docs/Models/Components/WebhookPledgeUpdatedPayloadType.md - docs/Models/Components/WebhookProductCreatedPayload.md - - docs/Models/Components/WebhookProductCreatedPayloadType.md - docs/Models/Components/WebhookProductUpdatedPayload.md - - docs/Models/Components/WebhookProductUpdatedPayloadType.md + - docs/Models/Components/WebhookRefundCreatedPayload.md + - docs/Models/Components/WebhookRefundUpdatedPayload.md - docs/Models/Components/WebhookSubscriptionActivePayload.md - - docs/Models/Components/WebhookSubscriptionActivePayloadType.md - docs/Models/Components/WebhookSubscriptionCanceledPayload.md - - docs/Models/Components/WebhookSubscriptionCanceledPayloadType.md - docs/Models/Components/WebhookSubscriptionCreatedPayload.md - - docs/Models/Components/WebhookSubscriptionCreatedPayloadType.md - docs/Models/Components/WebhookSubscriptionRevokedPayload.md - - docs/Models/Components/WebhookSubscriptionRevokedPayloadType.md + - docs/Models/Components/WebhookSubscriptionUncanceledPayload.md - docs/Models/Components/WebhookSubscriptionUpdatedPayload.md - - docs/Models/Components/WebhookSubscriptionUpdatedPayloadType.md + - docs/Models/Errors/AlreadyActiveSubscriptionError.md - docs/Models/Errors/AlreadyCanceledSubscription.md - - docs/Models/Errors/AlreadyCanceledSubscriptionError.md - - docs/Models/Errors/Error.md - docs/Models/Errors/HTTPValidationError.md - docs/Models/Errors/NotPermitted.md - - docs/Models/Errors/NotPermittedError.md + - docs/Models/Errors/RefundAmountTooHigh.md + - docs/Models/Errors/RefundedAlready.md - docs/Models/Errors/ResourceNotFound.md - docs/Models/Errors/Unauthorized.md - - docs/Models/Errors/UnauthorizedError.md - docs/Models/Operations/AdvertisementsGetRequest.md - docs/Models/Operations/AdvertisementsGetResponse.md - docs/Models/Operations/AdvertisementsListRequest.md @@ -663,6 +616,7 @@ generatedFiles: - docs/Models/Operations/CustomerPortalOrdersListQueryParamOrganizationIDFilter.md - docs/Models/Operations/CustomerPortalOrdersListQueryParamProductIDFilter.md - docs/Models/Operations/CustomerPortalOrdersListQueryParamProductPriceTypeFilter.md + - docs/Models/Operations/CustomerPortalOrdersListQueryParamSubscriptionIDFilter.md - docs/Models/Operations/CustomerPortalOrdersListRequest.md - docs/Models/Operations/CustomerPortalOrdersListResponse.md - docs/Models/Operations/CustomerPortalOrganizationsGetRequest.md @@ -699,6 +653,14 @@ generatedFiles: - docs/Models/Operations/DiscountsListResponse.md - docs/Models/Operations/DiscountsUpdateRequest.md - docs/Models/Operations/DiscountsUpdateResponse.md + - docs/Models/Operations/EventsGetRequest.md + - docs/Models/Operations/EventsGetResponse.md + - docs/Models/Operations/EventsIngestResponse.md + - docs/Models/Operations/EventsListQueryParamCustomerIDFilter.md + - docs/Models/Operations/EventsListQueryParamOrganizationIDFilter.md + - docs/Models/Operations/EventsListRequest.md + - docs/Models/Operations/EventsListResponse.md + - docs/Models/Operations/ExternalCustomerIDFilter.md - docs/Models/Operations/ExternalOrganizationNameFilter.md - docs/Models/Operations/ExternalOrganizationsListRequest.md - docs/Models/Operations/ExternalOrganizationsListResponse.md @@ -722,6 +684,20 @@ generatedFiles: - docs/Models/Operations/LicenseKeysListResponse.md - docs/Models/Operations/LicenseKeysUpdateRequest.md - docs/Models/Operations/LicenseKeysUpdateResponse.md + - docs/Models/Operations/MetersCreateResponse.md + - docs/Models/Operations/MetersEventsRequest.md + - docs/Models/Operations/MetersEventsResponse.md + - docs/Models/Operations/MetersGetRequest.md + - docs/Models/Operations/MetersGetResponse.md + - docs/Models/Operations/MetersListQueryParamOrganizationIDFilter.md + - docs/Models/Operations/MetersListRequest.md + - docs/Models/Operations/MetersListResponse.md + - docs/Models/Operations/MetersQuantitiesQueryParamCustomerIDFilter.md + - docs/Models/Operations/MetersQuantitiesRequest.md + - docs/Models/Operations/MetersQuantitiesResponse.md + - docs/Models/Operations/MetersUpdateRequest.md + - docs/Models/Operations/MetersUpdateResponse.md + - docs/Models/Operations/MetricsGetQueryParamCustomerIDFilter.md - docs/Models/Operations/MetricsGetQueryParamOrganizationIDFilter.md - docs/Models/Operations/MetricsGetQueryParamProductIDFilter.md - docs/Models/Operations/MetricsGetRequest.md @@ -754,6 +730,7 @@ generatedFiles: - docs/Models/Operations/OrdersInvoiceResponse.md - docs/Models/Operations/OrdersListQueryParamCustomerIDFilter.md - docs/Models/Operations/OrdersListQueryParamOrganizationIDFilter.md + - docs/Models/Operations/OrdersListQueryParamProductIDFilter.md - docs/Models/Operations/OrdersListRequest.md - docs/Models/Operations/OrdersListResponse.md - docs/Models/Operations/OrganizationIDFilter.md @@ -782,12 +759,20 @@ generatedFiles: - docs/Models/Operations/QueryParamBenefitTypeFilter.md - docs/Models/Operations/QueryParamCustomerIDFilter.md - docs/Models/Operations/QueryParamDiscountIDFilter.md + - docs/Models/Operations/QueryParamExternalCustomerIDFilter.md + - docs/Models/Operations/QueryParamOrderIDFilter.md - docs/Models/Operations/QueryParamOrganizationIDFilter.md - docs/Models/Operations/QueryParamPlatformFilter.md - docs/Models/Operations/QueryParamProductIDFilter.md - docs/Models/Operations/QueryParamProductPriceTypeFilter.md - docs/Models/Operations/QueryParamRepositoryNameFilter.md - docs/Models/Operations/QueryParamSubscriptionIDFilter.md + - docs/Models/Operations/RefundIDFilter.md + - docs/Models/Operations/RefundsCreateResponse.md + - docs/Models/Operations/RefundsListQueryParamCustomerIDFilter.md + - docs/Models/Operations/RefundsListQueryParamOrganizationIDFilter.md + - docs/Models/Operations/RefundsListRequest.md + - docs/Models/Operations/RefundsListResponse.md - docs/Models/Operations/RepositoriesGetRequest.md - docs/Models/Operations/RepositoriesGetResponse.md - docs/Models/Operations/RepositoriesListRequest.md @@ -795,12 +780,19 @@ generatedFiles: - docs/Models/Operations/RepositoriesUpdateRequest.md - docs/Models/Operations/RepositoriesUpdateResponse.md - docs/Models/Operations/RepositoryNameFilter.md + - docs/Models/Operations/SourceFilter.md - docs/Models/Operations/SubscriptionIDFilter.md - docs/Models/Operations/SubscriptionsExportRequest.md - docs/Models/Operations/SubscriptionsExportResponse.md + - docs/Models/Operations/SubscriptionsGetRequest.md + - docs/Models/Operations/SubscriptionsGetResponse.md - docs/Models/Operations/SubscriptionsListQueryParamOrganizationIDFilter.md - docs/Models/Operations/SubscriptionsListRequest.md - docs/Models/Operations/SubscriptionsListResponse.md + - docs/Models/Operations/SubscriptionsRevokeRequest.md + - docs/Models/Operations/SubscriptionsRevokeResponse.md + - docs/Models/Operations/SubscriptionsUpdateRequest.md + - docs/Models/Operations/SubscriptionsUpdateResponse.md - docs/Models/Operations/TokenTypeHint.md - docs/Models/Webhooks/EndpointbenefitCreatedPostResponse.md - docs/Models/Webhooks/EndpointbenefitGrantCreatedPostResponse.md @@ -810,15 +802,19 @@ generatedFiles: - docs/Models/Webhooks/EndpointcheckoutCreatedPostResponse.md - docs/Models/Webhooks/EndpointcheckoutUpdatedPostResponse.md - docs/Models/Webhooks/EndpointorderCreatedPostResponse.md + - docs/Models/Webhooks/EndpointorderRefundedPostResponse.md - docs/Models/Webhooks/EndpointorganizationUpdatedPostResponse.md - docs/Models/Webhooks/EndpointpledgeCreatedPostResponse.md - docs/Models/Webhooks/EndpointpledgeUpdatedPostResponse.md - docs/Models/Webhooks/EndpointproductCreatedPostResponse.md - docs/Models/Webhooks/EndpointproductUpdatedPostResponse.md + - docs/Models/Webhooks/EndpointrefundCreatedPostResponse.md + - docs/Models/Webhooks/EndpointrefundUpdatedPostResponse.md - docs/Models/Webhooks/EndpointsubscriptionActivePostResponse.md - docs/Models/Webhooks/EndpointsubscriptionCanceledPostResponse.md - docs/Models/Webhooks/EndpointsubscriptionCreatedPostResponse.md - docs/Models/Webhooks/EndpointsubscriptionRevokedPostResponse.md + - docs/Models/Webhooks/EndpointsubscriptionUncanceledPostResponse.md - docs/Models/Webhooks/EndpointsubscriptionUpdatedPostResponse.md - docs/sdks/advertisements/README.md - docs/sdks/benefitgrants/README.md @@ -833,9 +829,11 @@ generatedFiles: - docs/sdks/customfields/README.md - docs/sdks/discounts/README.md - docs/sdks/downloadables/README.md + - docs/sdks/events/README.md - docs/sdks/externalorganizations/README.md - docs/sdks/files/README.md - docs/sdks/licensekeys/README.md + - docs/sdks/meters/README.md - docs/sdks/metrics/README.md - docs/sdks/oauth2/README.md - docs/sdks/orders/README.md @@ -847,6 +845,7 @@ generatedFiles: - docs/sdks/polarorganizations/README.md - docs/sdks/polarsubscriptions/README.md - docs/sdks/products/README.md + - docs/sdks/refunds/README.md - docs/sdks/repositories/README.md - docs/sdks/subscriptions/README.md - phpstan.neon @@ -866,6 +865,7 @@ generatedFiles: - src/Customers.php - src/Discounts.php - src/Downloadables.php + - src/Events.php - src/ExternalOrganizations.php - src/Files.php - src/Hooks/AfterErrorContext.php @@ -885,77 +885,55 @@ generatedFiles: - src/Hooks/Session.php - src/Hooks/TokenResponse.php - src/LicenseKeys.php + - src/Meters.php - src/Metrics.php - src/Models/Components/Address.php - src/Models/Components/AdvertisementCampaign.php - src/Models/Components/AdvertisementCampaignListResource.php - src/Models/Components/AdvertisementSortProperty.php - - src/Models/Components/AmountType.php - src/Models/Components/Assignee.php - src/Models/Components/AttachedCustomField.php - src/Models/Components/AttachedCustomFieldCreate.php - src/Models/Components/Author.php - src/Models/Components/AuthorizeOrganization.php - src/Models/Components/AuthorizeResponseOrganization.php - - src/Models/Components/AuthorizeResponseOrganizationSubType.php - src/Models/Components/AuthorizeResponseUser.php - - src/Models/Components/AuthorizeResponseUserSubType.php - src/Models/Components/AuthorizeUser.php - src/Models/Components/BenefitAds.php - src/Models/Components/BenefitAdsCreate.php - - src/Models/Components/BenefitAdsCreateType.php - src/Models/Components/BenefitAdsProperties.php - src/Models/Components/BenefitAdsSubscriber.php - - src/Models/Components/BenefitAdsSubscriberType.php - - src/Models/Components/BenefitAdsType.php - src/Models/Components/BenefitAdsUpdate.php - - src/Models/Components/BenefitAdsUpdateType.php - src/Models/Components/BenefitBase.php - src/Models/Components/BenefitCustom.php - src/Models/Components/BenefitCustomCreate.php - src/Models/Components/BenefitCustomCreateProperties.php - - src/Models/Components/BenefitCustomCreateType.php - src/Models/Components/BenefitCustomProperties.php - src/Models/Components/BenefitCustomSubscriber.php - src/Models/Components/BenefitCustomSubscriberProperties.php - - src/Models/Components/BenefitCustomSubscriberType.php - - src/Models/Components/BenefitCustomType.php - src/Models/Components/BenefitCustomUpdate.php - - src/Models/Components/BenefitCustomUpdateType.php - src/Models/Components/BenefitDiscord.php - src/Models/Components/BenefitDiscordCreate.php - src/Models/Components/BenefitDiscordCreateProperties.php - - src/Models/Components/BenefitDiscordCreateType.php - src/Models/Components/BenefitDiscordProperties.php - src/Models/Components/BenefitDiscordSubscriber.php - src/Models/Components/BenefitDiscordSubscriberProperties.php - - src/Models/Components/BenefitDiscordSubscriberType.php - - src/Models/Components/BenefitDiscordType.php - src/Models/Components/BenefitDiscordUpdate.php - - src/Models/Components/BenefitDiscordUpdateType.php - src/Models/Components/BenefitDownloadables.php - src/Models/Components/BenefitDownloadablesCreate.php - src/Models/Components/BenefitDownloadablesCreateProperties.php - - src/Models/Components/BenefitDownloadablesCreateType.php - src/Models/Components/BenefitDownloadablesProperties.php - src/Models/Components/BenefitDownloadablesSubscriber.php - src/Models/Components/BenefitDownloadablesSubscriberProperties.php - - src/Models/Components/BenefitDownloadablesSubscriberType.php - - src/Models/Components/BenefitDownloadablesType.php - src/Models/Components/BenefitDownloadablesUpdate.php - - src/Models/Components/BenefitDownloadablesUpdateType.php - src/Models/Components/BenefitGitHubRepository.php - src/Models/Components/BenefitGitHubRepositoryCreate.php - src/Models/Components/BenefitGitHubRepositoryCreateProperties.php - src/Models/Components/BenefitGitHubRepositoryCreatePropertiesPermission.php - - src/Models/Components/BenefitGitHubRepositoryCreateType.php - src/Models/Components/BenefitGitHubRepositoryProperties.php - src/Models/Components/BenefitGitHubRepositorySubscriber.php - src/Models/Components/BenefitGitHubRepositorySubscriberProperties.php - - src/Models/Components/BenefitGitHubRepositorySubscriberType.php - - src/Models/Components/BenefitGitHubRepositoryType.php - src/Models/Components/BenefitGitHubRepositoryUpdate.php - - src/Models/Components/BenefitGitHubRepositoryUpdateType.php - src/Models/Components/BenefitGrant.php - src/Models/Components/BenefitGrantAdsProperties.php - src/Models/Components/BenefitGrantCustomProperties.php @@ -970,19 +948,13 @@ generatedFiles: - src/Models/Components/BenefitLicenseKeys.php - src/Models/Components/BenefitLicenseKeysCreate.php - src/Models/Components/BenefitLicenseKeysCreateProperties.php - - src/Models/Components/BenefitLicenseKeysCreateType.php - src/Models/Components/BenefitLicenseKeysProperties.php - src/Models/Components/BenefitLicenseKeysSubscriber.php - src/Models/Components/BenefitLicenseKeysSubscriberProperties.php - - src/Models/Components/BenefitLicenseKeysSubscriberType.php - - src/Models/Components/BenefitLicenseKeysType.php - src/Models/Components/BenefitLicenseKeysUpdate.php - - src/Models/Components/BenefitLicenseKeysUpdateType.php - src/Models/Components/BenefitType.php - src/Models/Components/Checkout.php - src/Models/Components/CheckoutConfirmStripe.php - - src/Models/Components/CheckoutConfirmStripeCustomFieldData.php - - src/Models/Components/CheckoutCustomFieldData.php - src/Models/Components/CheckoutDiscountFixedOnceForeverDuration.php - src/Models/Components/CheckoutDiscountFixedRepeatDuration.php - src/Models/Components/CheckoutDiscountPercentageOnceForeverDuration.php @@ -991,93 +963,62 @@ generatedFiles: - src/Models/Components/CheckoutLegacyCreate.php - src/Models/Components/CheckoutLink.php - src/Models/Components/CheckoutLinkPriceCreate.php - - src/Models/Components/CheckoutLinkPriceCreatePaymentProcessor.php - src/Models/Components/CheckoutLinkProduct.php - src/Models/Components/CheckoutLinkProductCreate.php - - src/Models/Components/CheckoutLinkProductCreatePaymentProcessor.php - src/Models/Components/CheckoutLinkSortProperty.php - src/Models/Components/CheckoutLinkUpdate.php - src/Models/Components/CheckoutPriceCreate.php - - src/Models/Components/CheckoutPriceCreateCustomFieldData.php - - src/Models/Components/CheckoutPriceCreatePaymentProcessor.php - src/Models/Components/CheckoutProduct.php - src/Models/Components/CheckoutProductCreate.php - - src/Models/Components/CheckoutProductCreateCustomFieldData.php - - src/Models/Components/CheckoutProductCreatePaymentProcessor.php - src/Models/Components/CheckoutPublic.php - src/Models/Components/CheckoutPublicConfirmed.php - - src/Models/Components/CheckoutPublicConfirmedCustomFieldData.php - - src/Models/Components/CheckoutPublicConfirmedPaymentProcessorMetadata.php - - src/Models/Components/CheckoutPublicCustomFieldData.php - - src/Models/Components/CheckoutPublicPaymentProcessorMetadata.php - src/Models/Components/CheckoutSortProperty.php - src/Models/Components/CheckoutStatus.php - src/Models/Components/CheckoutUpdate.php - src/Models/Components/CheckoutUpdatePublic.php - - src/Models/Components/CheckoutUpdatePublicCustomFieldData.php - src/Models/Components/Conditions.php + - src/Models/Components/CountAggregation.php - src/Models/Components/CurrencyAmount.php - src/Models/Components/CustomFieldCheckbox.php - src/Models/Components/CustomFieldCheckboxProperties.php - - src/Models/Components/CustomFieldCheckboxType.php - src/Models/Components/CustomFieldCreateCheckbox.php - - src/Models/Components/CustomFieldCreateCheckboxType.php - src/Models/Components/CustomFieldCreateDate.php - - src/Models/Components/CustomFieldCreateDateType.php - src/Models/Components/CustomFieldCreateNumber.php - - src/Models/Components/CustomFieldCreateNumberType.php - src/Models/Components/CustomFieldCreateSelect.php - - src/Models/Components/CustomFieldCreateSelectType.php - src/Models/Components/CustomFieldCreateText.php - - src/Models/Components/CustomFieldCreateTextType.php - - src/Models/Components/CustomFieldData.php - src/Models/Components/CustomFieldDate.php - src/Models/Components/CustomFieldDateProperties.php - - src/Models/Components/CustomFieldDateType.php - src/Models/Components/CustomFieldNumber.php - src/Models/Components/CustomFieldNumberProperties.php - - src/Models/Components/CustomFieldNumberType.php - src/Models/Components/CustomFieldSelect.php - src/Models/Components/CustomFieldSelectOption.php - src/Models/Components/CustomFieldSelectProperties.php - - src/Models/Components/CustomFieldSelectType.php - src/Models/Components/CustomFieldSortProperty.php - src/Models/Components/CustomFieldText.php - src/Models/Components/CustomFieldTextProperties.php - - src/Models/Components/CustomFieldTextType.php - src/Models/Components/CustomFieldType.php - src/Models/Components/CustomFieldUpdateCheckbox.php - - src/Models/Components/CustomFieldUpdateCheckboxType.php - src/Models/Components/CustomFieldUpdateDate.php - - src/Models/Components/CustomFieldUpdateDateType.php - src/Models/Components/CustomFieldUpdateNumber.php - - src/Models/Components/CustomFieldUpdateNumberType.php - src/Models/Components/CustomFieldUpdateSelect.php - - src/Models/Components/CustomFieldUpdateSelectType.php - src/Models/Components/CustomFieldUpdateText.php - - src/Models/Components/CustomFieldUpdateTextType.php - src/Models/Components/Customer.php - src/Models/Components/CustomerBenefitGrantAds.php - src/Models/Components/CustomerBenefitGrantAdsUpdate.php - - src/Models/Components/CustomerBenefitGrantAdsUpdateBenefitType.php - src/Models/Components/CustomerBenefitGrantCustom.php - src/Models/Components/CustomerBenefitGrantCustomUpdate.php - - src/Models/Components/CustomerBenefitGrantCustomUpdateBenefitType.php - src/Models/Components/CustomerBenefitGrantDiscord.php - src/Models/Components/CustomerBenefitGrantDiscordPropertiesUpdate.php - src/Models/Components/CustomerBenefitGrantDiscordUpdate.php - - src/Models/Components/CustomerBenefitGrantDiscordUpdateBenefitType.php - src/Models/Components/CustomerBenefitGrantDownloadables.php - src/Models/Components/CustomerBenefitGrantDownloadablesUpdate.php - - src/Models/Components/CustomerBenefitGrantDownloadablesUpdateBenefitType.php - src/Models/Components/CustomerBenefitGrantGitHubRepository.php - src/Models/Components/CustomerBenefitGrantGitHubRepositoryPropertiesUpdate.php - src/Models/Components/CustomerBenefitGrantGitHubRepositoryUpdate.php - - src/Models/Components/CustomerBenefitGrantGitHubRepositoryUpdateBenefitType.php - src/Models/Components/CustomerBenefitGrantLicenseKeys.php - src/Models/Components/CustomerBenefitGrantLicenseKeysUpdate.php - - src/Models/Components/CustomerBenefitGrantLicenseKeysUpdateBenefitType.php - src/Models/Components/CustomerBenefitGrantSortProperty.php + - src/Models/Components/CustomerCancellationReason.php - src/Models/Components/CustomerCreate.php - src/Models/Components/CustomerOrder.php - src/Models/Components/CustomerOrderInvoice.php @@ -1090,9 +1031,10 @@ generatedFiles: - src/Models/Components/CustomerSessionCreate.php - src/Models/Components/CustomerSortProperty.php - src/Models/Components/CustomerSubscription.php + - src/Models/Components/CustomerSubscriptionCancel.php - src/Models/Components/CustomerSubscriptionProduct.php - src/Models/Components/CustomerSubscriptionSortProperty.php - - src/Models/Components/CustomerSubscriptionUpdate.php + - src/Models/Components/CustomerSubscriptionUpdatePrice.php - src/Models/Components/CustomerUpdate.php - src/Models/Components/DiscountDuration.php - src/Models/Components/DiscountFixedOnceForeverDuration.php @@ -1112,10 +1054,15 @@ generatedFiles: - src/Models/Components/DiscountType.php - src/Models/Components/DiscountUpdate.php - src/Models/Components/DownloadableFileCreate.php - - src/Models/Components/DownloadableFileCreateService.php - src/Models/Components/DownloadableFileRead.php - - src/Models/Components/DownloadableFileReadService.php - src/Models/Components/DownloadableRead.php + - src/Models/Components/Event.php + - src/Models/Components/EventCreateCustomer.php + - src/Models/Components/EventCreateExternalCustomer.php + - src/Models/Components/EventSortProperty.php + - src/Models/Components/EventSource.php + - src/Models/Components/EventsIngest.php + - src/Models/Components/EventsIngestResponse.php - src/Models/Components/ExistingProductPrice.php - src/Models/Components/ExternalOrganization.php - src/Models/Components/ExternalOrganizationSortProperty.php @@ -1124,12 +1071,14 @@ generatedFiles: - src/Models/Components/FileServiceTypes.php - src/Models/Components/FileUpload.php - src/Models/Components/FileUploadCompleted.php + - src/Models/Components/Filter.php + - src/Models/Components/FilterClause.php + - src/Models/Components/FilterConjunction.php + - src/Models/Components/FilterOperator.php + - src/Models/Components/Func.php - src/Models/Components/Funding.php - - src/Models/Components/GrantType.php - src/Models/Components/GrantTypes.php - - src/Models/Components/Interval.php - src/Models/Components/IntrospectTokenResponse.php - - src/Models/Components/IntrospectTokenResponseTokenType.php - src/Models/Components/Issue.php - src/Models/Components/Label.php - src/Models/Components/LicenseKeyActivate.php @@ -1157,16 +1106,25 @@ generatedFiles: - src/Models/Components/ListResourceCustomerSubscription.php - src/Models/Components/ListResourceDiscount.php - src/Models/Components/ListResourceDownloadableRead.php + - src/Models/Components/ListResourceEvent.php - src/Models/Components/ListResourceExternalOrganization.php - src/Models/Components/ListResourceFileRead.php - src/Models/Components/ListResourceLicenseKeyRead.php + - src/Models/Components/ListResourceMeter.php - src/Models/Components/ListResourceOAuth2Client.php - src/Models/Components/ListResourceOrder.php - src/Models/Components/ListResourceOrganization.php - src/Models/Components/ListResourceProduct.php + - src/Models/Components/ListResourceRefund.php - src/Models/Components/ListResourceRepository.php - src/Models/Components/ListResourceSubscription.php - src/Models/Components/Meta.php + - src/Models/Components/Meter.php + - src/Models/Components/MeterCreate.php + - src/Models/Components/MeterQuantities.php + - src/Models/Components/MeterQuantity.php + - src/Models/Components/MeterSortProperty.php + - src/Models/Components/MeterUpdate.php - src/Models/Components/Metric.php - src/Models/Components/MetricPeriod.php - src/Models/Components/MetricType.php @@ -1178,19 +1136,15 @@ generatedFiles: - src/Models/Components/OAuth2Client.php - src/Models/Components/OAuth2ClientConfiguration.php - src/Models/Components/OAuth2ClientConfigurationGrantTypes.php - - src/Models/Components/OAuth2ClientConfigurationResponseTypes.php - src/Models/Components/OAuth2ClientConfigurationTokenEndpointAuthMethod.php - src/Models/Components/OAuth2ClientConfigurationUpdate.php - src/Models/Components/OAuth2ClientConfigurationUpdateGrantTypes.php - - src/Models/Components/OAuth2ClientConfigurationUpdateResponseTypes.php - src/Models/Components/OAuth2ClientConfigurationUpdateTokenEndpointAuthMethod.php - src/Models/Components/OAuth2ClientPublic.php - src/Models/Components/Onev11oauth21tokenPostXComponentsAuthorizationCodeTokenRequest.php - src/Models/Components/Onev11oauth21tokenPostXComponentsRefreshTokenRequest.php - - src/Models/Components/Onev11oauth21tokenPostXComponentsRefreshTokenRequestGrantType.php - src/Models/Components/Order.php - src/Models/Components/OrderBillingReason.php - - src/Models/Components/OrderCustomFieldData.php - src/Models/Components/OrderCustomer.php - src/Models/Components/OrderInvoice.php - src/Models/Components/OrderProduct.php @@ -1199,18 +1153,16 @@ generatedFiles: - src/Models/Components/OrderUser.php - src/Models/Components/Organization.php - src/Models/Components/OrganizationAvatarFileCreate.php - - src/Models/Components/OrganizationAvatarFileCreateService.php - src/Models/Components/OrganizationAvatarFileRead.php - - src/Models/Components/OrganizationAvatarFileReadService.php - src/Models/Components/OrganizationCreate.php - src/Models/Components/OrganizationFeatureSettings.php - src/Models/Components/OrganizationProfileSettings.php - src/Models/Components/OrganizationSortProperty.php - src/Models/Components/OrganizationSubscribePromoteSettings.php + - src/Models/Components/OrganizationSubscriptionSettings.php - src/Models/Components/OrganizationUpdate.php - src/Models/Components/Pagination.php - src/Models/Components/PaymentProcessor.php - - src/Models/Components/PaymentProcessorMetadata.php - src/Models/Components/Permission.php - src/Models/Components/Platforms.php - src/Models/Components/Pledge.php @@ -1220,51 +1172,35 @@ generatedFiles: - src/Models/Components/Product.php - src/Models/Components/ProductBenefitsUpdate.php - src/Models/Components/ProductMediaFileCreate.php - - src/Models/Components/ProductMediaFileCreateService.php - src/Models/Components/ProductMediaFileRead.php - src/Models/Components/ProductOneTimeCreate.php - src/Models/Components/ProductPriceOneTimeCustom.php - - src/Models/Components/ProductPriceOneTimeCustomAmountType.php - src/Models/Components/ProductPriceOneTimeCustomCreate.php - - src/Models/Components/ProductPriceOneTimeCustomCreateAmountType.php - - src/Models/Components/ProductPriceOneTimeCustomCreateType.php - - src/Models/Components/ProductPriceOneTimeCustomType.php - src/Models/Components/ProductPriceOneTimeFixed.php - - src/Models/Components/ProductPriceOneTimeFixedAmountType.php - src/Models/Components/ProductPriceOneTimeFixedCreate.php - - src/Models/Components/ProductPriceOneTimeFixedCreateAmountType.php - - src/Models/Components/ProductPriceOneTimeFixedCreateType.php - - src/Models/Components/ProductPriceOneTimeFixedType.php - src/Models/Components/ProductPriceOneTimeFree.php - - src/Models/Components/ProductPriceOneTimeFreeAmountType.php - src/Models/Components/ProductPriceOneTimeFreeCreate.php - - src/Models/Components/ProductPriceOneTimeFreeCreateAmountType.php - - src/Models/Components/ProductPriceOneTimeFreeCreateType.php - - src/Models/Components/ProductPriceOneTimeFreeType.php - src/Models/Components/ProductPriceRecurringCustom.php - - src/Models/Components/ProductPriceRecurringCustomAmountType.php - - src/Models/Components/ProductPriceRecurringCustomType.php - src/Models/Components/ProductPriceRecurringFixed.php - src/Models/Components/ProductPriceRecurringFixedCreate.php - - src/Models/Components/ProductPriceRecurringFixedCreateAmountType.php - - src/Models/Components/ProductPriceRecurringFixedCreateType.php - src/Models/Components/ProductPriceRecurringFree.php - - src/Models/Components/ProductPriceRecurringFreeAmountType.php - src/Models/Components/ProductPriceRecurringFreeCreate.php - - src/Models/Components/ProductPriceRecurringFreeCreateAmountType.php - - src/Models/Components/ProductPriceRecurringFreeCreateType.php - - src/Models/Components/ProductPriceRecurringFreeType.php - src/Models/Components/ProductPriceType.php - src/Models/Components/ProductRecurringCreate.php - src/Models/Components/ProductSortProperty.php - src/Models/Components/ProductUpdate.php + - src/Models/Components/PropertyAggregation.php - src/Models/Components/Reactions.php + - src/Models/Components/Refund.php + - src/Models/Components/RefundCreate.php + - src/Models/Components/RefundReason.php + - src/Models/Components/RefundSortProperty.php + - src/Models/Components/RefundStatus.php - src/Models/Components/Repository.php - src/Models/Components/RepositoryProfileSettings.php - src/Models/Components/RepositoryProfileSettingsUpdate.php - src/Models/Components/RepositorySortProperty.php - src/Models/Components/RepositoryUpdate.php - - src/Models/Components/ResponseTypes.php - src/Models/Components/RevokeTokenResponse.php - src/Models/Components/S3DownloadURL.php - src/Models/Components/S3FileCreateMultipart.php @@ -1274,77 +1210,65 @@ generatedFiles: - src/Models/Components/S3FileUploadPart.php - src/Models/Components/Scope.php - src/Models/Components/Security.php - - src/Models/Components/Service.php - src/Models/Components/State.php - - src/Models/Components/Status.php - src/Models/Components/SubType.php - src/Models/Components/Subscription.php - - src/Models/Components/SubscriptionCustomFieldData.php + - src/Models/Components/SubscriptionCancel.php - src/Models/Components/SubscriptionCustomer.php + - src/Models/Components/SubscriptionProrationBehavior.php - src/Models/Components/SubscriptionRecurringInterval.php - src/Models/Components/SubscriptionSortProperty.php - src/Models/Components/SubscriptionStatus.php + - src/Models/Components/SubscriptionUpdatePrice.php - src/Models/Components/SubscriptionUser.php - src/Models/Components/TaxIDFormat.php + - src/Models/Components/TimeInterval.php - src/Models/Components/Timeframe.php - src/Models/Components/TokenEndpointAuthMethod.php - src/Models/Components/TokenResponse.php - src/Models/Components/TokenType.php - - src/Models/Components/Type.php - src/Models/Components/UserInfoOrganization.php - src/Models/Components/UserInfoUser.php - src/Models/Components/ValidatedLicenseKey.php - src/Models/Components/ValidationError.php - src/Models/Components/WebhookBenefitCreatedPayload.php - - src/Models/Components/WebhookBenefitCreatedPayloadType.php - src/Models/Components/WebhookBenefitGrantCreatedPayload.php - - src/Models/Components/WebhookBenefitGrantCreatedPayloadType.php - src/Models/Components/WebhookBenefitGrantRevokedPayload.php - - src/Models/Components/WebhookBenefitGrantRevokedPayloadType.php - src/Models/Components/WebhookBenefitGrantUpdatedPayload.php - - src/Models/Components/WebhookBenefitGrantUpdatedPayloadType.php - src/Models/Components/WebhookBenefitUpdatedPayload.php - - src/Models/Components/WebhookBenefitUpdatedPayloadType.php - src/Models/Components/WebhookCheckoutCreatedPayload.php - - src/Models/Components/WebhookCheckoutCreatedPayloadType.php - src/Models/Components/WebhookCheckoutUpdatedPayload.php - - src/Models/Components/WebhookCheckoutUpdatedPayloadType.php - src/Models/Components/WebhookOrderCreatedPayload.php - - src/Models/Components/WebhookOrderCreatedPayloadType.php + - src/Models/Components/WebhookOrderRefundedPayload.php - src/Models/Components/WebhookOrganizationUpdatedPayload.php - - src/Models/Components/WebhookOrganizationUpdatedPayloadType.php - src/Models/Components/WebhookPledgeCreatedPayload.php - - src/Models/Components/WebhookPledgeCreatedPayloadType.php - src/Models/Components/WebhookPledgeUpdatedPayload.php - - src/Models/Components/WebhookPledgeUpdatedPayloadType.php - src/Models/Components/WebhookProductCreatedPayload.php - - src/Models/Components/WebhookProductCreatedPayloadType.php - src/Models/Components/WebhookProductUpdatedPayload.php - - src/Models/Components/WebhookProductUpdatedPayloadType.php + - src/Models/Components/WebhookRefundCreatedPayload.php + - src/Models/Components/WebhookRefundUpdatedPayload.php - src/Models/Components/WebhookSubscriptionActivePayload.php - - src/Models/Components/WebhookSubscriptionActivePayloadType.php - src/Models/Components/WebhookSubscriptionCanceledPayload.php - - src/Models/Components/WebhookSubscriptionCanceledPayloadType.php - src/Models/Components/WebhookSubscriptionCreatedPayload.php - - src/Models/Components/WebhookSubscriptionCreatedPayloadType.php - src/Models/Components/WebhookSubscriptionRevokedPayload.php - - src/Models/Components/WebhookSubscriptionRevokedPayloadType.php + - src/Models/Components/WebhookSubscriptionUncanceledPayload.php - src/Models/Components/WebhookSubscriptionUpdatedPayload.php - - src/Models/Components/WebhookSubscriptionUpdatedPayloadType.php - src/Models/Errors/APIException.php + - src/Models/Errors/AlreadyActiveSubscriptionError.php + - src/Models/Errors/AlreadyActiveSubscriptionErrorThrowable.php - src/Models/Errors/AlreadyCanceledSubscription.php - - src/Models/Errors/AlreadyCanceledSubscriptionError.php - src/Models/Errors/AlreadyCanceledSubscriptionThrowable.php - - src/Models/Errors/Error.php - src/Models/Errors/HTTPValidationError.php - src/Models/Errors/HTTPValidationErrorThrowable.php - src/Models/Errors/NotPermitted.php - - src/Models/Errors/NotPermittedError.php - src/Models/Errors/NotPermittedThrowable.php + - src/Models/Errors/RefundAmountTooHigh.php + - src/Models/Errors/RefundAmountTooHighThrowable.php + - src/Models/Errors/RefundedAlready.php + - src/Models/Errors/RefundedAlreadyThrowable.php - src/Models/Errors/ResourceNotFound.php - src/Models/Errors/ResourceNotFoundThrowable.php - src/Models/Errors/Unauthorized.php - - src/Models/Errors/UnauthorizedError.php - src/Models/Errors/UnauthorizedThrowable.php - src/Models/Operations/AdvertisementsGetRequest.php - src/Models/Operations/AdvertisementsGetResponse.php @@ -1449,6 +1373,11 @@ generatedFiles: - src/Models/Operations/DiscountsListResponse.php - src/Models/Operations/DiscountsUpdateRequest.php - src/Models/Operations/DiscountsUpdateResponse.php + - src/Models/Operations/EventsGetRequest.php + - src/Models/Operations/EventsGetResponse.php + - src/Models/Operations/EventsIngestResponse.php + - src/Models/Operations/EventsListRequest.php + - src/Models/Operations/EventsListResponse.php - src/Models/Operations/ExternalOrganizationsListRequest.php - src/Models/Operations/ExternalOrganizationsListResponse.php - src/Models/Operations/FilesCreateResponse.php @@ -1468,6 +1397,17 @@ generatedFiles: - src/Models/Operations/LicenseKeysListResponse.php - src/Models/Operations/LicenseKeysUpdateRequest.php - src/Models/Operations/LicenseKeysUpdateResponse.php + - src/Models/Operations/MetersCreateResponse.php + - src/Models/Operations/MetersEventsRequest.php + - src/Models/Operations/MetersEventsResponse.php + - src/Models/Operations/MetersGetRequest.php + - src/Models/Operations/MetersGetResponse.php + - src/Models/Operations/MetersListRequest.php + - src/Models/Operations/MetersListResponse.php + - src/Models/Operations/MetersQuantitiesRequest.php + - src/Models/Operations/MetersQuantitiesResponse.php + - src/Models/Operations/MetersUpdateRequest.php + - src/Models/Operations/MetersUpdateResponse.php - src/Models/Operations/MetricsGetRequest.php - src/Models/Operations/MetricsGetResponse.php - src/Models/Operations/MetricsLimitsResponse.php @@ -1510,6 +1450,9 @@ generatedFiles: - src/Models/Operations/ProductsUpdateBenefitsResponse.php - src/Models/Operations/ProductsUpdateRequest.php - src/Models/Operations/ProductsUpdateResponse.php + - src/Models/Operations/RefundsCreateResponse.php + - src/Models/Operations/RefundsListRequest.php + - src/Models/Operations/RefundsListResponse.php - src/Models/Operations/RepositoriesGetRequest.php - src/Models/Operations/RepositoriesGetResponse.php - src/Models/Operations/RepositoriesListRequest.php @@ -1518,8 +1461,14 @@ generatedFiles: - src/Models/Operations/RepositoriesUpdateResponse.php - src/Models/Operations/SubscriptionsExportRequest.php - src/Models/Operations/SubscriptionsExportResponse.php + - src/Models/Operations/SubscriptionsGetRequest.php + - src/Models/Operations/SubscriptionsGetResponse.php - src/Models/Operations/SubscriptionsListRequest.php - src/Models/Operations/SubscriptionsListResponse.php + - src/Models/Operations/SubscriptionsRevokeRequest.php + - src/Models/Operations/SubscriptionsRevokeResponse.php + - src/Models/Operations/SubscriptionsUpdateRequest.php + - src/Models/Operations/SubscriptionsUpdateResponse.php - src/Models/Operations/TokenTypeHint.php - src/Models/Webhooks/EndpointbenefitCreatedPostResponse.php - src/Models/Webhooks/EndpointbenefitGrantCreatedPostResponse.php @@ -1529,19 +1478,24 @@ generatedFiles: - src/Models/Webhooks/EndpointcheckoutCreatedPostResponse.php - src/Models/Webhooks/EndpointcheckoutUpdatedPostResponse.php - src/Models/Webhooks/EndpointorderCreatedPostResponse.php + - src/Models/Webhooks/EndpointorderRefundedPostResponse.php - src/Models/Webhooks/EndpointorganizationUpdatedPostResponse.php - src/Models/Webhooks/EndpointpledgeCreatedPostResponse.php - src/Models/Webhooks/EndpointpledgeUpdatedPostResponse.php - src/Models/Webhooks/EndpointproductCreatedPostResponse.php - src/Models/Webhooks/EndpointproductUpdatedPostResponse.php + - src/Models/Webhooks/EndpointrefundCreatedPostResponse.php + - src/Models/Webhooks/EndpointrefundUpdatedPostResponse.php - src/Models/Webhooks/EndpointsubscriptionActivePostResponse.php - src/Models/Webhooks/EndpointsubscriptionCanceledPostResponse.php - src/Models/Webhooks/EndpointsubscriptionCreatedPostResponse.php - src/Models/Webhooks/EndpointsubscriptionRevokedPostResponse.php + - src/Models/Webhooks/EndpointsubscriptionUncanceledPostResponse.php - src/Models/Webhooks/EndpointsubscriptionUpdatedPostResponse.php - src/Oauth2.php - src/Orders.php - src/Organizations.php + - src/PackageServiceProvider.php - src/Polar.php - src/PolarBuilder.php - src/PolarCustomers.php @@ -1550,6 +1504,7 @@ generatedFiles: - src/PolarOrganizations.php - src/PolarSubscriptions.php - src/Products.php + - src/Refunds.php - src/Repositories.php - src/SDKConfiguration.php - src/Subscriptions.php @@ -1567,12 +1522,20 @@ generatedFiles: - src/Utils/JSON.php - src/Utils/MixedJSONHandler.php - src/Utils/MultipartMetadata.php + - src/Utils/Options.php - src/Utils/ParamsMetadata.php - src/Utils/PathParameters.php - src/Utils/PhpDocTypeParser.php - src/Utils/QueryParameters.php - src/Utils/RequestBodies.php - src/Utils/RequestMetadata.php + - src/Utils/Retry/PermanentError.php + - src/Utils/Retry/RetryConfig.php + - src/Utils/Retry/RetryConfigBackoff.php + - src/Utils/Retry/RetryConfigNone.php + - src/Utils/Retry/RetryStrategy.php + - src/Utils/Retry/RetryUtils.php + - src/Utils/Retry/TemporaryError.php - src/Utils/Security.php - src/Utils/SecurityClient.php - src/Utils/SecurityMetadata.php @@ -1584,7 +1547,7 @@ examples: _endpointcheckout_created_post: speakeasy-default-endpointcheckout-created-post: requestBody: - application/json: {"data": {"created_at": "2024-11-12T14:26:42.882Z", "modified_at": "2023-05-28T05:08:06.235Z", "id": "", "status": "failed", "client_secret": "", "url": "https://heavy-beret.com/", "expires_at": "2022-02-25T02:26:48.460Z", "success_url": "https://sardonic-final.info/", "embed_origin": "", "amount": 962818, "tax_amount": 6400, "currency": "Yen", "subtotal_amount": 648726, "total_amount": 210702, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": true, "is_discount_applicable": false, "is_free_product_price": false, "is_payment_required": false, "is_payment_setup_required": false, "is_payment_form_required": false, "customer_id": "", "customer_name": "", "customer_email": "Ryley_Erdman@hotmail.com", "customer_ip_address": "", "customer_billing_address": {"country": "South Africa"}, "customer_tax_id": "", "metadata": {"key": 18677, "key1": 95370}, "product": {"created_at": "2022-04-02T00:05:42.586Z", "modified_at": "2023-12-16T03:02:38.803Z", "id": "", "name": "", "description": "for embarrassment untidy long-term near honestly separate yet", "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2024-11-19T15:59:15.588Z", "modified_at": "2022-11-17T00:11:23.972Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 75876, "maximum_amount": 82334, "preset_amount": 50275}], "benefits": [{"created_at": "2023-08-22T00:47:02.059Z", "modified_at": "2023-06-04T10:32:44.101Z", "id": "", "type": "license_keys", "description": "within jacket unless", "selectable": false, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/private/var", "mime_type": "", "size": 245189, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-11-03T15:00:03.276Z", "version": "", "is_uploaded": false, "created_at": "2024-06-07T13:47:02.365Z", "size_readable": "", "public_url": "https://webbed-experience.name/"}]}, "product_price": {"created_at": "2022-12-28T20:59:29.904Z", "modified_at": "2023-04-04T00:20:23.805Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "month"}, "discount": {"duration": "repeating", "type": "fixed", "basis_points": 341163, "id": "", "name": "", "code": ""}, "subscription_id": "", "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2023-12-13T00:05:03.649Z", "modified_at": "2022-08-19T22:18:44.316Z", "id": "", "metadata": {"key": false}, "slug": "", "name": "", "organization_id": ""}, "order": 996863, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2024-01-25T18:08:49.597Z", "modified_at": "2024-07-22T12:18:02.066Z", "id": "", "metadata": {"key": true, "key1": "", "key2": 385218}, "slug": "", "name": "", "organization_id": ""}, "order": 72589, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2024-06-25T22:47:14.264Z", "modified_at": "2024-01-28T19:10:37.564Z", "id": "", "metadata": {"key": ""}, "slug": "", "name": "", "organization_id": ""}, "order": 161325, "required": true}], "customer_metadata": {"key": 95370, "key1": ""}}} + application/json: {"data": {"created_at": "2025-11-12T14:26:42.882Z", "modified_at": "2024-05-27T05:08:06.235Z", "id": "", "payment_processor": "stripe", "status": "failed", "client_secret": "", "url": "https://heavy-beret.com/", "expires_at": "2023-02-25T02:26:48.460Z", "success_url": "https://sardonic-final.info/", "embed_origin": "", "amount": 962818, "tax_amount": 6400, "currency": "Yen", "subtotal_amount": 648726, "total_amount": 210702, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": true, "is_discount_applicable": false, "is_free_product_price": false, "is_payment_required": false, "is_payment_setup_required": false, "is_payment_form_required": false, "customer_id": "", "customer_name": "", "customer_email": "", "customer_ip_address": "", "customer_billing_address": {"country": "Solomon Islands"}, "customer_tax_id": "", "payment_processor_metadata": {"key": "", "key1": "", "key2": ""}, "metadata": {"key": ""}, "product": {"created_at": "2024-11-17T19:11:13.132Z", "modified_at": "2024-02-27T04:46:39.621Z", "id": "", "name": "", "description": "border opposite overload interior shady", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [], "benefits": [{"created_at": "2025-08-24T18:28:03.144Z", "modified_at": "2023-10-21T11:52:11.842Z", "id": "", "type": "ads", "description": "certainly these restfully geez who countess happily gym", "selectable": false, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/private/tmp", "mime_type": "", "size": 486328, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-09-26T17:28:00.673Z", "version": "", "is_uploaded": true, "created_at": "2025-05-06T18:54:29.001Z", "size_readable": "", "public_url": "https://forsaken-underpants.biz"}, {"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 796127, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-09-05T18:42:07.313Z", "version": "", "is_uploaded": false, "created_at": "2025-10-05T11:55:07.194Z", "size_readable": "", "public_url": "https://quick-witted-markup.org/"}]}, "product_price": {"created_at": "2025-05-15T01:08:07.500Z", "modified_at": "2023-09-17T05:09:12.902Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 252948, "maximum_amount": 130609, "preset_amount": 996863, "recurring_interval": "year"}, "discount": {"duration": "repeating", "type": "percentage", "basis_points": 416143, "id": "", "name": "", "code": ""}, "subscription_id": "", "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2025-12-23T03:24:50.631Z", "modified_at": "2023-03-21T13:22:46.065Z", "id": "", "metadata": {"key": false}, "slug": "", "name": "", "organization_id": "", "properties": {"options": [{"value": "", "label": ""}, {"value": "", "label": ""}]}}, "order": 169862, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2024-10-05T17:30:08.836Z", "modified_at": "2025-04-06T06:48:43.416Z", "id": "", "metadata": {"key": "", "key1": 129301, "key2": false}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 918364, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2023-03-11T18:00:05.573Z", "modified_at": "2024-12-27T19:40:18.237Z", "id": "", "metadata": {"key": 496211, "key1": false, "key2": ""}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 187532, "required": true}], "customer_metadata": {"key": "", "key1": 790078}}} responses: "200": application/json: "" @@ -1593,7 +1556,7 @@ examples: _endpointcheckout_updated_post: speakeasy-default-endpointcheckout-updated-post: requestBody: - application/json: {"data": {"created_at": "2024-10-04T13:06:10.658Z", "modified_at": "2023-10-03T21:25:15.366Z", "id": "", "status": "failed", "client_secret": "", "url": "https://square-cafe.biz/", "expires_at": "2024-03-25T08:55:11.873Z", "success_url": "https://physical-import.name/", "embed_origin": "", "amount": 245418, "tax_amount": 624213, "currency": "Naira", "subtotal_amount": 24587, "total_amount": 447013, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": true, "is_discount_applicable": true, "is_free_product_price": true, "is_payment_required": false, "is_payment_setup_required": false, "is_payment_form_required": true, "customer_id": "", "customer_name": "", "customer_email": "Jairo39@hotmail.com", "customer_ip_address": "", "customer_billing_address": {"country": "Greenland"}, "customer_tax_id": "", "metadata": {}, "product": {"created_at": "2024-01-25T14:28:29.444Z", "modified_at": "2024-09-21T12:18:51.327Z", "id": "", "name": "", "description": "engender reopen yahoo draft", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2024-10-20T04:48:05.954Z", "modified_at": "2023-03-13T21:45:21.173Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 108579, "maximum_amount": 316079, "preset_amount": 743040}], "benefits": [{"created_at": "2024-04-09T09:30:36.910Z", "modified_at": "2022-10-16T19:52:50.377Z", "id": "", "type": "github_repository", "description": "posh hm meatloaf politely ugh fidget to inborn putrid", "selectable": false, "deletable": true, "organization_id": ""}, {"created_at": "2023-12-31T03:17:46.406Z", "modified_at": "2022-11-12T16:32:46.306Z", "id": "", "type": "license_keys", "description": "blah likewise whose notwithstanding airline aboard frightened enfold colorfully", "selectable": true, "deletable": true, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/home/user", "mime_type": "", "size": 767806, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-01-15T18:22:33.094Z", "version": "", "is_uploaded": false, "created_at": "2023-02-14T06:20:54.950Z", "size_readable": "", "public_url": "https://pushy-tomatillo.org/"}, {"id": "", "organization_id": "", "name": "", "path": "/private", "mime_type": "", "size": 432333, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-03-08T18:51:14.729Z", "version": "", "is_uploaded": false, "created_at": "2022-11-18T09:33:10.032Z", "size_readable": "", "public_url": "https://affectionate-charm.net"}]}, "product_price": {"created_at": "2023-05-16T07:46:47.748Z", "modified_at": "2023-10-04T07:55:07.025Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 624213, "maximum_amount": 615580, "preset_amount": 24587, "recurring_interval": "month"}, "discount": {"duration": "once", "type": "percentage", "amount": 883154, "currency": "East Caribbean Dollar", "id": "", "name": "", "code": ""}, "subscription_id": "", "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2023-04-19T00:52:44.462Z", "modified_at": "2022-09-21T13:33:23.592Z", "id": "", "metadata": {"key": 226088, "key1": true, "key2": ""}, "slug": "", "name": "", "organization_id": ""}, "order": 108303, "required": false}], "customer_metadata": {"key": true, "key1": true}}} + application/json: {"data": {"created_at": "2025-10-04T13:06:10.658Z", "modified_at": "2024-10-02T21:25:15.366Z", "id": "", "payment_processor": "stripe", "status": "failed", "client_secret": "", "url": "https://square-cafe.biz/", "expires_at": "2025-03-25T08:55:11.873Z", "success_url": "https://physical-import.name/", "embed_origin": "", "amount": 245418, "tax_amount": 624213, "currency": "Naira", "subtotal_amount": 24587, "total_amount": 447013, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": true, "is_discount_applicable": true, "is_free_product_price": true, "is_payment_required": false, "is_payment_setup_required": false, "is_payment_form_required": true, "customer_id": "", "customer_name": "", "customer_email": "", "customer_ip_address": "", "customer_billing_address": {"country": "Zambia"}, "customer_tax_id": "", "payment_processor_metadata": {"key": ""}, "metadata": {}, "product": {"created_at": "2025-04-04T09:36:58.685Z", "modified_at": "2024-03-12T12:25:44.387Z", "id": "", "name": "", "description": "immediately times palatable controvert upon vicinity", "is_recurring": false, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2025-08-06T06:44:18.088Z", "modified_at": "2024-06-11T10:55:54.809Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 349193, "maximum_amount": 359121, "preset_amount": 753970, "recurring_interval": "year"}, {"created_at": "2024-05-21T06:24:27.561Z", "modified_at": "2023-11-30T16:46:57.649Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 673350}, {"created_at": "2024-08-15T06:49:59.493Z", "modified_at": "2025-08-01T06:02:33.305Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 833632, "maximum_amount": 264652, "preset_amount": 658327, "recurring_interval": "year"}], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/root", "mime_type": "", "size": 819163, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-07-07T07:29:52.938Z", "version": "", "is_uploaded": true, "created_at": "2024-10-03T20:56:21.950Z", "size_readable": "", "public_url": "https://scratchy-making.com/"}]}, "product_price": {"created_at": "2024-09-08T20:06:51.922Z", "modified_at": "2023-02-02T21:10:51.532Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "month"}, "discount": {"duration": "repeating", "duration_in_months": 583437, "type": "fixed", "amount": 176064, "currency": "Iranian Rial", "id": "", "name": "", "code": ""}, "subscription_id": "", "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2023-08-22T12:21:49.089Z", "modified_at": "2024-12-20T06:57:22.598Z", "id": "", "metadata": {"key": "", "key1": true, "key2": 476913}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 679898, "required": true}], "customer_metadata": {"key": false, "key1": 385454, "key2": false}}} responses: "200": application/json: "" @@ -1602,7 +1565,16 @@ examples: _endpointorder_created_post: speakeasy-default-endpointorder-created-post: requestBody: - application/json: {"data": {"created_at": "2023-11-12T12:46:15.007Z", "modified_at": "2023-03-24T03:54:38.261Z", "id": "", "metadata": {"key": "", "key1": ""}, "amount": 485666, "tax_amount": 81588, "currency": "Metical", "billing_reason": "subscription_cycle", "billing_address": {"country": "Hungary"}, "customer_id": "", "product_id": "", "product_price_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "customer": {"created_at": "2022-09-09T08:07:10.665Z", "modified_at": "2023-08-19T18:18:41.438Z", "id": "", "metadata": {"key": 407995, "key1": "", "key2": ""}, "email": "Gia.Boyer87@yahoo.com", "email_verified": false, "name": "", "billing_address": {"country": "Reunion"}, "tax_id": ["", "my_sst", "br_cpf"], "organization_id": "", "avatar_url": "https://darling-kit.org"}, "user_id": "", "user": {"id": "", "email": "Delphine_Weber@hotmail.com", "public_name": ""}, "product": {"created_at": "2024-12-27T14:05:37.748Z", "modified_at": "2024-01-02T22:00:53.940Z", "id": "", "name": "", "description": "circle colorize given", "is_recurring": true, "is_archived": true, "organization_id": ""}, "product_price": {"created_at": "2022-08-04T05:13:22.817Z", "modified_at": "2023-06-17T06:57:11.062Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 605593}, "discount": {"duration": "forever", "type": "fixed", "basis_points": 543579, "created_at": "2024-09-23T11:59:51.286Z", "modified_at": "2024-12-14T00:30:10.871Z", "id": "", "metadata": {"key": "", "key1": "", "key2": 386855}, "name": "", "code": "", "starts_at": "2022-01-27T10:40:59.012Z", "ends_at": "2022-04-15T20:14:00.592Z", "max_redemptions": 244557, "redemptions_count": 870081, "organization_id": ""}, "subscription": {"metadata": {"key": 838937, "key1": true}, "created_at": "2024-05-09T06:10:47.548Z", "modified_at": "2024-02-14T18:51:37.875Z", "id": "", "amount": 420337, "currency": "New Zealand Dollar", "recurring_interval": "year", "status": "incomplete", "current_period_start": "2024-12-01T13:27:57.927Z", "current_period_end": "2022-06-23T18:54:19.334Z", "cancel_at_period_end": false, "started_at": "2023-11-16T11:53:36.436Z", "ended_at": "2024-11-18T03:47:21.756Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "user_id": ""}}} + application/json: {"data": {"created_at": "2024-11-11T12:46:15.007Z", "modified_at": "2024-03-23T03:54:38.261Z", "id": "", "metadata": {"key": "", "key1": ""}, "status": "", "amount": 485666, "tax_amount": 81588, "refunded_amount": 605593, "refunded_tax_amount": 738083, "currency": "Jamaican Dollar", "billing_reason": "purchase", "billing_address": {"country": "Maldives"}, "customer_id": "", "product_id": "", "product_price_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "customer": {"created_at": "2025-09-23T11:59:51.286Z", "modified_at": "2025-12-14T00:30:10.871Z", "id": "", "metadata": {"key": "", "key1": "", "key2": 386855}, "email": "Austin65@gmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Hong Kong"}, "tax_id": ["no_vat", ""], "organization_id": "", "avatar_url": "https://darling-kit.org"}, "user_id": "", "user": {"id": "", "email": "Delphine_Weber@hotmail.com", "public_name": ""}, "product": {"created_at": "2025-12-27T14:05:37.748Z", "modified_at": "2025-01-01T22:00:53.940Z", "id": "", "name": "", "description": "circle colorize given", "is_recurring": true, "is_archived": true, "organization_id": ""}, "product_price": {"created_at": "2025-01-29T11:53:29.204Z", "modified_at": "2025-01-31T18:37:23.866Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 498640, "maximum_amount": 732997, "preset_amount": 959813}, "discount": {"duration": "repeating", "type": "fixed", "amount": 228282, "currency": "Baht", "created_at": "2023-04-06T06:29:00.267Z", "modified_at": "2023-03-01T18:48:46.167Z", "id": "", "metadata": {"key": "", "key1": "", "key2": ""}, "name": "", "code": "", "starts_at": "2023-12-14T21:08:51.727Z", "ends_at": "2023-08-24T00:05:31.570Z", "max_redemptions": 133794, "redemptions_count": 558400, "organization_id": ""}, "subscription": {"metadata": {"key": 838937, "key1": true}, "created_at": "2025-05-09T06:10:47.548Z", "modified_at": "2025-02-13T18:51:37.875Z", "id": "", "amount": 420337, "currency": "New Zealand Dollar", "recurring_interval": "year", "status": "incomplete", "current_period_start": "2025-12-01T13:27:57.927Z", "current_period_end": "2023-06-23T18:54:19.334Z", "cancel_at_period_end": false, "canceled_at": "2024-11-15T11:53:36.436Z", "started_at": "2025-11-18T03:47:21.756Z", "ends_at": "2023-02-02T12:07:22.717Z", "ended_at": "2023-02-15T16:05:22.828Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "switched_service", "customer_cancellation_comment": "", "user_id": ""}}} + responses: + "200": + application/json: "" + "422": + application/json: {} + _endpointorder_refunded_post: + speakeasy-default-endpointorder-refunded-post: + requestBody: + application/json: {"data": {"created_at": "2023-01-02T23:38:59.363Z", "modified_at": "2025-02-28T12:31:35.473Z", "id": "", "metadata": {"key": true, "key1": true, "key2": ""}, "status": "", "amount": 528865, "tax_amount": 824083, "refunded_amount": 158895, "refunded_tax_amount": 509231, "currency": "US Dollar", "billing_reason": "subscription_update", "billing_address": {"country": "Mozambique"}, "customer_id": "", "product_id": "", "product_price_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "customer": {"created_at": "2023-06-06T13:40:41.280Z", "modified_at": "2023-12-12T14:47:44.609Z", "id": "", "metadata": {"key": "", "key1": true}, "email": "Bryce.Schmitt@yahoo.com", "email_verified": true, "name": "", "billing_address": {"country": "Gabon"}, "tax_id": ["tw_vat"], "organization_id": "", "avatar_url": "https://authorized-planula.info/"}, "user_id": "", "user": {"id": "", "email": "Loyce_Shields@gmail.com", "public_name": ""}, "product": {"created_at": "2025-08-20T03:33:42.720Z", "modified_at": "2023-01-12T20:44:44.199Z", "id": "", "name": "", "description": "wholly till ill-fated ignite shyly timely duh", "is_recurring": false, "is_archived": true, "organization_id": ""}, "product_price": {"created_at": "2023-01-03T15:25:02.321Z", "modified_at": "2025-05-05T04:48:09.499Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 843925, "maximum_amount": 811684, "preset_amount": 374000, "recurring_interval": "year"}, "discount": {"duration": "once", "duration_in_months": 394868, "type": "percentage", "amount": 798101, "currency": "UAE Dirham", "created_at": "2023-07-31T17:16:21.805Z", "modified_at": "2024-12-19T01:36:36.664Z", "id": "", "metadata": {"key": 802290, "key1": 6677, "key2": 898371}, "name": "", "code": "", "starts_at": "2025-10-04T09:22:51.824Z", "ends_at": "2025-05-25T20:59:26.748Z", "max_redemptions": 625636, "redemptions_count": 302499, "organization_id": ""}, "subscription": {"metadata": {"key": "", "key1": 434679}, "created_at": "2023-03-11T03:15:27.257Z", "modified_at": "2024-08-05T00:21:50.603Z", "id": "", "amount": 690659, "currency": "Lari", "recurring_interval": "year", "status": "canceled", "current_period_start": "2025-08-31T07:32:06.622Z", "current_period_end": "2023-12-09T23:03:57.242Z", "cancel_at_period_end": false, "canceled_at": "2024-09-03T00:25:25.397Z", "started_at": "2023-07-04T15:25:35.943Z", "ends_at": "2024-09-24T05:43:42.179Z", "ended_at": "2024-11-02T16:14:59.150Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "missing_features", "customer_cancellation_comment": "", "user_id": ""}}} responses: "200": application/json: "" @@ -1611,7 +1583,7 @@ examples: _endpointsubscription_created_post: speakeasy-default-endpointsubscription-created-post: requestBody: - application/json: {"data": {"created_at": "2023-07-04T01:29:40.920Z", "modified_at": "2022-02-20T03:35:25.500Z", "id": "", "amount": 78980, "currency": "Dong", "recurring_interval": "month", "status": "incomplete_expired", "current_period_start": "2024-01-26T02:46:12.208Z", "current_period_end": "2022-10-08T16:07:22.449Z", "cancel_at_period_end": false, "started_at": "2024-10-17T20:21:29.819Z", "ended_at": "2022-02-26T17:52:17.099Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "metadata": {}, "customer": {"created_at": "2022-09-06T09:33:34.348Z", "modified_at": "2024-05-17T19:46:56.602Z", "id": "", "metadata": {"key": "", "key1": 229409}, "email": "Jermey.Ward@gmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Vietnam"}, "tax_id": ["", "sg_gst"], "organization_id": "", "avatar_url": "https://junior-numeracy.info/"}, "user_id": "", "user": {"id": "", "email": "Rosalia.Ritchie@yahoo.com", "public_name": ""}, "product": {"created_at": "2024-02-26T17:46:34.360Z", "modified_at": "2023-12-01T21:55:43.801Z", "id": "", "name": "", "description": "from below aw request", "is_recurring": false, "is_archived": true, "organization_id": "", "metadata": {}, "prices": [{"created_at": "2022-03-28T13:29:27.613Z", "modified_at": "2024-10-05T17:53:50.261Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 209938}, {"created_at": "2024-03-25T06:36:23.018Z", "modified_at": "2024-10-17T20:21:29.819Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 168635}], "benefits": [{"created_at": "2024-05-17T19:46:56.602Z", "modified_at": "2024-03-19T21:12:06.131Z", "id": "", "description": "huff wherever gosh bah", "selectable": true, "deletable": false, "organization_id": "", "properties": {"note": ""}, "is_tax_applicable": true}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/etc/defaults", "mime_type": "", "size": 212274, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-02-07T09:30:30.379Z", "version": "", "is_uploaded": true, "created_at": "2023-02-24T03:01:46.062Z", "size_readable": "", "public_url": "https://courageous-sailor.com/"}, {"id": "", "organization_id": "", "name": "", "path": "/bin", "mime_type": "", "size": 411556, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-11-06T04:00:51.558Z", "version": "", "is_uploaded": true, "created_at": "2024-08-27T08:53:33.064Z", "size_readable": "", "public_url": "https://snappy-airline.name"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2022-11-27T13:49:43.101Z", "modified_at": "2023-09-17T15:58:20.823Z", "id": "", "metadata": {"key": 350104, "key1": true, "key2": true}, "slug": "", "name": "", "organization_id": "", "properties": {"options": []}}, "order": 893449, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2022-04-25T16:52:58.082Z", "modified_at": "2024-09-13T20:49:31.920Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": ""}, "order": 954791, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2024-08-18T11:34:55.537Z", "modified_at": "2024-05-10T11:44:49.483Z", "id": "", "metadata": {"key": 44168, "key1": ""}, "slug": "", "name": "", "organization_id": ""}, "order": 748789, "required": true}]}, "price": {"created_at": "2024-08-06T20:21:56.108Z", "modified_at": "2022-07-07T19:12:22.984Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "year"}, "discount": {"duration": "forever", "type": "fixed", "basis_points": 116399, "created_at": "2024-09-29T12:11:21.682Z", "modified_at": "2022-07-03T04:55:47.377Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2022-03-13T02:22:01.631Z", "ends_at": "2024-09-16T04:55:19.972Z", "max_redemptions": 803154, "redemptions_count": 825426, "organization_id": ""}}} + application/json: {"data": {"created_at": "2024-07-03T01:29:40.920Z", "modified_at": "2023-02-20T03:35:25.500Z", "id": "", "amount": 78980, "currency": "Dong", "recurring_interval": "month", "status": "incomplete_expired", "current_period_start": "2025-01-25T02:46:12.208Z", "current_period_end": "2023-10-08T16:07:22.449Z", "cancel_at_period_end": false, "canceled_at": "2025-10-17T20:21:29.819Z", "started_at": "2023-02-26T17:52:17.099Z", "ends_at": "2023-07-04T19:46:53.033Z", "ended_at": "2023-09-06T09:33:34.348Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "unused", "customer_cancellation_comment": "", "metadata": {"key": "", "key1": 229409}, "customer": {"created_at": "2023-04-01T11:22:10.531Z", "modified_at": "2024-06-26T00:08:47.301Z", "id": "", "metadata": {"key": true}, "email": "Lia42@hotmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Bhutan"}, "tax_id": ["il_vat"], "organization_id": "", "avatar_url": "https://tense-convection.net/"}, "user_id": "", "user": {"id": "", "email": "Carson_Raynor@gmail.com", "public_name": ""}, "product": {"created_at": "2023-03-19T22:51:30.621Z", "modified_at": "2025-04-17T16:08:26.249Z", "id": "", "name": "", "description": "twine deed um on sudden", "is_recurring": true, "is_archived": false, "organization_id": "", "metadata": {}, "prices": [{"created_at": "2023-10-15T04:37:01.123Z", "modified_at": "2024-03-07T15:00:56.495Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 655892, "maximum_amount": 63766, "preset_amount": 626461, "recurring_interval": "month"}], "benefits": [{"created_at": "2024-01-16T19:00:35.270Z", "modified_at": "2023-06-25T23:28:37.736Z", "id": "", "description": "save carelessly sheepishly", "selectable": false, "deletable": false, "organization_id": "", "properties": {"archived": {"key": false, "key1": false}, "files": ["", "", ""]}}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/sys", "mime_type": "", "size": 580222, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-06-23T21:40:44.558Z", "version": "", "is_uploaded": true, "created_at": "2024-07-20T01:51:58.643Z", "size_readable": "", "public_url": "https://dapper-marimba.com/"}], "attached_custom_fields": []}, "price": {"created_at": "2024-03-05T01:33:52.385Z", "modified_at": "2024-02-24T03:01:46.062Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "month"}, "discount": {"duration": "once", "duration_in_months": 25742, "type": "fixed", "basis_points": 282087, "created_at": "2023-09-03T18:06:19.881Z", "modified_at": "2025-08-27T08:53:33.064Z", "id": "", "metadata": {"key": true, "key1": 866264}, "name": "", "code": "", "starts_at": "2025-02-24T22:18:59.471Z", "ends_at": "2024-11-25T15:12:50.077Z", "max_redemptions": 380280, "redemptions_count": 884322, "organization_id": ""}}} responses: "200": application/json: "" @@ -1620,7 +1592,7 @@ examples: _endpointsubscription_updated_post: speakeasy-default-endpointsubscription-updated-post: requestBody: - application/json: {"data": {"created_at": "2022-08-16T06:35:49.390Z", "modified_at": "2024-11-13T10:48:05.575Z", "id": "", "amount": 299644, "currency": "Baht", "recurring_interval": "year", "status": "trialing", "current_period_start": "2024-10-06T07:01:55.000Z", "current_period_end": "2024-01-21T06:59:31.349Z", "cancel_at_period_end": false, "started_at": "2022-10-04T04:56:04.382Z", "ended_at": "2022-01-22T12:57:07.430Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "metadata": {"key": "", "key1": 442859, "key2": 394013}, "customer": {"created_at": "2024-09-14T04:37:19.722Z", "modified_at": "2024-03-24T00:03:13.207Z", "id": "", "metadata": {"key": "", "key1": true, "key2": 392900}, "email": "Dominic.Toy27@yahoo.com", "email_verified": false, "name": "", "billing_address": {"country": "Sweden"}, "tax_id": ["mx_rfc", "gb_vat", ""], "organization_id": "", "avatar_url": "https://worthy-place.biz"}, "user_id": "", "user": {"id": "", "email": "Domenico_Franecki46@hotmail.com", "public_name": ""}, "product": {"created_at": "2023-06-12T14:55:33.574Z", "modified_at": "2022-06-02T07:14:13.619Z", "id": "", "name": "", "description": "intent that yowza", "is_recurring": true, "is_archived": false, "organization_id": "", "metadata": {"key": "", "key1": true}, "prices": [], "benefits": [{"created_at": "2024-11-13T10:48:05.575Z", "modified_at": "2022-11-25T09:50:52.301Z", "id": "", "description": "afford while lest at important ew yowza whereas demob", "selectable": false, "deletable": true, "organization_id": "", "properties": {"note": ""}, "is_tax_applicable": true}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/lost+found", "mime_type": "", "size": 562154, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-08-06T03:20:53.935Z", "version": "", "is_uploaded": false, "created_at": "2023-09-07T09:54:32.715Z", "size_readable": "", "public_url": "https://rare-trash.info"}, {"id": "", "organization_id": "", "name": "", "path": "/etc/ppp", "mime_type": "", "size": 66044, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-07-07T23:54:00.303Z", "version": "", "is_uploaded": true, "created_at": "2022-10-11T04:49:26.739Z", "size_readable": "", "public_url": "https://worse-ceramic.org"}, {"id": "", "organization_id": "", "name": "", "path": "/home", "mime_type": "", "size": 75695, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-09-16T06:56:23.715Z", "version": "", "is_uploaded": false, "created_at": "2023-06-23T20:54:57.375Z", "size_readable": "", "public_url": "https://closed-seafood.info"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2023-02-22T02:13:37.066Z", "modified_at": "2022-03-20T07:08:33.141Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": ""}, "order": 553735, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2022-03-14T13:16:39.126Z", "modified_at": "2024-02-16T13:33:22.624Z", "id": "", "metadata": {"key": "", "key1": true}, "slug": "", "name": "", "organization_id": ""}, "order": 892169, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2023-01-23T12:07:57.632Z", "modified_at": "2023-06-01T12:55:02.235Z", "id": "", "metadata": {"key": 173939}, "slug": "", "name": "", "organization_id": ""}, "order": 578881, "required": false}]}, "price": {"created_at": "2024-05-02T08:49:43.636Z", "modified_at": "2023-03-07T23:45:11.850Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "month"}, "discount": {"duration": "repeating", "duration_in_months": 579725, "type": "fixed", "basis_points": 427480, "created_at": "2023-05-08T14:53:14.873Z", "modified_at": "2023-08-15T00:52:40.141Z", "id": "", "metadata": {"key": 506784, "key1": 392045}, "name": "", "code": "", "starts_at": "2022-04-01T15:22:55.520Z", "ends_at": "2023-11-05T14:17:31.159Z", "max_redemptions": 848282, "redemptions_count": 542595, "organization_id": ""}}} + application/json: {"data": {"created_at": "2023-08-16T06:35:49.390Z", "modified_at": "2025-11-13T10:48:05.575Z", "id": "", "amount": 299644, "currency": "Baht", "recurring_interval": "year", "status": "trialing", "current_period_start": "2025-10-06T07:01:55.000Z", "current_period_end": "2025-01-20T06:59:31.349Z", "cancel_at_period_end": false, "canceled_at": "2023-10-04T04:56:04.382Z", "started_at": "2023-01-22T12:57:07.430Z", "ends_at": "2025-08-08T17:53:12.513Z", "ended_at": "2023-10-08T02:40:52.099Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "too_expensive", "customer_cancellation_comment": "", "metadata": {"key": 394013}, "customer": {"created_at": "2025-09-14T04:37:19.722Z", "modified_at": "2025-03-24T00:03:13.207Z", "id": "", "metadata": {"key": "", "key1": true, "key2": 392900}, "email": "Dominic.Toy27@yahoo.com", "email_verified": false, "name": "", "billing_address": {"country": "Sweden"}, "tax_id": ["mx_rfc", "gb_vat", ""], "organization_id": "", "avatar_url": "https://worthy-place.biz"}, "user_id": "", "user": {"id": "", "email": "Domenico_Franecki46@hotmail.com", "public_name": ""}, "product": {"created_at": "2024-06-11T14:55:33.574Z", "modified_at": "2023-06-02T07:14:13.619Z", "id": "", "name": "", "description": "intent that yowza", "is_recurring": true, "is_archived": false, "organization_id": "", "metadata": {"key": "", "key1": true}, "prices": [], "benefits": [{"created_at": "2024-03-27T11:34:21.664Z", "modified_at": "2024-04-26T03:42:46.919Z", "id": "", "description": "who joyous like when", "selectable": false, "deletable": false, "organization_id": "", "properties": {"guild_id": "", "role_id": "", "guild_token": ""}}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/lost+found", "mime_type": "", "size": 562154, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-08-06T03:20:53.935Z", "version": "", "is_uploaded": false, "created_at": "2024-09-06T09:54:32.715Z", "size_readable": "", "public_url": "https://rare-trash.info"}, {"id": "", "organization_id": "", "name": "", "path": "/etc/ppp", "mime_type": "", "size": 66044, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-07-07T23:54:00.303Z", "version": "", "is_uploaded": true, "created_at": "2023-10-11T04:49:26.739Z", "size_readable": "", "public_url": "https://worse-ceramic.org"}, {"id": "", "organization_id": "", "name": "", "path": "/home", "mime_type": "", "size": 75695, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-09-16T06:56:23.715Z", "version": "", "is_uploaded": false, "created_at": "2024-06-22T20:54:57.375Z", "size_readable": "", "public_url": "https://closed-seafood.info"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2023-11-13T10:00:40.060Z", "modified_at": "2024-03-09T00:03:49.294Z", "id": "", "metadata": {"key": "", "key1": 464282}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 553735, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2023-01-10T11:39:31.896Z", "modified_at": "2024-01-22T10:58:37.730Z", "id": "", "metadata": {"key": false}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 892169, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2024-07-27T01:03:51.776Z", "modified_at": "2024-01-12T16:48:08.024Z", "id": "", "metadata": {"key": 210374}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 578881, "required": false}]}, "price": {"created_at": "2024-05-10T19:30:40.237Z", "modified_at": "2024-02-20T21:50:40.246Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "month"}, "discount": {"duration": "forever", "duration_in_months": 466774, "type": "fixed", "basis_points": 373090, "created_at": "2025-03-19T15:55:32.315Z", "modified_at": "2024-03-26T06:41:23.276Z", "id": "", "metadata": {"key": "", "key1": "", "key2": 94826}, "name": "", "code": "", "starts_at": "2024-07-14T14:21:57.379Z", "ends_at": "2024-11-19T07:47:16.233Z", "max_redemptions": 184709, "redemptions_count": 388273, "organization_id": ""}}} responses: "200": application/json: "" @@ -1629,7 +1601,7 @@ examples: _endpointsubscription_active_post: speakeasy-default-endpointsubscription-active-post: requestBody: - application/json: {"data": {"created_at": "2022-09-17T11:03:44.679Z", "modified_at": "2024-07-24T20:02:17.426Z", "id": "", "amount": 116760, "currency": "Quetzal", "recurring_interval": "month", "status": "incomplete", "current_period_start": "2022-08-25T00:14:50.252Z", "current_period_end": "2022-12-10T18:25:01.577Z", "cancel_at_period_end": false, "started_at": "2023-07-06T14:07:23.099Z", "ended_at": "2023-07-01T08:12:48.355Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "metadata": {}, "customer": {"created_at": "2024-10-30T02:51:06.576Z", "modified_at": "2023-06-21T14:46:16.535Z", "id": "", "metadata": {"key": true, "key1": "", "key2": 615212}, "email": "Sincere42@gmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Tanzania"}, "tax_id": ["", "", "mx_rfc"], "organization_id": "", "avatar_url": "https://negative-tentacle.com"}, "user_id": "", "user": {"id": "", "email": "Zoey_Bahringer88@hotmail.com", "public_name": ""}, "product": {"created_at": "2024-03-05T21:40:58.905Z", "modified_at": "2022-06-03T13:50:25.005Z", "id": "", "name": "", "description": "synthesise beautifully until below barring concerning", "is_recurring": true, "is_archived": false, "organization_id": "", "metadata": {"key": "", "key1": 893296}, "prices": [{"created_at": "2022-12-23T21:06:29.057Z", "modified_at": "2023-06-19T07:32:20.859Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 215338}], "benefits": [{"created_at": "2023-09-05T07:05:35.451Z", "modified_at": "2023-07-06T14:07:23.099Z", "id": "", "description": "braid incidentally excitedly sympathetically pro tremendously", "selectable": true, "deletable": false, "organization_id": "", "properties": {"note": ""}, "is_tax_applicable": true}, {"created_at": "2023-03-25T21:51:07.916Z", "modified_at": "2022-05-30T19:54:17.610Z", "id": "", "description": "blah lock ugh eek", "selectable": true, "deletable": true, "organization_id": "", "properties": {"archived": {}, "files": ["", ""]}}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/media", "mime_type": "", "size": 931655, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-06-07T17:40:48.757Z", "version": "", "is_uploaded": false, "created_at": "2023-07-28T18:04:02.928Z", "size_readable": "", "public_url": "https://remorseful-hamburger.name"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2024-12-17T07:08:38.057Z", "modified_at": "2024-02-21T21:21:04.349Z", "id": "", "metadata": {"key": true}, "slug": "", "name": "", "organization_id": "", "properties": {"options": []}}, "order": 769742, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2022-03-06T00:38:11.071Z", "modified_at": "2022-02-13T01:11:01.495Z", "id": "", "metadata": {"key": false, "key1": true, "key2": ""}, "slug": "", "name": "", "organization_id": ""}, "order": 61975, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2022-09-29T16:24:13.569Z", "modified_at": "2024-02-18T13:39:50.808Z", "id": "", "metadata": {"key": 775460, "key1": ""}, "slug": "", "name": "", "organization_id": ""}, "order": 531803, "required": true}]}, "price": {"created_at": "2024-03-03T05:42:43.472Z", "modified_at": "2024-04-25T20:49:29.186Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 967195, "recurring_interval": "month"}, "discount": {"duration": "repeating", "type": "fixed", "amount": 781157, "currency": "Forint", "created_at": "2024-04-30T15:58:53.765Z", "modified_at": "2024-05-24T11:54:23.246Z", "id": "", "metadata": {"key": false, "key1": ""}, "name": "", "code": "", "starts_at": "2023-10-20T13:44:20.141Z", "ends_at": "2023-08-31T17:40:05.617Z", "max_redemptions": 630245, "redemptions_count": 508495, "organization_id": ""}}} + application/json: {"data": {"created_at": "2023-09-17T11:03:44.679Z", "modified_at": "2025-07-24T20:02:17.426Z", "id": "", "amount": 116760, "currency": "Quetzal", "recurring_interval": "month", "status": "incomplete", "current_period_start": "2023-08-25T00:14:50.252Z", "current_period_end": "2023-12-10T18:25:01.577Z", "cancel_at_period_end": false, "canceled_at": "2024-07-05T14:07:23.099Z", "started_at": "2024-06-30T08:12:48.355Z", "ends_at": "2023-06-29T07:42:54.895Z", "ended_at": "2025-10-30T02:51:06.576Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "switched_service", "customer_cancellation_comment": "", "metadata": {"key": true, "key1": "", "key2": 615212}, "customer": {"created_at": "2023-04-25T08:49:41.567Z", "modified_at": "2025-09-05T08:50:11.879Z", "id": "", "metadata": {}, "email": "Felicia87@hotmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Cuba"}, "tax_id": ["pe_ruc", "tr_tin"], "organization_id": "", "avatar_url": "https://steel-zebra.biz/"}, "user_id": "", "user": {"id": "", "email": "Raven_Feil@gmail.com", "public_name": ""}, "product": {"created_at": "2024-08-26T12:17:17.429Z", "modified_at": "2025-06-15T18:12:34.300Z", "id": "", "name": "", "description": "during boo place enchanting", "is_recurring": false, "is_archived": false, "organization_id": "", "metadata": {}, "prices": [{"created_at": "2023-06-12T20:00:04.431Z", "modified_at": "2023-01-19T03:47:15.797Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 150509, "maximum_amount": 368833, "preset_amount": 237429}], "benefits": [{"created_at": "2025-12-17T07:08:38.057Z", "modified_at": "2025-02-20T21:21:04.349Z", "id": "", "description": "successfully disgorge seriously furthermore unconscious", "selectable": true, "deletable": false, "organization_id": "", "properties": {"archived": {"key": false, "key1": false}, "files": [""]}}, {"created_at": "2024-07-06T18:40:04.116Z", "modified_at": "2023-05-12T20:57:57.609Z", "id": "", "description": "uncommon conclude focalise dark like", "selectable": true, "deletable": false, "organization_id": "", "properties": {"note": ""}, "is_tax_applicable": true}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/media", "mime_type": "", "size": 931655, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-06-07T17:40:48.757Z", "version": "", "is_uploaded": false, "created_at": "2024-07-27T18:04:02.928Z", "size_readable": "", "public_url": "https://remorseful-hamburger.name"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2025-01-20T12:23:37.845Z", "modified_at": "2025-03-05T16:09:49.058Z", "id": "", "metadata": {"key": false, "key1": true, "key2": 639045}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 769742, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2023-11-03T11:33:22.005Z", "modified_at": "2024-07-23T16:35:31.707Z", "id": "", "metadata": {"key": 521869}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 61975, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2024-10-24T23:47:56.996Z", "modified_at": "2024-10-24T01:03:37.094Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 531803, "required": true}]}, "price": {"created_at": "2024-02-02T00:30:57.495Z", "modified_at": "2024-08-15T16:58:49.210Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 325436, "maximum_amount": 272507, "preset_amount": 910219, "recurring_interval": "month"}, "discount": {"duration": "repeating", "type": "percentage", "basis_points": 722311, "created_at": "2025-09-04T07:15:12.730Z", "modified_at": "2025-10-06T11:12:50.335Z", "id": "", "metadata": {"key": ""}, "name": "", "code": "", "starts_at": "2025-11-16T18:30:55.860Z", "ends_at": "2025-02-08T03:34:15.957Z", "max_redemptions": 692583, "redemptions_count": 78638, "organization_id": ""}}} responses: "200": application/json: "" @@ -1638,7 +1610,16 @@ examples: _endpointsubscription_canceled_post: speakeasy-default-endpointsubscription-canceled-post: requestBody: - application/json: {"data": {"created_at": "2023-02-08T10:04:43.200Z", "modified_at": "2022-02-20T09:16:44.963Z", "id": "", "amount": 384017, "currency": "Nakfa", "recurring_interval": "month", "status": "canceled", "current_period_start": "2024-08-29T23:51:26.505Z", "current_period_end": "2023-01-30T14:57:29.126Z", "cancel_at_period_end": false, "started_at": "2022-05-31T10:57:35.559Z", "ended_at": "2023-11-01T08:13:37.012Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "metadata": {}, "customer": {"created_at": "2022-07-13T20:08:34.251Z", "modified_at": "2023-11-18T03:48:04.429Z", "id": "", "metadata": {"key": "", "key1": "", "key2": 199269}, "email": "Marcella_Gislason@gmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Kuwait"}, "tax_id": ["", "ca_qst", "ua_vat"], "organization_id": "", "avatar_url": "https://oily-juggernaut.com/"}, "user_id": "", "user": {"id": "", "email": "Sherwood.Murphy2@yahoo.com", "public_name": ""}, "product": {"created_at": "2022-04-28T07:50:03.180Z", "modified_at": "2022-02-20T03:50:20.279Z", "id": "", "name": "", "description": "tenant indeed when distorted before excluding claw stool aw self-reliant", "is_recurring": true, "is_archived": false, "organization_id": "", "metadata": {"key": 231419}, "prices": [], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/usr/include", "mime_type": "", "size": 778001, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-03-31T22:07:25.990Z", "version": "", "is_uploaded": false, "created_at": "2024-09-17T20:00:26.644Z", "size_readable": "", "public_url": "https://dim-tail.org"}, {"id": "", "organization_id": "", "name": "", "path": "/etc/namedb", "mime_type": "", "size": 797228, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-12-03T23:14:09.199Z", "version": "", "is_uploaded": true, "created_at": "2024-10-11T05:55:27.601Z", "size_readable": "", "public_url": "https://tragic-castanet.biz/"}, {"id": "", "organization_id": "", "name": "", "path": "/private/tmp", "mime_type": "", "size": 547184, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-08-24T04:18:58.722Z", "version": "", "is_uploaded": true, "created_at": "2023-07-31T11:34:39.128Z", "size_readable": "", "public_url": "https://cumbersome-forage.biz"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2022-02-20T09:16:44.963Z", "modified_at": "2023-02-25T21:11:48.890Z", "id": "", "metadata": {"key": 803599}, "slug": "", "name": "", "organization_id": ""}, "order": 790486, "required": true}]}, "price": {"created_at": "2023-01-30T14:57:29.126Z", "modified_at": "2023-11-08T11:19:25.895Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "year"}, "discount": {"duration": "once", "type": "percentage", "amount": 810079, "currency": "Fiji Dollar", "created_at": "2022-02-12T13:18:53.912Z", "modified_at": "2023-01-07T15:42:13.412Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2022-12-04T19:57:16.999Z", "ends_at": "2024-01-04T00:48:16.846Z", "max_redemptions": 402264, "redemptions_count": 262452, "organization_id": ""}}} + application/json: {"data": {"created_at": "2024-02-08T10:04:43.200Z", "modified_at": "2023-02-20T09:16:44.963Z", "id": "", "amount": 384017, "currency": "Nakfa", "recurring_interval": "month", "status": "canceled", "current_period_start": "2025-08-29T23:51:26.505Z", "current_period_end": "2024-01-30T14:57:29.126Z", "cancel_at_period_end": false, "canceled_at": "2023-05-31T10:57:35.559Z", "started_at": "2024-10-31T08:13:37.012Z", "ends_at": "2023-08-22T21:50:14.399Z", "ended_at": "2023-07-13T20:08:34.251Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "too_expensive", "customer_cancellation_comment": "", "metadata": {"key": "", "key1": "", "key2": 199269}, "customer": {"created_at": "2023-12-04T19:57:16.999Z", "modified_at": "2025-01-03T00:48:16.846Z", "id": "", "metadata": {"key": ""}, "email": "Ila.Waters90@hotmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Costa Rica"}, "tax_id": ["eu_oss_vat", "in_gst"], "organization_id": "", "avatar_url": "https://pretty-t-shirt.info/"}, "user_id": "", "user": {"id": "", "email": "Hubert4@yahoo.com", "public_name": ""}, "product": {"created_at": "2024-12-23T22:35:56.583Z", "modified_at": "2023-10-09T20:16:33.963Z", "id": "", "name": "", "description": "where yogurt atop", "is_recurring": false, "is_archived": false, "organization_id": "", "metadata": {"key": "", "key1": 62716, "key2": false}, "prices": [{"created_at": "2025-10-01T18:39:54.278Z", "modified_at": "2024-02-01T11:58:38.930Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 201970}, {"created_at": "2024-04-25T13:43:00.457Z", "modified_at": "2024-09-23T18:38:00.001Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 656757, "recurring_interval": "month"}, {"created_at": "2023-05-29T00:03:26.808Z", "modified_at": "2025-11-13T09:53:59.613Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "year"}], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/root", "mime_type": "", "size": 856792, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-05-15T05:51:11.123Z", "version": "", "is_uploaded": true, "created_at": "2023-10-19T06:08:48.337Z", "size_readable": "", "public_url": "https://delirious-stir-fry.name"}, {"id": "", "organization_id": "", "name": "", "path": "/mnt", "mime_type": "", "size": 683673, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-12-28T00:16:36.233Z", "version": "", "is_uploaded": true, "created_at": "2024-07-03T23:27:48.693Z", "size_readable": "", "public_url": "https://self-reliant-comestible.org"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2023-09-11T15:15:55.577Z", "modified_at": "2023-01-13T15:58:53.169Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 765648, "required": false}]}, "price": {"created_at": "2024-03-30T22:07:25.990Z", "modified_at": "2024-09-05T02:09:16.173Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "year"}, "discount": {"duration": "repeating", "type": "percentage", "amount": 140328, "currency": "South Sudanese pound", "created_at": "2023-12-03T23:14:09.199Z", "modified_at": "2024-06-07T18:12:37.600Z", "id": "", "metadata": {"key": "", "key1": true, "key2": ""}, "name": "", "code": "", "starts_at": "2024-05-29T10:02:42.701Z", "ends_at": "2024-08-22T17:07:21.257Z", "max_redemptions": 881551, "redemptions_count": 373541, "organization_id": ""}}} + responses: + "200": + application/json: "" + "422": + application/json: {} + _endpointsubscription_uncanceled_post: + speakeasy-default-endpointsubscription-uncanceled-post: + requestBody: + application/json: {"data": {"created_at": "2024-06-17T13:11:57.598Z", "modified_at": "2025-03-19T00:33:29.972Z", "id": "", "amount": 243909, "currency": "Swiss Franc", "recurring_interval": "month", "status": "past_due", "current_period_start": "2025-04-10T22:53:35.005Z", "current_period_end": "2025-11-06T14:37:36.152Z", "cancel_at_period_end": false, "canceled_at": "2025-11-20T17:26:51.612Z", "started_at": "2023-03-17T23:30:29.508Z", "ends_at": "2024-09-26T10:53:58.966Z", "ended_at": "2023-07-03T15:11:27.108Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "low_quality", "customer_cancellation_comment": "", "metadata": {"key": 21399, "key1": ""}, "customer": {"created_at": "2023-12-13T17:38:34.053Z", "modified_at": "2025-01-30T22:08:30.455Z", "id": "", "metadata": {}, "email": "Tess.Veum@yahoo.com", "email_verified": false, "name": "", "billing_address": {"country": "Bangladesh"}, "tax_id": ["us_ein", "jp_trn", "ca_gst_hst"], "organization_id": "", "avatar_url": "https://direct-ferret.org/"}, "user_id": "", "user": {"id": "", "email": "Everardo_Wilkinson@yahoo.com", "public_name": ""}, "product": {"created_at": "2023-03-30T10:41:05.586Z", "modified_at": "2025-10-18T00:21:05.189Z", "id": "", "name": "", "description": "fully pepper hm jovially outside coal bah fax midst", "is_recurring": false, "is_archived": false, "organization_id": "", "metadata": {"key": false}, "prices": [], "benefits": [{"created_at": "2023-12-06T15:33:30.209Z", "modified_at": "2023-06-26T13:37:41.082Z", "id": "", "description": "positively agitated fooey carelessly poorly", "selectable": true, "deletable": true, "organization_id": "", "properties": {"prefix": "", "expires": {"ttl": 752599, "timeframe": "year"}, "activations": {"limit": 356357, "enable_customer_admin": false}, "limit_usage": 305590}}, {"created_at": "2025-06-05T23:59:38.975Z", "modified_at": "2024-02-25T23:13:27.940Z", "id": "", "description": "overconfidently apprehensive tomb behind wholly aboard owlishly frantically patroller blah", "selectable": true, "deletable": false, "organization_id": "", "properties": {"archived": {"key": true, "key1": false, "key2": false}, "files": [""]}}, {"created_at": "2023-06-03T21:52:56.138Z", "modified_at": "2023-05-17T16:11:09.630Z", "id": "", "description": "moral twine where", "selectable": true, "deletable": true, "organization_id": "", "properties": {"guild_id": "", "role_id": "", "guild_token": ""}}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/rescue", "mime_type": "", "size": 406629, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-11-25T05:13:22.395Z", "version": "", "is_uploaded": false, "created_at": "2024-01-12T01:04:51.744Z", "size_readable": "", "public_url": "https://major-scenario.com/"}, {"id": "", "organization_id": "", "name": "", "path": "/System", "mime_type": "", "size": 743911, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-07-30T00:48:09.915Z", "version": "", "is_uploaded": false, "created_at": "2023-01-08T04:01:53.027Z", "size_readable": "", "public_url": "https://mild-earth.info/"}], "attached_custom_fields": []}, "price": {"created_at": "2023-07-14T09:34:36.796Z", "modified_at": "2024-09-01T22:45:32.934Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 620501, "recurring_interval": "year"}, "discount": {"duration": "repeating", "duration_in_months": 644410, "type": "fixed", "basis_points": 835720, "created_at": "2024-06-07T03:36:01.844Z", "modified_at": "2025-10-15T21:08:28.981Z", "id": "", "metadata": {"key": "", "key1": 299401}, "name": "", "code": "", "starts_at": "2023-09-27T16:59:20.550Z", "ends_at": "2024-08-10T09:10:07.342Z", "max_redemptions": 607542, "redemptions_count": 975704, "organization_id": ""}}} responses: "200": application/json: "" @@ -1647,7 +1628,25 @@ examples: _endpointsubscription_revoked_post: speakeasy-default-endpointsubscription-revoked-post: requestBody: - application/json: {"data": {"created_at": "2024-11-29T12:00:55.925Z", "modified_at": "2022-03-13T04:36:55.320Z", "id": "", "amount": 780683, "currency": "CFP Franc", "recurring_interval": "year", "status": "trialing", "current_period_start": "2022-06-20T05:55:42.170Z", "current_period_end": "2023-05-17T17:55:53.899Z", "cancel_at_period_end": true, "started_at": "2024-10-25T10:04:20.460Z", "ended_at": "2023-09-30T18:36:35.285Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "metadata": {"key": 721489}, "customer": {"created_at": "2022-06-02T05:06:11.692Z", "modified_at": "2024-09-02T15:09:07.489Z", "id": "", "metadata": {"key": 112038, "key1": 182663, "key2": 85731}, "email": "Tia59@yahoo.com", "email_verified": true, "name": "", "billing_address": {"country": "Azerbaijan"}, "tax_id": [], "organization_id": "", "avatar_url": "https://babyish-plastic.net"}, "user_id": "", "user": {"id": "", "email": "Reina59@yahoo.com", "public_name": ""}, "product": {"created_at": "2023-11-12T08:35:43.186Z", "modified_at": "2023-02-16T16:26:12.752Z", "id": "", "name": "", "description": "knavishly next unlike", "is_recurring": false, "is_archived": false, "organization_id": "", "metadata": {}, "prices": [{"created_at": "2024-05-05T15:05:02.863Z", "modified_at": "2024-11-17T16:25:39.728Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 320796}, {"created_at": "2023-06-25T17:28:30.971Z", "modified_at": "2024-10-25T10:04:20.460Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 382050, "maximum_amount": 354441, "preset_amount": 721489, "recurring_interval": "month"}, {"created_at": "2023-11-03T11:38:25.623Z", "modified_at": "2022-05-03T19:03:39.188Z", "id": "", "is_archived": false, "product_id": ""}], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/selinux", "mime_type": "", "size": 307478, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-08-09T04:03:47.757Z", "version": "", "is_uploaded": true, "created_at": "2024-03-19T06:48:17.921Z", "size_readable": "", "public_url": "https://bleak-worth.name"}, {"id": "", "organization_id": "", "name": "", "path": "/opt/sbin", "mime_type": "", "size": 846156, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-07-22T16:48:21.593Z", "version": "", "is_uploaded": false, "created_at": "2022-01-29T12:49:28.784Z", "size_readable": "", "public_url": "https://unusual-switch.name"}, {"id": "", "organization_id": "", "name": "", "path": "/var/mail", "mime_type": "", "size": 4230, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-09-24T13:03:31.087Z", "version": "", "is_uploaded": true, "created_at": "2022-07-22T04:02:13.353Z", "size_readable": "", "public_url": "https://warm-sideboard.name/"}], "attached_custom_fields": []}, "price": {"created_at": "2023-11-18T04:36:46.811Z", "modified_at": "2022-04-04T23:05:18.441Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 925065, "recurring_interval": "year"}, "discount": {"duration": "once", "type": "percentage", "basis_points": 718152, "created_at": "2022-08-13T23:12:18.932Z", "modified_at": "2022-03-09T13:37:07.084Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2024-10-09T23:38:38.066Z", "ends_at": "2022-03-02T20:08:06.884Z", "max_redemptions": 678696, "redemptions_count": 794564, "organization_id": ""}}} + application/json: {"data": {"created_at": "2025-11-29T12:00:55.925Z", "modified_at": "2023-03-13T04:36:55.320Z", "id": "", "amount": 780683, "currency": "CFP Franc", "recurring_interval": "year", "status": "trialing", "current_period_start": "2023-06-20T05:55:42.170Z", "current_period_end": "2024-05-16T17:55:53.899Z", "cancel_at_period_end": true, "canceled_at": "2025-10-25T10:04:20.460Z", "started_at": "2024-09-29T18:36:35.285Z", "ends_at": "2024-02-23T17:26:12.806Z", "ended_at": "2024-01-24T11:12:57.680Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "too_expensive", "customer_cancellation_comment": "", "metadata": {}, "customer": {"created_at": "2025-09-02T15:09:07.489Z", "modified_at": "2025-06-23T22:13:15.423Z", "id": "", "metadata": {"key": "", "key1": 182663}, "email": "Arvilla_Walsh62@yahoo.com", "email_verified": false, "name": "", "billing_address": {"country": "Portugal"}, "tax_id": [], "organization_id": "", "avatar_url": "https://exotic-traffic.com/"}, "user_id": "", "user": {"id": "", "email": "Percival.Schuster21@hotmail.com", "public_name": ""}, "product": {"created_at": "2024-10-17T20:35:01.045Z", "modified_at": "2025-05-01T17:14:35.906Z", "id": "", "name": "", "description": "scout second management whose underachieve weakly yippee", "is_recurring": true, "is_archived": false, "organization_id": "", "metadata": {}, "prices": [{"created_at": "2025-12-22T17:09:19.075Z", "modified_at": "2024-09-04T12:46:22.343Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 846156}, {"created_at": "2023-01-29T12:49:28.784Z", "modified_at": "2025-02-21T00:44:11.942Z", "id": "", "is_archived": false, "product_id": ""}], "benefits": [{"created_at": "2025-10-21T13:42:06.158Z", "modified_at": "2023-01-05T15:16:33.257Z", "id": "", "description": "delirious when submissive desk how tarragon ew made-up because toward", "selectable": true, "deletable": false, "organization_id": "", "properties": {"repository_owner": "polarsource", "repository_name": "private_repo", "permission": "pull"}}, {"created_at": "2025-12-02T06:57:31.584Z", "modified_at": "2025-04-06T17:31:04.776Z", "id": "", "description": "wire see very per", "selectable": false, "deletable": true, "organization_id": "", "properties": {"image_height": 400, "image_width": 400}}, {"created_at": "2025-06-29T00:07:52.093Z", "modified_at": "2023-03-26T22:10:02.657Z", "id": "", "description": "hm about oblong whether", "selectable": false, "deletable": false, "organization_id": "", "properties": {"guild_id": "", "role_id": "", "guild_token": ""}}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/usr/bin", "mime_type": "", "size": 406671, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-03-28T05:43:23.560Z", "version": "", "is_uploaded": false, "created_at": "2024-04-23T18:43:10.741Z", "size_readable": "", "public_url": "https://fragrant-appliance.name/"}, {"id": "", "organization_id": "", "name": "", "path": "/lost+found", "mime_type": "", "size": 76103, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-01-01T17:02:54.395Z", "version": "", "is_uploaded": false, "created_at": "2025-07-29T05:29:45.670Z", "size_readable": "", "public_url": "https://calculating-lieu.biz"}], "attached_custom_fields": []}, "price": {"created_at": "2024-10-04T15:58:28.010Z", "modified_at": "2023-10-23T10:13:26.881Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "month"}, "discount": {"duration": "repeating", "type": "percentage", "amount": 335600, "currency": "Canadian Dollar", "created_at": "2025-09-30T02:02:28.275Z", "modified_at": "2024-07-08T12:48:11.186Z", "id": "", "metadata": {"key": 223411}, "name": "", "code": "", "starts_at": "2023-12-25T03:14:41.345Z", "ends_at": "2025-02-16T03:38:52.727Z", "max_redemptions": 99218, "redemptions_count": 692485, "organization_id": ""}}} + responses: + "200": + application/json: "" + "422": + application/json: {} + _endpointrefund_created_post: + speakeasy-default-endpointrefund-created-post: + requestBody: + application/json: {"data": {"created_at": "2025-12-29T06:17:19.062Z", "modified_at": "2023-06-28T13:27:59.588Z", "id": "", "metadata": {"key": false, "key1": true}, "status": "canceled", "reason": "fraudulent", "amount": 872325, "tax_amount": 273821, "currency": "New Israeli Sheqel", "organization_id": "", "order_id": "", "subscription_id": "", "customer_id": "", "revoke_benefits": true}} + responses: + "200": + application/json: "" + "422": + application/json: {} + _endpointrefund_updated_post: + speakeasy-default-endpointrefund-updated-post: + requestBody: + application/json: {"data": {"created_at": "2024-01-23T03:57:31.216Z", "modified_at": "2024-04-24T01:16:45.429Z", "id": "", "metadata": {}, "status": "succeeded", "reason": "other", "amount": 397442, "tax_amount": 509120, "currency": "Rufiyaa", "organization_id": "", "order_id": "", "subscription_id": "", "customer_id": "", "revoke_benefits": false}} responses: "200": application/json: "" @@ -1656,7 +1655,7 @@ examples: _endpointproduct_created_post: speakeasy-default-endpointproduct-created-post: requestBody: - application/json: {"data": {"created_at": "2022-03-27T06:36:20.130Z", "modified_at": "2024-04-21T12:05:16.637Z", "id": "", "name": "", "description": "into horst metal grimy clinch big grounded industrialize", "is_recurring": true, "is_archived": true, "organization_id": "", "metadata": {}, "prices": [{"created_at": "2023-12-08T23:31:39.577Z", "modified_at": "2023-04-26T10:21:28.587Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "year"}, {"created_at": "2023-10-10T12:20:00.039Z", "modified_at": "2023-08-02T06:11:52.894Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 66164, "maximum_amount": 215783, "preset_amount": 203043}], "benefits": [{"created_at": "2022-12-13T12:26:05.455Z", "modified_at": "2023-04-18T08:36:36.851Z", "id": "", "description": "before requite than throughout", "selectable": true, "deletable": true, "organization_id": ""}, {"created_at": "2024-01-30T06:25:40.029Z", "modified_at": "2024-05-25T20:52:15.774Z", "id": "", "description": "industrialize necklace meh innocent and", "selectable": true, "deletable": false, "organization_id": "", "properties": {"repository_owner": "polarsource", "repository_name": "private_repo", "permission": "maintain"}}, {"created_at": "2022-12-21T02:33:35.683Z", "modified_at": "2022-05-31T01:25:34.413Z", "id": "", "description": "super even about till what optimal slimy", "selectable": true, "deletable": true, "organization_id": "", "properties": {"prefix": "", "expires": {"ttl": 118349, "timeframe": "day"}, "activations": {"limit": 158822, "enable_customer_admin": false}, "limit_usage": 553531}}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 692895, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-02-28T01:03:14.537Z", "version": "", "is_uploaded": true, "created_at": "2022-06-03T00:39:20.038Z", "size_readable": "", "public_url": "https://monstrous-cop-out.net"}, {"id": "", "organization_id": "", "name": "", "path": "/var/mail", "mime_type": "", "size": 843323, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-04-23T21:31:25.476Z", "version": "", "is_uploaded": true, "created_at": "2022-07-19T01:29:35.587Z", "size_readable": "", "public_url": "https://well-made-farm.com"}, {"id": "", "organization_id": "", "name": "", "path": "/root", "mime_type": "", "size": 849549, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-07-30T13:09:33.963Z", "version": "", "is_uploaded": false, "created_at": "2023-10-03T20:39:40.444Z", "size_readable": "", "public_url": "https://simplistic-devastation.com"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2024-07-07T02:17:46.592Z", "modified_at": "2023-01-06T06:37:37.257Z", "id": "", "metadata": {"key": 733716, "key1": 124295, "key2": ""}, "slug": "", "name": "", "organization_id": ""}, "order": 317196, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2023-01-22T17:57:22.350Z", "modified_at": "2023-07-20T04:28:49.429Z", "id": "", "metadata": {"key": 719843}, "slug": "", "name": "", "organization_id": ""}, "order": 492053, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2023-12-31T18:52:05.817Z", "modified_at": "2023-07-15T08:10:59.538Z", "id": "", "metadata": {"key": true}, "slug": "", "name": "", "organization_id": ""}, "order": 17631, "required": true}]}} + application/json: {"data": {"created_at": "2023-03-27T06:36:20.130Z", "modified_at": "2025-04-21T12:05:16.637Z", "id": "", "name": "", "description": "into horst metal grimy clinch big grounded industrialize", "is_recurring": true, "is_archived": true, "organization_id": "", "metadata": {}, "prices": [{"created_at": "2024-10-15T05:16:34.193Z", "modified_at": "2023-01-19T10:36:12.447Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 917766, "recurring_interval": "month"}, {"created_at": "2024-06-27T16:44:29.523Z", "modified_at": "2025-06-04T10:50:19.647Z", "id": "", "is_archived": true, "product_id": ""}], "benefits": [{"created_at": "2024-11-27T02:40:31.262Z", "modified_at": "2025-12-04T18:07:56.097Z", "id": "", "description": "and massage super even about till", "selectable": true, "deletable": false, "organization_id": "", "properties": {"guild_id": "", "role_id": "", "guild_token": ""}}, {"created_at": "2025-05-03T07:01:53.491Z", "modified_at": "2024-11-11T23:57:26.081Z", "id": "", "description": "whup other truly", "selectable": false, "deletable": true, "organization_id": "", "properties": {"archived": {"key": true, "key1": false, "key2": true}, "files": ["", ""]}}, {"created_at": "2023-05-17T05:27:36.888Z", "modified_at": "2023-03-28T23:52:23.232Z", "id": "", "description": "rapid toady tabletop terrorise", "selectable": false, "deletable": true, "organization_id": "", "properties": {"repository_owner": "polarsource", "repository_name": "private_repo", "permission": "admin"}}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 692895, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-02-28T01:03:14.537Z", "version": "", "is_uploaded": true, "created_at": "2023-06-03T00:39:20.038Z", "size_readable": "", "public_url": "https://monstrous-cop-out.net"}, {"id": "", "organization_id": "", "name": "", "path": "/var/mail", "mime_type": "", "size": 843323, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-04-23T21:31:25.476Z", "version": "", "is_uploaded": true, "created_at": "2023-07-19T01:29:35.587Z", "size_readable": "", "public_url": "https://well-made-farm.com"}, {"id": "", "organization_id": "", "name": "", "path": "/root", "mime_type": "", "size": 849549, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-07-30T13:09:33.963Z", "version": "", "is_uploaded": false, "created_at": "2024-10-02T20:39:40.444Z", "size_readable": "", "public_url": "https://simplistic-devastation.com"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2025-10-10T07:23:59.782Z", "modified_at": "2025-05-03T18:46:00.326Z", "id": "", "metadata": {"key": 821321, "key1": ""}, "slug": "", "name": "", "organization_id": "", "properties": {"options": [{"value": "", "label": ""}, {"value": "", "label": ""}, {"value": "", "label": ""}]}}, "order": 317196, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2025-12-23T06:51:37.558Z", "modified_at": "2025-03-15T08:42:59.966Z", "id": "", "metadata": {"key": 445920}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 492053, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2025-12-10T02:09:45.595Z", "modified_at": "2023-08-11T03:09:54.248Z", "id": "", "metadata": {"key": 139516, "key1": false, "key2": false}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 17631, "required": true}]}} responses: "200": application/json: "" @@ -1665,7 +1664,7 @@ examples: _endpointproduct_updated_post: speakeasy-default-endpointproduct-updated-post: requestBody: - application/json: {"data": {"created_at": "2023-06-26T03:46:32.479Z", "modified_at": "2022-06-04T01:47:33.158Z", "id": "", "name": "", "description": "er ick birdcage", "is_recurring": true, "is_archived": false, "organization_id": "", "metadata": {}, "prices": [{"created_at": "2022-04-14T23:22:06.974Z", "modified_at": "2022-11-27T16:49:54.775Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 147529, "recurring_interval": "month"}], "benefits": [{"created_at": "2023-03-01T01:53:23.154Z", "modified_at": "2024-10-01T01:25:21.739Z", "id": "", "description": "for kissingly countess", "selectable": false, "deletable": true, "organization_id": ""}, {"created_at": "2022-08-03T10:08:00.590Z", "modified_at": "2022-07-04T20:42:15.638Z", "id": "", "description": "along always modulo fidget inside lightly gigantic pigpen under", "selectable": true, "deletable": true, "organization_id": "", "properties": {"note": ""}, "is_tax_applicable": false}, {"created_at": "2023-12-22T18:08:53.429Z", "modified_at": "2023-04-06T15:47:57.618Z", "id": "", "description": "typify attest amid incidentally afore ultimately beloved seldom", "selectable": false, "deletable": false, "organization_id": "", "properties": {"archived": {"key": true}, "files": [""]}}], "medias": [], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2024-06-25T07:43:21.903Z", "modified_at": "2024-02-08T13:05:15.287Z", "id": "", "metadata": {"key": 81731, "key1": "", "key2": ""}, "slug": "", "name": "", "organization_id": ""}, "order": 19557, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2024-08-19T11:13:30.301Z", "modified_at": "2023-11-12T22:19:55.213Z", "id": "", "metadata": {"key": "", "key1": ""}, "slug": "", "name": "", "organization_id": ""}, "order": 753420, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2022-03-20T08:40:07.478Z", "modified_at": "2023-10-25T07:58:05.681Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": ""}, "order": 454407, "required": true}]}} + application/json: {"data": {"created_at": "2024-06-25T03:46:32.479Z", "modified_at": "2023-06-04T01:47:33.158Z", "id": "", "name": "", "description": "er ick birdcage", "is_recurring": true, "is_archived": false, "organization_id": "", "metadata": {}, "prices": [{"created_at": "2024-06-24T21:02:48.964Z", "modified_at": "2023-08-09T05:30:26.799Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 378732, "maximum_amount": 210625, "preset_amount": 195640, "recurring_interval": "month"}], "benefits": [{"created_at": "2025-01-14T17:21:06.263Z", "modified_at": "2024-08-11T16:50:22.415Z", "id": "", "description": "antelope mmm strictly meanwhile powerless drat lotion role till by", "selectable": true, "deletable": false, "organization_id": "", "properties": {"guild_id": "", "role_id": "", "guild_token": ""}}, {"created_at": "2024-09-25T18:43:30.596Z", "modified_at": "2023-12-07T11:19:18.583Z", "id": "", "description": "lazily yesterday who unlike surprisingly oh dowse", "selectable": true, "deletable": true, "organization_id": "", "properties": {"prefix": "", "expires": {"ttl": 277255, "timeframe": "day"}, "activations": {"limit": 701228, "enable_customer_admin": false}, "limit_usage": 495553}}, {"created_at": "2023-08-08T00:59:39.516Z", "modified_at": "2023-11-20T10:40:31.232Z", "id": "", "description": "as yuppify observe while creature", "selectable": true, "deletable": true, "organization_id": "", "properties": {"image_height": 400, "image_width": 400}}], "medias": [], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2024-01-10T14:49:34.261Z", "modified_at": "2024-06-26T12:22:33.699Z", "id": "", "metadata": {"key": 201711, "key1": false}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 19557, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2023-01-24T21:09:39.290Z", "modified_at": "2025-09-19T22:05:27.996Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 753420, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2023-11-05T16:20:13.541Z", "modified_at": "2024-09-05T06:02:28.654Z", "id": "", "metadata": {"key": true}, "slug": "", "name": "", "organization_id": "", "properties": {"options": []}}, "order": 454407, "required": true}]}} responses: "200": application/json: "" @@ -1674,7 +1673,7 @@ examples: _endpointpledge_created_post: speakeasy-default-endpointpledge-created-post: requestBody: - application/json: {"data": {"created_at": "2024-03-12T00:19:41.487Z", "modified_at": "2022-04-19T01:42:59.169Z", "id": "", "amount": 330877, "currency": "Jamaican Dollar", "state": "disputed", "type": "pay_directly", "issue": {"id": "66524b69-aa0b-47ac-bb9a-0cee5d3a9110", "number": 280857, "title": "", "state": "open", "issue_created_at": "2023-02-26T00:33:35.289Z", "needs_confirmation_solved": false, "repository": {"id": "356e14cb-87a4-484c-bcfa-ebfe50487706", "is_private": true, "name": "MyOrg", "description": "different premium tinderbox peter under often buzzing hastily", "stars": 1337, "license": "", "homepage": "", "organization": {"id": "29159f56-74c0-464d-b598-8d5bc3b9cdda", "name": "", "avatar_url": "https://frightened-poppy.com/", "is_personal": false, "bio": "", "pretty_name": "", "company": "Bailey - Towne", "blog": "", "location": "", "email": "Cortez_Stehr70@yahoo.com", "twitter_username": "", "organization_id": ""}, "internal_organization": {"created_at": "2024-01-04T15:27:13.109Z", "modified_at": "2023-02-15T22:10:17.041Z", "id": "", "name": "", "slug": "", "avatar_url": "https://hard-to-find-thyme.org", "bio": "", "company": "Schinner - Wiegand", "blog": "", "location": "", "email": "Pearline_Brekke@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 273260, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 976949}}, "pledge_badge_currently_embedded": true}}} + application/json: {"data": {"created_at": "2025-03-12T00:19:41.487Z", "modified_at": "2023-04-19T01:42:59.169Z", "id": "", "amount": 330877, "currency": "Jamaican Dollar", "state": "disputed", "type": "pay_directly", "issue": {"id": "66524b69-aa0b-47ac-bb9a-0cee5d3a9110", "platform": "github", "number": 280857, "title": "", "state": "open", "issue_created_at": "2024-02-26T00:33:35.289Z", "needs_confirmation_solved": false, "funding": {}, "repository": {"id": "356e14cb-87a4-484c-bcfa-ebfe50487706", "platform": "github", "is_private": true, "name": "MyOrg", "description": "different premium tinderbox peter under often buzzing hastily", "stars": 1337, "license": "", "homepage": "", "profile_settings": {}, "organization": {"id": "29159f56-74c0-464d-b598-8d5bc3b9cdda", "platform": "github", "name": "", "avatar_url": "https://frightened-poppy.com/", "is_personal": false, "bio": "", "pretty_name": "", "company": "Bailey - Towne", "blog": "", "location": "", "email": "Cortez_Stehr70@yahoo.com", "twitter_username": "", "organization_id": ""}, "internal_organization": {"created_at": "2025-01-03T15:27:13.109Z", "modified_at": "2024-02-15T22:10:17.041Z", "id": "", "name": "", "slug": "", "avatar_url": "https://hard-to-find-thyme.org", "bio": "", "company": "Schinner - Wiegand", "blog": "", "location": "", "email": "Pearline_Brekke@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 273260, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 976949, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": true, "proration_behavior": "invoice"}}}, "pledge_badge_currently_embedded": false}, "authed_can_admin_sender": false, "authed_can_admin_received": false}} responses: "200": application/json: "" @@ -1683,7 +1682,7 @@ examples: _endpointpledge_updated_post: speakeasy-default-endpointpledge-updated-post: requestBody: - application/json: {"data": {"created_at": "2023-11-30T00:10:39.674Z", "modified_at": "2024-10-02T21:42:49.754Z", "id": "", "amount": 634567, "currency": "Singapore Dollar", "state": "refunded", "type": "pay_on_completion", "issue": {"id": "d2e1349d-085a-441c-abf4-379a1f21d0da", "number": 218372, "title": "", "state": "closed", "issue_created_at": "2023-08-13T14:08:31.083Z", "needs_confirmation_solved": true, "repository": {"id": "814bd7c6-3412-4f11-b523-7b38c659f44a", "is_private": false, "name": "MyOrg", "description": "hm however microchip", "stars": 1337, "license": "", "homepage": "", "organization": {"id": "3ddd5cc2-de10-41ef-baa1-7551cf671cc3", "name": "", "avatar_url": "https://gummy-interviewer.biz", "is_personal": false, "bio": "", "pretty_name": "", "company": "Ferry - Tremblay", "blog": "", "location": "", "email": "Reggie_Crist@yahoo.com", "twitter_username": "", "organization_id": ""}, "internal_organization": {"created_at": "2024-12-13T11:00:39.217Z", "modified_at": "2024-12-02T09:51:26.214Z", "id": "", "name": "", "slug": "", "avatar_url": "https://memorable-numeracy.com/", "bio": "", "company": "Schuster - Crooks", "blog": "", "location": "", "email": "Tatum.Block37@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 653584, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 175899}}, "pledge_badge_currently_embedded": false}}} + application/json: {"data": {"created_at": "2024-11-29T00:10:39.674Z", "modified_at": "2025-10-02T21:42:49.754Z", "id": "", "amount": 634567, "currency": "Singapore Dollar", "state": "refunded", "type": "pay_on_completion", "issue": {"id": "d2e1349d-085a-441c-abf4-379a1f21d0da", "platform": "github", "number": 218372, "title": "", "state": "closed", "issue_created_at": "2024-08-12T14:08:31.083Z", "needs_confirmation_solved": true, "funding": {}, "repository": {"id": "814bd7c6-3412-4f11-b523-7b38c659f44a", "platform": "github", "is_private": false, "name": "MyOrg", "description": "hm however microchip", "stars": 1337, "license": "", "homepage": "", "profile_settings": {}, "organization": {"id": "3ddd5cc2-de10-41ef-baa1-7551cf671cc3", "platform": "github", "name": "", "avatar_url": "https://gummy-interviewer.biz", "is_personal": false, "bio": "", "pretty_name": "", "company": "Ferry - Tremblay", "blog": "", "location": "", "email": "Reggie_Crist@yahoo.com", "twitter_username": "", "organization_id": ""}, "internal_organization": {"created_at": "2025-12-13T11:00:39.217Z", "modified_at": "2025-12-02T09:51:26.214Z", "id": "", "name": "", "slug": "", "avatar_url": "https://memorable-numeracy.com/", "bio": "", "company": "Schuster - Crooks", "blog": "", "location": "", "email": "Tatum.Block37@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 653584, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 175899, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": true, "proration_behavior": "invoice"}}}, "pledge_badge_currently_embedded": true}, "authed_can_admin_sender": false, "authed_can_admin_received": false}} responses: "200": application/json: "" @@ -1692,7 +1691,7 @@ examples: _endpointorganization_updated_post: speakeasy-default-endpointorganization-updated-post: requestBody: - application/json: {"data": {"created_at": "2022-08-12T18:45:04.236Z", "modified_at": "2024-12-29T16:35:25.119Z", "id": "", "name": "", "slug": "", "avatar_url": "https://devoted-bump.net", "bio": "", "company": "Torp, Kuhlman and Howell", "blog": "", "location": "", "email": "Dock_Friesen57@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 105265, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 907160}} + application/json: {"data": {"created_at": "2023-08-12T18:45:04.236Z", "modified_at": "2025-12-29T16:35:25.119Z", "id": "", "name": "", "slug": "", "avatar_url": "https://devoted-bump.net", "bio": "", "company": "Torp, Kuhlman and Howell", "blog": "", "location": "", "email": "Dock_Friesen57@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 105265, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 907160, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": true, "proration_behavior": "prorate"}}} responses: "200": application/json: "" @@ -1701,7 +1700,7 @@ examples: _endpointbenefit_created_post: speakeasy-default-endpointbenefit-created-post: requestBody: - application/json: {"data": {"created_at": "2022-04-15T11:45:18.891Z", "modified_at": "2024-06-17T12:04:55.002Z", "id": "", "description": "vastly lest but", "selectable": true, "deletable": true, "organization_id": "", "properties": {"archived": {"key": true, "key1": true}, "files": [""]}}} + application/json: {"data": {"created_at": "2023-04-15T11:45:18.891Z", "modified_at": "2025-06-17T12:04:55.002Z", "id": "", "description": "vastly lest but", "selectable": true, "deletable": true, "organization_id": "", "properties": {"archived": {"key": true, "key1": true}, "files": [""]}}} responses: "200": application/json: "" @@ -1710,7 +1709,7 @@ examples: _endpointbenefit_updated_post: speakeasy-default-endpointbenefit-updated-post: requestBody: - application/json: {"data": {"created_at": "2024-11-19T14:31:03.333Z", "modified_at": "2022-08-21T02:54:25.671Z", "id": "", "description": "merge when gratefully sparse hmph throughout honesty untried gripping um", "selectable": false, "deletable": false, "organization_id": "", "properties": {"repository_owner": "polarsource", "repository_name": "private_repo", "permission": "pull"}}} + application/json: {"data": {"created_at": "2025-11-19T14:31:03.333Z", "modified_at": "2023-08-21T02:54:25.671Z", "id": "", "description": "merge when gratefully sparse hmph throughout honesty untried gripping um", "selectable": false, "deletable": false, "organization_id": "", "properties": {"repository_owner": "polarsource", "repository_name": "private_repo", "permission": "pull"}}} responses: "200": application/json: "" @@ -1719,7 +1718,7 @@ examples: _endpointbenefit_grant_created_post: speakeasy-default-endpointbenefit-grant-created-post: requestBody: - application/json: {"data": {"created_at": "2024-01-05T13:03:27.870Z", "modified_at": "2022-05-08T00:47:14.556Z", "id": "", "is_granted": true, "is_revoked": false, "subscription_id": "", "order_id": "", "customer_id": "", "user_id": "", "benefit_id": "", "properties": {"advertisement_campaign_id": ""}, "benefit": {"created_at": "2022-02-20T12:28:33.166Z", "modified_at": "2023-07-19T18:10:25.895Z", "id": "", "description": "though oof geez ha scuffle um inwardly narrow waterlogged normal", "selectable": true, "deletable": false, "organization_id": ""}}} + application/json: {"data": {"created_at": "2025-01-04T13:03:27.870Z", "modified_at": "2023-05-08T00:47:14.556Z", "id": "", "is_granted": true, "is_revoked": false, "subscription_id": "", "order_id": "", "customer_id": "", "user_id": "", "benefit_id": "", "customer": {"created_at": "2025-08-25T12:22:42.430Z", "modified_at": "2023-03-03T22:39:55.256Z", "id": "", "metadata": {}, "email": "Holden_Wilkinson@yahoo.com", "email_verified": false, "name": "", "billing_address": {"country": "El Salvador"}, "tax_id": ["", "ae_trn", "is_vat"], "organization_id": "", "avatar_url": "https://frightened-secrecy.biz"}, "properties": {}, "benefit": {"created_at": "2025-08-26T13:29:17.043Z", "modified_at": "2024-03-24T22:34:04.452Z", "id": "", "description": "flimsy nor vague er", "selectable": false, "deletable": false, "organization_id": "", "properties": {"guild_id": "", "role_id": "", "guild_token": ""}}}} responses: "200": application/json: "" @@ -1728,7 +1727,7 @@ examples: _endpointbenefit_grant_updated_post: speakeasy-default-endpointbenefit-grant-updated-post: requestBody: - application/json: {"data": {"created_at": "2024-01-03T13:54:42.243Z", "modified_at": "2023-02-25T11:58:59.486Z", "id": "", "is_granted": false, "is_revoked": false, "subscription_id": "", "order_id": "", "customer_id": "", "user_id": "", "benefit_id": "", "properties": {"advertisement_campaign_id": ""}, "benefit": {"created_at": "2024-04-04T12:08:04.168Z", "modified_at": "2024-02-23T02:27:57.903Z", "id": "", "description": "meager merit by pish intermesh gah out muddy ah", "selectable": false, "deletable": true, "organization_id": "", "properties": {"guild_id": "", "role_id": "", "guild_token": ""}}}} + application/json: {"data": {"created_at": "2025-01-02T13:54:42.243Z", "modified_at": "2024-02-25T11:58:59.486Z", "id": "", "is_granted": false, "is_revoked": false, "subscription_id": "", "order_id": "", "customer_id": "", "user_id": "", "benefit_id": "", "customer": {"created_at": "2025-08-08T07:44:28.757Z", "modified_at": "2024-08-31T04:19:19.970Z", "id": "", "metadata": {"key": "", "key1": 549371, "key2": 502350}, "email": "Yvette.Bins@hotmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Israel"}, "tax_id": [""], "organization_id": "", "avatar_url": "https://teeming-formamide.com/"}, "properties": {}, "benefit": {"created_at": "2024-11-11T08:53:11.059Z", "modified_at": "2023-03-21T15:42:18.506Z", "id": "", "description": "import lest to tragic discontinue fluff qualified contradict at", "selectable": false, "deletable": false, "organization_id": "", "properties": {"guild_id": "", "role_id": "", "guild_token": ""}}}} responses: "200": application/json: "" @@ -1737,7 +1736,7 @@ examples: _endpointbenefit_grant_revoked_post: speakeasy-default-endpointbenefit-grant-revoked-post: requestBody: - application/json: {"data": {"created_at": "2024-03-12T10:35:36.881Z", "modified_at": "2024-04-12T13:10:16.426Z", "id": "", "is_granted": true, "is_revoked": false, "subscription_id": "", "order_id": "", "customer_id": "", "user_id": "", "benefit_id": "", "properties": {"advertisement_campaign_id": ""}, "benefit": {"created_at": "2024-04-12T13:10:16.426Z", "modified_at": "2023-03-09T05:20:11.943Z", "id": "", "description": "incidentally immense scotch meh quaff generously supposing however ugh kindly", "selectable": false, "deletable": false, "organization_id": "", "properties": {"archived": {"key": true, "key1": true, "key2": false}, "files": []}}}} + application/json: {"data": {"created_at": "2025-03-12T10:35:36.881Z", "modified_at": "2025-04-12T13:10:16.426Z", "id": "", "is_granted": true, "is_revoked": false, "subscription_id": "", "order_id": "", "customer_id": "", "user_id": "", "benefit_id": "", "customer": {"created_at": "2025-03-29T21:56:48.008Z", "modified_at": "2025-07-18T16:16:40.562Z", "id": "", "metadata": {}, "email": "Anita21@hotmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Poland"}, "tax_id": ["", "", "au_arn"], "organization_id": "", "avatar_url": "https://bouncy-granny.net"}, "properties": {"advertisement_campaign_id": ""}, "benefit": {"created_at": "2025-10-09T03:13:16.502Z", "modified_at": "2023-03-17T05:59:04.603Z", "id": "", "description": "appropriate curiously amongst impact how courteous", "selectable": true, "deletable": true, "organization_id": "", "properties": {"archived": {"key": false, "key1": false, "key2": true}, "files": []}}}} responses: "200": application/json: "" @@ -1745,16 +1744,24 @@ examples: application/json: {} external_organizations:list: speakeasy-default-external-organizations:list: + parameters: + query: + page: 1 + limit: 10 responses: "200": - application/json: {"items": [{"id": "8a232aa0-b11b-48a0-8057-1e9e705d0e6e", "name": "", "avatar_url": "https://unpleasant-chairperson.info/", "is_personal": true, "bio": "", "pretty_name": "", "company": "Kshlerin Group", "blog": "", "location": "", "email": "Roman.Stracke39@yahoo.com", "twitter_username": "", "organization_id": ""}, {"id": "2e0aee1b-9ddf-4121-adc2-a4c8104fb451", "name": "", "avatar_url": "https://accurate-siege.org/", "is_personal": false, "bio": "", "pretty_name": "", "company": "White and Sons", "blog": "", "location": "", "email": "Jan.Reinger-Runte@gmail.com", "twitter_username": "", "organization_id": ""}, {"id": "b960d561-1ff6-4573-be0a-62331ad7c07c", "name": "", "avatar_url": "https://new-bug.name/", "is_personal": false, "bio": "", "pretty_name": "", "company": "Jacobs - Mills", "blog": "", "location": "", "email": "Trace_Strosin20@yahoo.com", "twitter_username": "", "organization_id": ""}], "pagination": {"total_count": 710528, "max_page": 489312}} + application/json: {"items": [{"id": "8a232aa0-b11b-48a0-8057-1e9e705d0e6e", "platform": "github", "name": "", "avatar_url": "https://unpleasant-chairperson.info/", "is_personal": true, "bio": "", "pretty_name": "", "company": "Kshlerin Group", "blog": "", "location": "", "email": "Roman.Stracke39@yahoo.com", "twitter_username": "", "organization_id": ""}, {"id": "2e0aee1b-9ddf-4121-adc2-a4c8104fb451", "platform": "github", "name": "", "avatar_url": "https://accurate-siege.org/", "is_personal": false, "bio": "", "pretty_name": "", "company": "White and Sons", "blog": "", "location": "", "email": "Jan.Reinger-Runte@gmail.com", "twitter_username": "", "organization_id": ""}, {"id": "b960d561-1ff6-4573-be0a-62331ad7c07c", "platform": "github", "name": "", "avatar_url": "https://new-bug.name/", "is_personal": false, "bio": "", "pretty_name": "", "company": "Jacobs - Mills", "blog": "", "location": "", "email": "Trace_Strosin20@yahoo.com", "twitter_username": "", "organization_id": ""}], "pagination": {"total_count": 710528, "max_page": 489312}} "422": application/json: {} repositories:list: speakeasy-default-repositories:list: + parameters: + query: + page: 1 + limit: 10 responses: "200": - application/json: {"items": [{"id": "8a232aa0-b11b-48a0-8057-1e9e705d0e6e", "is_private": true, "name": "MyOrg", "description": "lid covenant safely briefly ugh fen phew reschedule hammock ick", "stars": 1337, "license": "", "homepage": "", "organization": {"id": "f6573e0a-6233-41ad-b7c0-7cc481991696", "name": "", "avatar_url": "https://troubled-knickers.biz", "is_personal": true, "bio": "", "pretty_name": "", "company": "Kuhn, Smitham and Larson", "blog": "", "location": "", "email": "Carrie.Emard89@hotmail.com", "twitter_username": "", "organization_id": ""}, "internal_organization": {"created_at": "2023-07-28T09:20:59.531Z", "modified_at": "2022-12-12T02:49:50.316Z", "id": "", "name": "", "slug": "", "avatar_url": "https://frail-discourse.org", "bio": "", "company": "Schoen, Tremblay and Pfeffer", "blog": "", "location": "", "email": "Jayda.Stanton@gmail.com", "twitter_username": "", "pledge_minimum_amount": 190272, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 19410}}, {"id": "a17c478e-329a-49ec-8979-38e1a630f5fe", "is_private": true, "name": "MyOrg", "description": "consequently husband since wonderfully ruin likable widow", "stars": 1337, "license": "", "homepage": "", "organization": {"id": "7bcfa269-af21-494d-9586-1b3fe5754c0c", "name": "", "avatar_url": "https://big-pearl.name/", "is_personal": true, "bio": "", "pretty_name": "", "company": "King, Glover and Effertz", "blog": "", "location": "", "email": "Robin.Wisozk57@gmail.com", "twitter_username": "", "organization_id": ""}, "internal_organization": {"created_at": "2024-09-05T07:44:59.336Z", "modified_at": "2022-07-24T14:46:52.205Z", "id": "", "name": "", "slug": "", "avatar_url": "https://major-injunction.net/", "bio": "", "company": "Gulgowski, Schoen and Gibson", "blog": "", "location": "", "email": "Americo82@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 356375, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 788480}}, {"id": "7155b0db-a7a3-40fd-b263-f0ccec19e17a", "is_private": false, "name": "MyOrg", "description": "secret burgeon duh powerfully", "stars": 1337, "license": "", "homepage": "", "organization": {"id": "4b3d276b-63f8-406d-994b-843a1ce423bc", "name": "", "avatar_url": "https://troubled-sport.info/", "is_personal": false, "bio": "", "pretty_name": "", "company": "Greenholt, Daugherty and Wilkinson", "blog": "", "location": "", "email": "Vaughn23@hotmail.com", "twitter_username": "", "organization_id": ""}, "internal_organization": {"created_at": "2023-05-08T14:59:44.450Z", "modified_at": "2024-01-27T20:57:36.235Z", "id": "", "name": "", "slug": "", "avatar_url": "https://subtle-formula.name/", "bio": "", "company": "Trantow, Homenick and Bogisich", "blog": "", "location": "", "email": "Federico.West19@gmail.com", "twitter_username": "", "pledge_minimum_amount": 311256, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 50847}}], "pagination": {"total_count": 654965, "max_page": 204047}} + application/json: {"items": [{"id": "8a232aa0-b11b-48a0-8057-1e9e705d0e6e", "platform": "github", "is_private": true, "name": "MyOrg", "description": "lid covenant safely briefly ugh fen phew reschedule hammock ick", "stars": 1337, "license": "", "homepage": "", "profile_settings": {}, "organization": {"id": "f6573e0a-6233-41ad-b7c0-7cc481991696", "platform": "github", "name": "", "avatar_url": "https://troubled-knickers.biz", "is_personal": true, "bio": "", "pretty_name": "", "company": "Kuhn, Smitham and Larson", "blog": "", "location": "", "email": "Carrie.Emard89@hotmail.com", "twitter_username": "", "organization_id": ""}, "internal_organization": {"created_at": "2024-07-27T09:20:59.531Z", "modified_at": "2023-12-12T02:49:50.316Z", "id": "", "name": "", "slug": "", "avatar_url": "https://frail-discourse.org", "bio": "", "company": "Schoen, Tremblay and Pfeffer", "blog": "", "location": "", "email": "Jayda.Stanton@gmail.com", "twitter_username": "", "pledge_minimum_amount": 190272, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 19410, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": true, "proration_behavior": "invoice"}}}, {"id": "c478e329-a9ec-4979-838e-1a630f5fe368", "platform": "github", "is_private": false, "name": "MyOrg", "description": "obnoxiously after crooked enthusiastically", "stars": 1337, "license": "", "homepage": "", "profile_settings": {}, "organization": {"id": "9dec6f45-d97b-42c5-ad7f-7bcfa269af21", "platform": "github", "name": "", "avatar_url": "https://trustworthy-fort.name/", "is_personal": true, "bio": "", "pretty_name": "", "company": "Powlowski - Ebert", "blog": "", "location": "", "email": "Timmy27@hotmail.com", "twitter_username": "", "organization_id": ""}, "internal_organization": {"created_at": "2023-01-01T11:05:05.995Z", "modified_at": "2025-05-10T21:17:41.688Z", "id": "", "name": "", "slug": "", "avatar_url": "https://hoarse-baseboard.name/", "bio": "", "company": "Christiansen and Sons", "blog": "", "location": "", "email": "Dominique83@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 85212, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 189983, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": true, "proration_behavior": "invoice"}}}, {"id": "77ab4c4d-01ce-4db5-b5c7-155b0dba7a30", "platform": "github", "is_private": false, "name": "MyOrg", "description": "suffice roughly instead athwart", "stars": 1337, "license": "", "homepage": "", "profile_settings": {}, "organization": {"id": "b1104d1e-faeb-4ad1-9494-b3d276b63f80", "platform": "github", "name": "", "avatar_url": "https://pleasing-edge.net", "is_personal": false, "bio": "", "pretty_name": "", "company": "Douglas - O'Connell", "blog": "", "location": "", "email": "Percy20@gmail.com", "twitter_username": "", "organization_id": ""}, "internal_organization": {"created_at": "2025-04-12T21:58:56.461Z", "modified_at": "2024-05-31T11:35:53.906Z", "id": "", "name": "", "slug": "", "avatar_url": "https://troubled-sport.info/", "bio": "", "company": "Pollich, Greenholt and Daugherty", "blog": "", "location": "", "email": "Noemie23@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 449475, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 236968, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": true, "proration_behavior": "prorate"}}}], "pagination": {"total_count": 919939, "max_page": 893108}} "422": application/json: {} repositories:get: @@ -1764,7 +1771,7 @@ examples: id: "" responses: "200": - application/json: {"id": "b888f774-3e7c-4135-a18c-6b985523c4bc", "is_private": false, "name": "MyOrg", "description": "ugh roundabout middle ha rise", "stars": 1337, "license": "", "homepage": "", "organization": {"id": "8f7112aa-f0ab-44e4-83b4-cca3716f6208", "name": "", "avatar_url": "https://prickly-packaging.com/", "is_personal": false, "bio": "", "pretty_name": "", "company": "Schaefer and Sons", "blog": "", "location": "", "email": "Eunice_Lemke@gmail.com", "twitter_username": "", "organization_id": ""}, "internal_organization": {"created_at": "2023-08-09T16:26:13.017Z", "modified_at": "2024-09-14T13:34:42.081Z", "id": "", "name": "", "slug": "", "avatar_url": "https://elastic-lounge.com", "bio": "", "company": "Howell, Rau and Gerlach", "blog": "", "location": "", "email": "Kale_Hickle@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 856562, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 287673}} + application/json: {"id": "b888f774-3e7c-4135-a18c-6b985523c4bc", "platform": "github", "is_private": false, "name": "MyOrg", "description": "ugh roundabout middle ha rise", "stars": 1337, "license": "", "homepage": "", "profile_settings": {}, "organization": {"id": "8f7112aa-f0ab-44e4-83b4-cca3716f6208", "platform": "github", "name": "", "avatar_url": "https://prickly-packaging.com/", "is_personal": false, "bio": "", "pretty_name": "", "company": "Schaefer and Sons", "blog": "", "location": "", "email": "Eunice_Lemke@gmail.com", "twitter_username": "", "organization_id": ""}, "internal_organization": {"created_at": "2024-08-08T16:26:13.017Z", "modified_at": "2025-09-14T13:34:42.081Z", "id": "", "name": "", "slug": "", "avatar_url": "https://elastic-lounge.com", "bio": "", "company": "Howell, Rau and Gerlach", "blog": "", "location": "", "email": "Kale_Hickle@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 856562, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 287673, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": false, "proration_behavior": "invoice"}}} "404": application/json: {"detail": ""} "422": @@ -1774,9 +1781,11 @@ examples: parameters: path: id: "" + requestBody: + application/json: {} responses: "200": - application/json: {"id": "d95fa7f0-e743-42ce-b47c-b60cc78135dd", "is_private": false, "name": "MyOrg", "description": "daintily certainly yak surprised beyond blah intensely", "stars": 1337, "license": "", "homepage": "", "organization": {"id": "79d6f946-4a31-458c-8876-0f50e178a770", "name": "", "avatar_url": "https://self-reliant-chainstay.info", "is_personal": false, "bio": "", "pretty_name": "", "company": "Satterfield, Ruecker and Bogan", "blog": "", "location": "", "email": "Orin_Boyle15@hotmail.com", "twitter_username": "", "organization_id": ""}, "internal_organization": {"created_at": "2024-10-28T09:59:31.522Z", "modified_at": "2022-10-13T17:49:05.771Z", "id": "", "name": "", "slug": "", "avatar_url": "https://trustworthy-coliseum.net/", "bio": "", "company": "Rosenbaum - Rice", "blog": "", "location": "", "email": "Boyd38@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 620905, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 643119}} + application/json: {"id": "d95fa7f0-e743-42ce-b47c-b60cc78135dd", "platform": "github", "is_private": false, "name": "MyOrg", "description": "daintily certainly yak surprised beyond blah intensely", "stars": 1337, "license": "", "homepage": "", "profile_settings": {}, "organization": {"id": "79d6f946-4a31-458c-8876-0f50e178a770", "platform": "github", "name": "", "avatar_url": "https://self-reliant-chainstay.info", "is_personal": false, "bio": "", "pretty_name": "", "company": "Satterfield, Ruecker and Bogan", "blog": "", "location": "", "email": "Orin_Boyle15@hotmail.com", "twitter_username": "", "organization_id": ""}, "internal_organization": {"created_at": "2025-10-28T09:59:31.522Z", "modified_at": "2023-10-13T17:49:05.771Z", "id": "", "name": "", "slug": "", "avatar_url": "https://trustworthy-coliseum.net/", "bio": "", "company": "Rosenbaum - Rice", "blog": "", "location": "", "email": "Boyd38@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 620905, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 643119, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": false, "proration_behavior": "prorate"}}} "403": application/json: {"detail": ""} "404": @@ -1785,9 +1794,13 @@ examples: application/json: {} organizations:list: speakeasy-default-organizations:list: + parameters: + query: + page: 1 + limit: 10 responses: "200": - application/json: {"items": [{"created_at": "2023-08-23T19:26:20.850Z", "modified_at": "2024-01-14T10:26:00.433Z", "id": "", "name": "", "slug": "", "avatar_url": "https://energetic-circumference.name/", "bio": "", "company": "Auer LLC", "blog": "", "location": "", "email": "Annetta_Langosh0@gmail.com", "twitter_username": "", "pledge_minimum_amount": 367745, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 73227}, {"created_at": "2024-10-17T13:20:28.265Z", "modified_at": "2023-09-14T22:04:07.138Z", "id": "", "name": "", "slug": "", "avatar_url": "https://lustrous-atrium.biz", "bio": "", "company": "Auer, Treutel and Kassulke", "blog": "", "location": "", "email": "Chad.Treutel@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 432930, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 103421}, {"created_at": "2023-07-29T04:00:22.486Z", "modified_at": "2024-07-10T18:28:07.954Z", "id": "", "name": "", "slug": "", "avatar_url": "https://tragic-exhaust.info/", "bio": "", "company": "Davis - Volkman", "blog": "", "location": "", "email": "Llewellyn.VonRueden@gmail.com", "twitter_username": "", "pledge_minimum_amount": 838930, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 996014}], "pagination": {"total_count": 81309, "max_page": 164965}} + application/json: {"items": [{"created_at": "2024-08-22T19:26:20.850Z", "modified_at": "2025-01-13T10:26:00.433Z", "id": "", "name": "", "slug": "", "avatar_url": "https://energetic-circumference.name/", "bio": "", "company": "Auer LLC", "blog": "", "location": "", "email": "Annetta_Langosh0@gmail.com", "twitter_username": "", "pledge_minimum_amount": 367745, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 73227, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": false, "proration_behavior": "prorate"}}, {"created_at": "2024-06-21T03:00:04.393Z", "modified_at": "2023-02-26T15:25:42.165Z", "id": "", "name": "", "slug": "", "avatar_url": "https://torn-affiliate.org/", "bio": "", "company": "Volkman Group", "blog": "", "location": "", "email": "Spencer.Koelpin@gmail.com", "twitter_username": "", "pledge_minimum_amount": 103421, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 841031, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": false, "proration_behavior": "invoice"}}, {"created_at": "2024-03-05T16:40:09.484Z", "modified_at": "2023-05-05T09:08:16.530Z", "id": "", "name": "", "slug": "", "avatar_url": "https://unwilling-almighty.name/", "bio": "", "company": "VonRueden, Boehm and Pouros", "blog": "", "location": "", "email": "Rogelio.Zieme16@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 836788, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 141764, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": true, "proration_behavior": "prorate"}}], "pagination": {"total_count": 544651, "max_page": 66993}} "422": application/json: {} organizations:create: @@ -1796,7 +1809,7 @@ examples: application/json: {"name": "", "slug": ""} responses: "201": - application/json: {"created_at": "2023-06-18T07:14:55.338Z", "modified_at": "2023-12-01T17:06:07.804Z", "id": "", "name": "", "slug": "", "avatar_url": "https://concerned-battle.net/", "bio": "", "company": "Abbott, Dach and Borer", "blog": "", "location": "", "email": "Raymundo_Rolfson35@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 17759, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 211337} + application/json: {"created_at": "2024-06-17T07:14:55.338Z", "modified_at": "2024-11-30T17:06:07.804Z", "id": "", "name": "", "slug": "", "avatar_url": "https://concerned-battle.net/", "bio": "", "company": "Abbott, Dach and Borer", "blog": "", "location": "", "email": "Raymundo_Rolfson35@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 17759, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 211337, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": true, "proration_behavior": "invoice"}} "422": application/json: {} organizations:get: @@ -1806,7 +1819,7 @@ examples: id: "" responses: "200": - application/json: {"created_at": "2024-02-07T13:54:48.821Z", "modified_at": "2023-09-05T11:33:52.011Z", "id": "", "name": "", "slug": "", "avatar_url": "https://misguided-violin.info", "bio": "", "company": "Gislason Group", "blog": "", "location": "", "email": "Ian.Block31@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 552582, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 380699} + application/json: {"created_at": "2025-02-06T13:54:48.821Z", "modified_at": "2024-09-04T11:33:52.011Z", "id": "", "name": "", "slug": "", "avatar_url": "https://misguided-violin.info", "bio": "", "company": "Gislason Group", "blog": "", "location": "", "email": "Ian.Block31@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 552582, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 380699, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": false, "proration_behavior": "prorate"}} "404": application/json: {"detail": ""} "422": @@ -1816,9 +1829,11 @@ examples: parameters: path: id: "" + requestBody: + application/json: {"pledge_badge_show_amount": false, "pledge_minimum_amount": 2000} responses: "200": - application/json: {"created_at": "2024-07-28T19:04:48.565Z", "modified_at": "2023-10-17T10:52:42.015Z", "id": "", "name": "", "slug": "", "avatar_url": "https://yearly-order.info/", "bio": "", "company": "Becker, Treutel and King", "blog": "", "location": "", "email": "Delphia_Schamberger@gmail.com", "twitter_username": "", "pledge_minimum_amount": 771203, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 404265} + application/json: {"created_at": "2025-07-28T19:04:48.565Z", "modified_at": "2024-10-16T10:52:42.015Z", "id": "", "name": "", "slug": "", "avatar_url": "https://yearly-order.info/", "bio": "", "company": "Becker, Treutel and King", "blog": "", "location": "", "email": "Delphia_Schamberger@gmail.com", "twitter_username": "", "pledge_minimum_amount": 771203, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 404265, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": false, "proration_behavior": "prorate"}} "403": application/json: {"detail": ""} "404": @@ -1827,9 +1842,13 @@ examples: application/json: {} subscriptions:list: speakeasy-default-subscriptions:list: + parameters: + query: + page: 1 + limit: 10 responses: "200": - application/json: {"items": [{"created_at": "2023-08-23T19:26:20.850Z", "modified_at": "2024-01-14T10:26:00.433Z", "id": "", "amount": 177706, "currency": "Danish Krone", "recurring_interval": "month", "status": "past_due", "current_period_start": "2023-12-02T18:25:37.169Z", "current_period_end": "2022-01-20T06:21:22.156Z", "cancel_at_period_end": false, "started_at": "2022-04-05T09:49:38.010Z", "ended_at": "2022-03-17T01:57:00.187Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "metadata": {"key": 633911, "key1": ""}, "customer": {"created_at": "2022-03-01T20:22:54.911Z", "modified_at": "2023-02-08T01:09:52.088Z", "id": "", "metadata": {"key": ""}, "email": "Kenyatta32@hotmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Tokelau"}, "tax_id": ["ca_pst_bc"], "organization_id": "", "avatar_url": "https://unpleasant-chairperson.info/"}, "user_id": "", "user": {"id": "", "email": "Hope_Brakus@yahoo.com", "public_name": ""}, "product": {"created_at": "2024-08-04T08:35:41.482Z", "modified_at": "2022-12-03T21:35:05.453Z", "id": "", "name": "", "description": "er boom however when uh-huh madly", "is_recurring": false, "is_archived": false, "organization_id": "", "metadata": {"key": 29267, "key1": 688784, "key2": 408066}, "prices": [], "benefits": [{"created_at": "2023-08-23T19:26:20.850Z", "modified_at": "2024-01-14T10:26:00.433Z", "id": "", "description": "bob inwardly beautifully comparison", "selectable": true, "deletable": false, "organization_id": "", "properties": {"archived": {}, "files": [""]}}, {"created_at": "2023-04-20T11:47:41.889Z", "modified_at": "2023-06-11T18:07:18.321Z", "id": "", "description": "cleverly blossom defiantly", "selectable": true, "deletable": false, "organization_id": "", "properties": {"guild_id": "", "role_id": "", "guild_token": ""}}, {"created_at": "2022-06-05T08:58:03.644Z", "modified_at": "2023-12-29T19:56:44.465Z", "id": "", "description": "when uh-huh madly unless brightly", "selectable": true, "deletable": false, "organization_id": "", "properties": {"archived": {"key": true, "key1": true, "key2": true}, "files": []}}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/sbin", "mime_type": "", "size": 207713, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-01-01T09:29:03.176Z", "version": "", "is_uploaded": true, "created_at": "2023-03-31T01:03:36.657Z", "size_readable": "", "public_url": "https://next-taxicab.net/"}], "attached_custom_fields": []}, "price": {"created_at": "2022-02-25T05:24:29.459Z", "modified_at": "2023-11-17T05:41:51.253Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "month"}, "discount": {"duration": "once", "type": "fixed", "amount": 673953, "currency": "Tunisian Dinar", "created_at": "2023-05-22T17:28:14.899Z", "modified_at": "2024-04-07T21:37:23.489Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2023-06-19T05:46:32.685Z", "ends_at": "2024-04-03T18:06:02.533Z", "max_redemptions": 751563, "redemptions_count": 277523, "organization_id": ""}}, {"created_at": "2024-07-30T17:58:06.895Z", "modified_at": "2023-06-28T18:50:42.778Z", "id": "", "amount": 985599, "currency": "Lebanese Pound", "recurring_interval": "year", "status": "canceled", "current_period_start": "2024-10-25T10:50:37.438Z", "current_period_end": "2024-01-10T05:13:52.456Z", "cancel_at_period_end": true, "started_at": "2023-04-23T16:13:21.235Z", "ended_at": "2023-09-11T11:54:14.319Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "metadata": {"key": true, "key1": ""}, "customer": {"created_at": "2023-10-30T05:49:01.311Z", "modified_at": "2022-12-07T09:46:44.632Z", "id": "", "metadata": {"key": 527084, "key1": 80289, "key2": true}, "email": "Timmy27@hotmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Saudi Arabia"}, "tax_id": [""], "organization_id": "", "avatar_url": "https://puzzled-morning.com/"}, "user_id": "", "user": {"id": "", "email": "Isabelle83@hotmail.com", "public_name": ""}, "product": {"created_at": "2024-11-27T17:23:02.117Z", "modified_at": "2022-04-04T09:25:47.730Z", "id": "", "name": "", "description": "till boo ack solicit weakly segregate boo", "is_recurring": true, "is_archived": false, "organization_id": "", "metadata": {"key": true, "key1": true, "key2": 387926}, "prices": [{"created_at": "2023-10-15T09:46:50.350Z", "modified_at": "2023-09-15T02:22:04.749Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 401228}, {"created_at": "2024-10-20T12:04:56.060Z", "modified_at": "2024-04-01T19:36:12.946Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 500063, "maximum_amount": 206163, "preset_amount": 310383}], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/var/mail", "mime_type": "", "size": 677862, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-10-02T21:48:51.327Z", "version": "", "is_uploaded": false, "created_at": "2024-01-18T21:03:55.557Z", "size_readable": "", "public_url": "https://clear-cut-dredger.name"}, {"id": "", "organization_id": "", "name": "", "path": "/lost+found", "mime_type": "", "size": 708212, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-08-25T01:38:35.053Z", "version": "", "is_uploaded": false, "created_at": "2022-06-11T03:56:34.876Z", "size_readable": "", "public_url": "https://humble-programme.info/"}, {"id": "", "organization_id": "", "name": "", "path": "/lib", "mime_type": "", "size": 981370, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-08-28T12:00:34.207Z", "version": "", "is_uploaded": true, "created_at": "2023-03-08T00:48:20.677Z", "size_readable": "", "public_url": "https://pleasing-edge.net"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2023-06-21T06:51:31.298Z", "modified_at": "2024-07-07T11:43:51.448Z", "id": "", "metadata": {"key": true, "key1": ""}, "slug": "", "name": "", "organization_id": "", "properties": {"options": []}}, "order": 794717, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2024-09-08T10:15:51.443Z", "modified_at": "2022-01-27T21:43:08.849Z", "id": "", "metadata": {"key": "", "key1": 292228}, "slug": "", "name": "", "organization_id": ""}, "order": 839453, "required": true}]}, "price": {"created_at": "2024-10-07T04:54:41.981Z", "modified_at": "2024-03-07T17:43:00.381Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 895424, "recurring_interval": "year"}, "discount": {"duration": "forever", "type": "percentage", "amount": 849513, "currency": "Falkland Islands Pound", "created_at": "2023-06-21T13:26:28.598Z", "modified_at": "2023-01-19T17:39:17.317Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2024-06-29T11:50:30.649Z", "ends_at": "2022-01-22T06:34:12.791Z", "max_redemptions": 634941, "redemptions_count": 93125, "organization_id": ""}}, {"created_at": "2024-09-05T20:18:34.543Z", "modified_at": "2023-02-23T23:44:40.827Z", "id": "", "amount": 86895, "currency": "Cedi", "recurring_interval": "month", "status": "active", "current_period_start": "2024-11-01T20:47:26.029Z", "current_period_end": "2023-07-01T05:56:59.196Z", "cancel_at_period_end": true, "started_at": "2022-02-21T11:53:00.306Z", "ended_at": "2022-12-08T03:17:39.708Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "metadata": {"key": "", "key1": 204047}, "customer": {"created_at": "2023-05-04T11:56:14.302Z", "modified_at": "2022-05-09T08:47:32.901Z", "id": "", "metadata": {"key": true}, "email": "Vallie.Goyette@gmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Rwanda"}, "tax_id": ["ge_vat"], "organization_id": "", "avatar_url": "https://nimble-individual.biz/"}, "user_id": "", "user": {"id": "", "email": "Florida_Mills10@hotmail.com", "public_name": ""}, "product": {"created_at": "2024-10-07T12:14:45.651Z", "modified_at": "2024-08-07T16:09:30.509Z", "id": "", "name": "", "description": "via the proper uncommon cap", "is_recurring": true, "is_archived": true, "organization_id": "", "metadata": {"key": 751280, "key1": ""}, "prices": [{"created_at": "2022-11-05T03:32:00.916Z", "modified_at": "2023-05-03T02:57:15.201Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "year"}, {"created_at": "2023-09-20T19:57:30.820Z", "modified_at": "2023-11-26T13:23:23.987Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 919645, "recurring_interval": "year"}, {"created_at": "2023-09-29T09:08:13.966Z", "modified_at": "2022-08-22T04:11:15.149Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 895039, "maximum_amount": 65720, "preset_amount": 648645}], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/opt/share", "mime_type": "", "size": 505796, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-03-05T15:08:11.722Z", "version": "", "is_uploaded": true, "created_at": "2024-06-20T20:39:56.038Z", "size_readable": "", "public_url": "https://elliptical-marketplace.biz"}, {"id": "", "organization_id": "", "name": "", "path": "/usr/share", "mime_type": "", "size": 96647, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-01-09T21:57:02.179Z", "version": "", "is_uploaded": true, "created_at": "2024-02-07T05:52:39.668Z", "size_readable": "", "public_url": "https://weighty-tentacle.name/"}, {"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 191255, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-02-13T19:40:48.863Z", "version": "", "is_uploaded": false, "created_at": "2023-06-09T07:01:01.703Z", "size_readable": "", "public_url": "https://homely-testing.org"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2022-09-28T14:04:50.967Z", "modified_at": "2022-01-03T14:26:00.039Z", "id": "", "metadata": {"key": 939917, "key1": true, "key2": 527743}, "slug": "", "name": "", "organization_id": ""}, "order": 27174, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2023-08-13T02:33:31.911Z", "modified_at": "2022-07-09T17:20:28.194Z", "id": "", "metadata": {"key": 19407, "key1": "", "key2": true}, "slug": "", "name": "", "organization_id": ""}, "order": 134580, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2023-04-28T03:04:42.633Z", "modified_at": "2022-11-15T16:58:31.247Z", "id": "", "metadata": {"key": 561143, "key1": "", "key2": ""}, "slug": "", "name": "", "organization_id": ""}, "order": 223832, "required": true}]}, "price": {"created_at": "2023-03-31T01:03:36.657Z", "modified_at": "2022-10-05T20:49:32.362Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 894700, "maximum_amount": 810689, "preset_amount": 152303, "recurring_interval": "year"}, "discount": {"duration": "once", "type": "percentage", "basis_points": 906109, "created_at": "2023-12-15T10:29:31.180Z", "modified_at": "2022-10-09T07:21:47.148Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2022-04-15T11:16:29.756Z", "ends_at": "2023-03-31T11:43:42.338Z", "max_redemptions": 644930, "redemptions_count": 379069, "organization_id": ""}}], "pagination": {"total_count": 709485, "max_page": 543675}} + application/json: {"items": [{"created_at": "2024-08-22T19:26:20.850Z", "modified_at": "2025-01-13T10:26:00.433Z", "id": "", "amount": 177706, "currency": "Danish Krone", "recurring_interval": "month", "status": "past_due", "current_period_start": "2024-12-01T18:25:37.169Z", "current_period_end": "2023-01-20T06:21:22.156Z", "cancel_at_period_end": false, "canceled_at": "2023-04-05T09:49:38.010Z", "started_at": "2023-03-17T01:57:00.187Z", "ends_at": "2025-01-24T00:05:25.844Z", "ended_at": "2024-07-12T19:57:33.016Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "too_expensive", "customer_cancellation_comment": "", "metadata": {}, "customer": {"created_at": "2023-03-01T20:22:54.911Z", "modified_at": "2024-02-08T01:09:52.088Z", "id": "", "metadata": {"key": ""}, "email": "Kenyatta32@hotmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Tokelau"}, "tax_id": ["ca_pst_bc"], "organization_id": "", "avatar_url": "https://unpleasant-chairperson.info/"}, "user_id": "", "user": {"id": "", "email": "Hope_Brakus@yahoo.com", "public_name": ""}, "product": {"created_at": "2025-08-04T08:35:41.482Z", "modified_at": "2023-12-03T21:35:05.453Z", "id": "", "name": "", "description": "er boom however when uh-huh madly", "is_recurring": false, "is_archived": false, "organization_id": "", "metadata": {"key": 29267, "key1": 688784, "key2": 408066}, "prices": [], "benefits": [{"created_at": "2024-03-21T09:41:56.524Z", "modified_at": "2023-03-28T18:28:26.777Z", "id": "", "description": "tenement commonly softly", "selectable": false, "deletable": true, "organization_id": "", "properties": {"note": ""}, "is_tax_applicable": false}, {"created_at": "2024-10-14T09:46:50.350Z", "modified_at": "2024-09-14T02:22:04.749Z", "id": "", "description": "massive sorrowful aw", "selectable": true, "deletable": false, "organization_id": "", "properties": {"image_height": 400, "image_width": 400}}, {"created_at": "2023-10-09T03:58:07.827Z", "modified_at": "2025-10-07T04:54:41.981Z", "id": "", "description": "steeple overheard swerve than bicycle twine huzzah obnoxiously", "selectable": true, "deletable": true, "organization_id": "", "properties": {"note": ""}, "is_tax_applicable": false}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/sbin", "mime_type": "", "size": 207713, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-01-01T09:29:03.176Z", "version": "", "is_uploaded": true, "created_at": "2024-03-30T01:03:36.657Z", "size_readable": "", "public_url": "https://next-taxicab.net/"}], "attached_custom_fields": []}, "price": {"created_at": "2025-07-14T16:07:38.809Z", "modified_at": "2024-06-18T04:12:45.071Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "month"}, "discount": {"duration": "once", "type": "percentage", "amount": 832756, "currency": "Hryvnia", "created_at": "2025-04-21T05:31:02.040Z", "modified_at": "2024-03-28T11:42:09.368Z", "id": "", "metadata": {"key": "", "key1": 824962, "key2": 467428}, "name": "", "code": "", "starts_at": "2025-03-07T02:26:31.358Z", "ends_at": "2023-06-21T02:05:32.746Z", "max_redemptions": 783071, "redemptions_count": 374478, "organization_id": ""}}, {"created_at": "2025-07-30T17:58:06.895Z", "modified_at": "2024-06-27T18:50:42.778Z", "id": "", "amount": 985599, "currency": "Lebanese Pound", "recurring_interval": "year", "status": "canceled", "current_period_start": "2025-10-25T10:50:37.438Z", "current_period_end": "2025-01-09T05:13:52.456Z", "cancel_at_period_end": true, "canceled_at": "2024-04-22T16:13:21.235Z", "started_at": "2024-09-10T11:54:14.319Z", "ends_at": "2025-01-19T21:45:37.595Z", "ended_at": "2025-12-19T02:03:54.761Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "low_quality", "customer_cancellation_comment": "", "metadata": {}, "customer": {"created_at": "2024-10-29T05:49:01.311Z", "modified_at": "2023-12-07T09:46:44.632Z", "id": "", "metadata": {"key": 527084, "key1": 80289, "key2": true}, "email": "Timmy27@hotmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Saudi Arabia"}, "tax_id": [""], "organization_id": "", "avatar_url": "https://puzzled-morning.com/"}, "user_id": "", "user": {"id": "", "email": "Isabelle83@hotmail.com", "public_name": ""}, "product": {"created_at": "2025-11-27T17:23:02.117Z", "modified_at": "2023-04-04T09:25:47.730Z", "id": "", "name": "", "description": "till boo ack solicit weakly segregate boo", "is_recurring": true, "is_archived": false, "organization_id": "", "metadata": {"key": true, "key1": true, "key2": 387926}, "prices": [{"created_at": "2024-12-19T21:19:09.188Z", "modified_at": "2023-10-19T07:09:33.817Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "month"}, {"created_at": "2023-04-17T02:32:11.293Z", "modified_at": "2023-02-08T12:01:40.965Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 847002}], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/var/mail", "mime_type": "", "size": 677862, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-10-02T21:48:51.327Z", "version": "", "is_uploaded": false, "created_at": "2025-01-17T21:03:55.557Z", "size_readable": "", "public_url": "https://clear-cut-dredger.name"}, {"id": "", "organization_id": "", "name": "", "path": "/lost+found", "mime_type": "", "size": 708212, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-08-25T01:38:35.053Z", "version": "", "is_uploaded": false, "created_at": "2023-06-11T03:56:34.876Z", "size_readable": "", "public_url": "https://humble-programme.info/"}, {"id": "", "organization_id": "", "name": "", "path": "/lib", "mime_type": "", "size": 981370, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-08-27T12:00:34.207Z", "version": "", "is_uploaded": true, "created_at": "2024-03-07T00:48:20.677Z", "size_readable": "", "public_url": "https://pleasing-edge.net"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2023-08-10T06:23:08.124Z", "modified_at": "2024-12-10T13:25:02.054Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 794717, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2023-07-04T18:07:17.452Z", "modified_at": "2023-08-14T23:46:39.543Z", "id": "", "metadata": {"key": true, "key1": 869031}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 839453, "required": true}]}, "price": {"created_at": "2025-01-26T04:32:33.599Z", "modified_at": "2023-11-16T19:05:14.488Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "year"}, "discount": {"duration": "repeating", "duration_in_months": 668046, "type": "fixed", "basis_points": 976080, "created_at": "2023-09-15T23:31:11.246Z", "modified_at": "2025-10-29T11:50:25.062Z", "id": "", "metadata": {"key": true}, "name": "", "code": "", "starts_at": "2025-06-14T21:21:53.369Z", "ends_at": "2024-01-29T07:09:20.439Z", "max_redemptions": 503527, "redemptions_count": 919939, "organization_id": ""}}, {"created_at": "2025-09-05T20:18:34.543Z", "modified_at": "2024-02-23T23:44:40.827Z", "id": "", "amount": 86895, "currency": "Cedi", "recurring_interval": "month", "status": "active", "current_period_start": "2025-11-01T20:47:26.029Z", "current_period_end": "2024-06-30T05:56:59.196Z", "cancel_at_period_end": true, "canceled_at": "2023-02-21T11:53:00.306Z", "started_at": "2023-12-08T03:17:39.708Z", "ends_at": "2025-01-02T17:38:42.285Z", "ended_at": "2023-02-25T17:28:41.442Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "too_expensive", "customer_cancellation_comment": "", "metadata": {}, "customer": {"created_at": "2024-05-03T11:56:14.302Z", "modified_at": "2023-05-09T08:47:32.901Z", "id": "", "metadata": {"key": true}, "email": "Vallie.Goyette@gmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Rwanda"}, "tax_id": ["ge_vat"], "organization_id": "", "avatar_url": "https://nimble-individual.biz/"}, "user_id": "", "user": {"id": "", "email": "Florida_Mills10@hotmail.com", "public_name": ""}, "product": {"created_at": "2025-10-07T12:14:45.651Z", "modified_at": "2025-08-07T16:09:30.509Z", "id": "", "name": "", "description": "via the proper uncommon cap", "is_recurring": true, "is_archived": true, "organization_id": "", "metadata": {"key": 751280, "key1": ""}, "prices": [{"created_at": "2024-04-30T20:59:40.436Z", "modified_at": "2025-12-21T09:31:52.337Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 552172, "maximum_amount": 206795, "preset_amount": 257426, "recurring_interval": "month"}, {"created_at": "2024-08-11T23:03:40.659Z", "modified_at": "2024-07-31T10:27:50.144Z", "id": "", "is_archived": false, "product_id": ""}, {"created_at": "2025-03-30T11:09:26.643Z", "modified_at": "2025-01-26T18:37:09.216Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 481272, "maximum_amount": 439032, "preset_amount": 351638}], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/opt/share", "mime_type": "", "size": 505796, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-03-05T15:08:11.722Z", "version": "", "is_uploaded": true, "created_at": "2025-06-20T20:39:56.038Z", "size_readable": "", "public_url": "https://elliptical-marketplace.biz"}, {"id": "", "organization_id": "", "name": "", "path": "/usr/share", "mime_type": "", "size": 96647, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-01-09T21:57:02.179Z", "version": "", "is_uploaded": true, "created_at": "2025-02-06T05:52:39.668Z", "size_readable": "", "public_url": "https://weighty-tentacle.name/"}, {"id": "", "organization_id": "", "name": "", "path": "/Users", "mime_type": "", "size": 191255, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-02-12T19:40:48.863Z", "version": "", "is_uploaded": false, "created_at": "2024-06-08T07:01:01.703Z", "size_readable": "", "public_url": "https://homely-testing.org"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2023-07-15T13:55:49.316Z", "modified_at": "2023-08-25T07:45:20.632Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": "", "properties": {"options": []}}, "order": 27174, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2024-05-19T20:06:15.435Z", "modified_at": "2023-09-28T19:48:55.538Z", "id": "", "metadata": {"key": 929829}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 134580, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2024-05-29T02:21:30.439Z", "modified_at": "2023-08-11T20:43:56.103Z", "id": "", "metadata": {"key": "", "key1": ""}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 223832, "required": true}]}, "price": {"created_at": "2023-08-06T07:43:13.764Z", "modified_at": "2023-04-05T00:28:25.982Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 311681, "recurring_interval": "month"}, "discount": {"duration": "once", "type": "percentage", "basis_points": 906109, "created_at": "2024-12-14T10:29:31.180Z", "modified_at": "2023-10-09T07:21:47.148Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2023-04-15T11:16:29.756Z", "ends_at": "2024-03-30T11:43:42.338Z", "max_redemptions": 644930, "redemptions_count": 379069, "organization_id": ""}}], "pagination": {"total_count": 709485, "max_page": 543675}} "422": application/json: {} subscriptions:export: @@ -1839,14 +1858,58 @@ examples: application/json: "" "422": application/json: {} + subscriptions:get: + speakeasy-default-subscriptions:get: + parameters: + path: + id: "" + responses: + "200": + application/json: {"created_at": "2025-02-06T13:54:48.821Z", "modified_at": "2024-09-04T11:33:52.011Z", "id": "", "amount": 544221, "currency": "Moroccan Dirham", "recurring_interval": "year", "status": "active", "current_period_start": "2024-05-09T02:28:23.533Z", "current_period_end": "2023-10-16T00:34:27.106Z", "cancel_at_period_end": true, "canceled_at": "2025-10-24T02:41:21.259Z", "started_at": "2024-04-25T04:53:50.189Z", "ends_at": "2025-05-28T07:17:57.134Z", "ended_at": "2023-03-28T11:05:23.685Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "low_quality", "customer_cancellation_comment": "", "metadata": {"key": ""}, "customer": {"created_at": "2024-08-28T15:06:35.685Z", "modified_at": "2025-06-02T05:45:06.910Z", "id": "", "metadata": {"key": false}, "email": "Enid.Dare78@yahoo.com", "email_verified": false, "name": "", "billing_address": {"country": "Samoa"}, "tax_id": ["ec_ruc", ""], "organization_id": "", "avatar_url": "https://jumbo-hippodrome.com"}, "user_id": "", "user": {"id": "", "email": "Kathryn_Stoltenberg53@gmail.com", "public_name": ""}, "product": {"created_at": "2025-03-10T04:17:15.995Z", "modified_at": "2025-04-19T12:48:05.172Z", "id": "", "name": "", "description": "notwithstanding harangue once out effector determined", "is_recurring": true, "is_archived": true, "organization_id": "", "metadata": {"key": true}, "prices": [], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/boot", "mime_type": "", "size": 491026, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-11-26T02:36:46.301Z", "version": "", "is_uploaded": false, "created_at": "2023-03-21T02:59:14.977Z", "size_readable": "", "public_url": "https://neglected-scholarship.org"}, {"id": "", "organization_id": "", "name": "", "path": "/bin", "mime_type": "", "size": 339847, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-07-15T00:41:32.877Z", "version": "", "is_uploaded": false, "created_at": "2024-09-24T06:33:56.610Z", "size_readable": "", "public_url": "https://gummy-louse.org"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2024-08-08T00:55:49.489Z", "modified_at": "2023-03-22T21:11:05.801Z", "id": "", "metadata": {"key": 716267, "key1": "", "key2": false}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 554334, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2023-03-02T09:16:28.575Z", "modified_at": "2024-09-25T20:07:17.479Z", "id": "", "metadata": {"key": "", "key1": "", "key2": ""}, "slug": "", "name": "", "organization_id": "", "properties": {"options": [{"value": "", "label": ""}, {"value": "", "label": ""}, {"value": "", "label": ""}]}}, "order": 140875, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2024-03-08T18:10:54.489Z", "modified_at": "2024-08-07T22:42:08.632Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 430812, "required": true}]}, "price": {"created_at": "2023-03-30T11:50:33.761Z", "modified_at": "2024-02-03T08:18:51.900Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 530112, "maximum_amount": 813525, "preset_amount": 491282, "recurring_interval": "year"}, "discount": {"duration": "forever", "duration_in_months": 960234, "type": "fixed", "amount": 96389, "currency": "Lebanese Pound", "created_at": "2024-11-09T06:42:52.951Z", "modified_at": "2025-09-27T18:33:49.065Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2024-02-20T01:25:38.973Z", "ends_at": "2023-09-29T18:18:20.911Z", "max_redemptions": 783566, "redemptions_count": 163922, "organization_id": ""}} + "404": + application/json: {"detail": ""} + "422": + application/json: {} + subscriptions:update: + speakeasy-default-subscriptions:update: + parameters: + path: + id: "" + requestBody: + application/json: {} + responses: + "200": + application/json: {"created_at": "2024-10-16T10:52:42.015Z", "modified_at": "2024-01-13T16:52:57.274Z", "id": "", "amount": 991464, "currency": "Norwegian Krone", "recurring_interval": "month", "status": "unpaid", "current_period_start": "2023-03-01T06:03:05.915Z", "current_period_end": "2025-09-09T13:32:29.600Z", "cancel_at_period_end": true, "canceled_at": "2023-12-08T09:52:54.805Z", "started_at": "2023-10-01T09:16:09.932Z", "ends_at": "2023-06-02T23:29:52.263Z", "ended_at": "2025-05-15T01:05:20.251Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "other", "customer_cancellation_comment": "", "metadata": {"key": 771203}, "customer": {"created_at": "2025-01-30T02:01:14.461Z", "modified_at": "2024-03-19T01:46:46.018Z", "id": "", "metadata": {}, "email": "Ramona.Kuvalis@hotmail.com", "email_verified": false, "name": "", "billing_address": {"country": "South Georgia and the South Sandwich Islands"}, "tax_id": ["jp_cn", "", "kr_brn"], "organization_id": "", "avatar_url": "https://sticky-bell.com"}, "user_id": "", "user": {"id": "", "email": "Madisyn.Monahan47@yahoo.com", "public_name": ""}, "product": {"created_at": "2025-05-13T01:40:59.920Z", "modified_at": "2024-01-06T08:10:12.343Z", "id": "", "name": "", "description": "dowse restfully ew woot through", "is_recurring": true, "is_archived": false, "organization_id": "", "metadata": {"key": "", "key1": 301848}, "prices": [{"created_at": "2024-01-03T08:52:11.922Z", "modified_at": "2024-08-06T22:56:22.190Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 556706, "recurring_interval": "month"}, {"created_at": "2025-11-26T02:34:57.845Z", "modified_at": "2023-12-24T14:22:27.846Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 911620, "recurring_interval": "month"}], "benefits": [{"created_at": "2025-01-09T08:40:25.521Z", "modified_at": "2024-05-04T02:13:27.779Z", "id": "", "description": "ultimately in likely opera please antelope", "selectable": true, "deletable": false, "organization_id": "", "properties": {"repository_owner": "polarsource", "repository_name": "private_repo", "permission": "maintain"}}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/opt/bin", "mime_type": "", "size": 527494, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-09-27T08:59:31.628Z", "version": "", "is_uploaded": true, "created_at": "2025-03-15T16:18:52.369Z", "size_readable": "", "public_url": "https://vain-suitcase.name/"}, {"id": "", "organization_id": "", "name": "", "path": "/mnt", "mime_type": "", "size": 877939, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-01-23T23:31:39.052Z", "version": "", "is_uploaded": false, "created_at": "2025-10-17T01:35:15.856Z", "size_readable": "", "public_url": "https://misguided-range.org"}, {"id": "", "organization_id": "", "name": "", "path": "/home/user/dir", "mime_type": "", "size": 207320, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-04-28T21:13:40.227Z", "version": "", "is_uploaded": true, "created_at": "2023-07-15T06:46:09.402Z", "size_readable": "", "public_url": "https://dazzling-secrecy.com/"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2025-01-28T01:39:50.410Z", "modified_at": "2023-08-10T12:27:48.657Z", "id": "", "metadata": {"key": ""}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 246216, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2024-06-05T06:38:45.246Z", "modified_at": "2025-02-05T00:04:44.770Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": "", "properties": {"options": [{"value": "", "label": ""}]}}, "order": 253591, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2024-01-28T09:57:47.188Z", "modified_at": "2024-06-04T13:23:06.952Z", "id": "", "metadata": {"key": true, "key1": 517232, "key2": false}, "slug": "", "name": "", "organization_id": "", "properties": {"options": [{"value": "", "label": ""}, {"value": "", "label": ""}]}}, "order": 595467, "required": true}]}, "price": {"created_at": "2023-01-25T20:29:41.475Z", "modified_at": "2024-11-10T05:00:44.440Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 245016, "maximum_amount": 457026, "preset_amount": 355250, "recurring_interval": "month"}, "discount": {"duration": "once", "duration_in_months": 780643, "type": "fixed", "amount": 22113, "currency": "Dalasi", "created_at": "2025-03-19T11:13:04.415Z", "modified_at": "2024-03-03T02:43:41.509Z", "id": "", "metadata": {"key": ""}, "name": "", "code": "", "starts_at": "2024-09-03T16:16:36.463Z", "ends_at": "2023-06-09T10:57:26.043Z", "max_redemptions": 402083, "redemptions_count": 616970, "organization_id": ""}} + "403": + application/json: {"detail": ""} + "404": + application/json: {"detail": ""} + "422": + application/json: {} + subscriptions:revoke: + speakeasy-default-subscriptions:revoke: + parameters: + path: + id: "" + responses: + "200": + application/json: {"created_at": "2025-08-02T01:27:08.104Z", "modified_at": "2023-02-05T23:02:33.945Z", "id": "", "amount": 124611, "currency": "Yuan Renminbi", "recurring_interval": "year", "status": "active", "current_period_start": "2025-11-15T01:01:28.985Z", "current_period_end": "2025-06-27T03:22:38.420Z", "cancel_at_period_end": true, "canceled_at": "2024-07-23T03:28:01.127Z", "started_at": "2024-09-11T11:09:42.114Z", "ends_at": "2025-06-26T07:29:32.091Z", "ended_at": "2023-12-21T11:58:28.310Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "missing_features", "customer_cancellation_comment": "", "metadata": {"key": "", "key1": 820172}, "customer": {"created_at": "2025-12-27T11:38:31.558Z", "modified_at": "2023-04-03T07:08:59.801Z", "id": "", "metadata": {"key": 565960}, "email": "Ida_Huels@gmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Syrian Arab Republic"}, "tax_id": [], "organization_id": "", "avatar_url": "https://delirious-digit.info/"}, "user_id": "", "user": {"id": "", "email": "Golda31@hotmail.com", "public_name": ""}, "product": {"created_at": "2024-05-04T05:57:04.637Z", "modified_at": "2023-02-20T05:29:48.103Z", "id": "", "name": "", "description": "knowingly despite fess", "is_recurring": true, "is_archived": false, "organization_id": "", "metadata": {}, "prices": [], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/sys", "mime_type": "", "size": 846047, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-08-20T08:18:12.182Z", "version": "", "is_uploaded": false, "created_at": "2023-04-21T06:17:46.998Z", "size_readable": "", "public_url": "https://coarse-obesity.name"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2023-11-28T22:10:38.468Z", "modified_at": "2024-01-05T11:02:45.204Z", "id": "", "metadata": {"key": true, "key1": ""}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 660972, "required": true}]}, "price": {"created_at": "2023-05-07T12:02:45.803Z", "modified_at": "2024-07-09T19:04:48.015Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 39144, "maximum_amount": 57383, "preset_amount": 76309, "recurring_interval": "year"}, "discount": {"duration": "forever", "duration_in_months": 559341, "type": "fixed", "basis_points": 696315, "created_at": "2025-01-07T22:58:31.411Z", "modified_at": "2025-07-03T11:58:07.112Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2025-08-07T15:53:54.904Z", "ends_at": "2025-02-01T11:04:15.603Z", "max_redemptions": 930328, "redemptions_count": 637317, "organization_id": ""}} + "403": + application/json: {"detail": ""} + "404": + application/json: {"detail": ""} + "422": + application/json: {} advertisements:list: speakeasy-default-advertisements:list: parameters: query: benefit_id: "" + page: 1 + limit: 10 responses: "200": - application/json: {"items": [{"created_at": "2023-08-23T19:26:20.850Z", "modified_at": "2024-01-14T10:26:00.433Z", "id": "", "image_url": "https://energetic-circumference.name/", "image_url_dark": "https://agile-publicity.com", "text": "", "link_url": "https://roasted-language.name/"}, {"created_at": "2022-01-09T04:26:27.312Z", "modified_at": "2022-03-01T20:22:54.911Z", "id": "", "image_url": "https://lovely-bench.org/", "image_url_dark": "https://ugly-jungle.com", "text": "", "link_url": "https://torn-affiliate.org/"}, {"created_at": "2023-04-11T02:32:42.816Z", "modified_at": "2024-09-28T03:47:03.515Z", "id": "", "image_url": "https://blue-technologist.com/", "image_url_dark": "https://instructive-hospitalization.info/", "text": "", "link_url": "https://moist-sprinkles.info/"}], "pagination": {"total_count": 863466, "max_page": 307390}, "dimensions": [113486]} + application/json: {"items": [{"created_at": "2024-08-22T19:26:20.850Z", "modified_at": "2025-01-13T10:26:00.433Z", "id": "", "image_url": "https://energetic-circumference.name/", "image_url_dark": "https://agile-publicity.com", "text": "", "link_url": "https://roasted-language.name/"}, {"created_at": "2023-01-09T04:26:27.312Z", "modified_at": "2023-03-01T20:22:54.911Z", "id": "", "image_url": "https://lovely-bench.org/", "image_url_dark": "https://ugly-jungle.com", "text": "", "link_url": "https://torn-affiliate.org/"}, {"created_at": "2024-04-10T02:32:42.816Z", "modified_at": "2025-09-28T03:47:03.515Z", "id": "", "image_url": "https://blue-technologist.com/", "image_url_dark": "https://instructive-hospitalization.info/", "text": "", "link_url": "https://moist-sprinkles.info/"}], "pagination": {"total_count": 863466, "max_page": 307390}, "dimensions": [113486]} "422": application/json: {} advertisements:get: @@ -1856,7 +1919,7 @@ examples: id: "" responses: "200": - application/json: {"created_at": "2024-02-07T13:54:48.821Z", "modified_at": "2023-09-05T11:33:52.011Z", "id": "", "image_url": "https://misguided-violin.info", "image_url_dark": "https://fatal-custom.org/", "text": "", "link_url": "https://stiff-bidet.biz/"} + application/json: {"created_at": "2025-02-06T13:54:48.821Z", "modified_at": "2024-09-04T11:33:52.011Z", "id": "", "image_url": "https://misguided-violin.info", "image_url_dark": "https://fatal-custom.org/", "text": "", "link_url": "https://stiff-bidet.biz/"} "404": application/json: {"detail": ""} "422": @@ -1865,7 +1928,7 @@ examples: speakeasy-default-oauth2-:authorize: responses: "200": - application/json: {"client": {"created_at": "2022-05-14T00:33:15.801Z", "modified_at": "2022-01-08T10:23:26.945Z", "client_id": "", "client_name": "", "client_uri": "https://thrifty-excess.biz/", "logo_uri": "https://zany-morbidity.info/", "tos_uri": "https://noted-digit.com/", "policy_uri": "https://that-airmail.info"}, "sub": {"id": "", "email": "Frederic48@hotmail.com", "avatar_url": "https://burdensome-institute.info"}, "scopes": ["license_keys:read", "checkout_links:read"]} + application/json: {"client": {"created_at": "2023-05-14T00:33:15.801Z", "modified_at": "2023-01-08T10:23:26.945Z", "client_id": "", "client_name": "", "client_uri": "https://thrifty-excess.biz/", "logo_uri": "https://zany-morbidity.info/", "tos_uri": "https://noted-digit.com/", "policy_uri": "https://that-airmail.info"}, "sub": {"id": "", "email": "Frederic48@hotmail.com", "avatar_url": "https://burdensome-institute.info"}, "scopes": ["external_organizations:read", "checkouts:read"]} oauth2:request_token: speakeasy-default-oauth2-:request-token: requestBody: @@ -1894,15 +1957,19 @@ examples: application/json: {"sub": ""} oauth2:clients:list: speakeasy-default-oauth2-:clients:list: + parameters: + query: + page: 1 + limit: 10 responses: "200": - application/json: {"items": [{"redirect_uris": ["https://definite-deer.com", "https://productive-affect.net"], "client_name": "", "created_at": "2022-04-05T09:49:38.010Z", "modified_at": "2022-03-17T01:57:00.187Z", "client_id": "", "client_secret": "", "client_id_issued_at": 687960, "client_secret_expires_at": 509883}, {"redirect_uris": ["https://awful-fund.info/", "https://victorious-merit.org/"], "client_name": "", "created_at": "2023-06-22T03:00:04.393Z", "modified_at": "2022-02-26T15:25:42.165Z", "client_id": "", "client_secret": "", "client_id_issued_at": 322596, "client_secret_expires_at": 860596}, {"redirect_uris": [], "client_name": "", "created_at": "2024-09-10T07:49:25.657Z", "modified_at": "2023-04-11T02:32:42.816Z", "client_id": "", "client_secret": "", "client_id_issued_at": 913465, "client_secret_expires_at": 173090}], "pagination": {"total_count": 75058, "max_page": 897069}} + application/json: {"items": [{"redirect_uris": ["https://definite-deer.com", "https://productive-affect.net"], "token_endpoint_auth_method": "client_secret_post", "scope": "openid profile email user:read organizations:read organizations:write custom_fields:read custom_fields:write discounts:read discounts:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write events:read events:write meters:read meters:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write customer_sessions:write orders:read refunds:read refunds:write metrics:read webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write customer_portal:read customer_portal:write", "client_name": "", "created_at": "2023-04-05T09:49:38.010Z", "modified_at": "2023-03-17T01:57:00.187Z", "client_id": "", "client_secret": "", "client_id_issued_at": 687960, "client_secret_expires_at": 509883}, {"redirect_uris": ["https://awful-fund.info/", "https://victorious-merit.org/"], "token_endpoint_auth_method": "client_secret_post", "scope": "openid profile email user:read organizations:read organizations:write custom_fields:read custom_fields:write discounts:read discounts:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write events:read events:write meters:read meters:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write customer_sessions:write orders:read refunds:read refunds:write metrics:read webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write customer_portal:read customer_portal:write", "client_name": "", "created_at": "2024-06-21T03:00:04.393Z", "modified_at": "2023-02-26T15:25:42.165Z", "client_id": "", "client_secret": "", "client_id_issued_at": 322596, "client_secret_expires_at": 860596}, {"redirect_uris": [], "token_endpoint_auth_method": "client_secret_post", "scope": "openid profile email user:read organizations:read organizations:write custom_fields:read custom_fields:write discounts:read discounts:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write events:read events:write meters:read meters:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write customer_sessions:write orders:read refunds:read refunds:write metrics:read webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write customer_portal:read customer_portal:write", "client_name": "", "created_at": "2025-09-10T07:49:25.657Z", "modified_at": "2024-04-10T02:32:42.816Z", "client_id": "", "client_secret": "", "client_id_issued_at": 913465, "client_secret_expires_at": 173090}], "pagination": {"total_count": 75058, "max_page": 897069}} "422": application/json: {} oauth2:clients:oauth2:create_client: speakeasy-default-oauth2-:clients:oauth2-:create-client: requestBody: - application/json: {"redirect_uris": ["https://inferior-chainstay.com"], "client_name": ""} + application/json: {"redirect_uris": ["https://inferior-chainstay.com"], "token_endpoint_auth_method": "client_secret_post", "scope": "openid profile email user:read organizations:read organizations:write custom_fields:read custom_fields:write discounts:read discounts:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write events:read events:write meters:read meters:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write customer_sessions:write orders:read refunds:read refunds:write metrics:read webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write customer_portal:read customer_portal:write", "client_name": ""} responses: "200": application/json: "" @@ -1924,7 +1991,7 @@ examples: path: client_id: "" requestBody: - application/json: {"redirect_uris": ["https://grown-worth.name", "https://worthwhile-avalanche.org/", "https://general-digit.com/"], "client_name": "", "client_id": ""} + application/json: {"redirect_uris": ["https://grown-worth.name", "https://worthwhile-avalanche.org/", "https://general-digit.com/"], "token_endpoint_auth_method": "client_secret_post", "scope": "openid profile email user:read organizations:read organizations:write custom_fields:read custom_fields:write discounts:read discounts:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write events:read events:write meters:read meters:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write customer_sessions:write orders:read refunds:read refunds:write metrics:read webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write customer_portal:read customer_portal:write", "client_name": "", "client_id": ""} responses: "200": application/json: "" @@ -1942,9 +2009,13 @@ examples: application/json: {} benefits:list: speakeasy-default-benefits:list: + parameters: + query: + page: 1 + limit: 10 responses: "200": - application/json: {"items": [{"created_at": "2023-08-23T19:26:20.850Z", "modified_at": "2024-01-14T10:26:00.433Z", "id": "", "description": "bob inwardly beautifully comparison", "selectable": true, "deletable": false, "organization_id": "", "properties": {"archived": {}, "files": [""]}}, {"created_at": "2023-04-20T11:47:41.889Z", "modified_at": "2023-06-11T18:07:18.321Z", "id": "", "description": "cleverly blossom defiantly", "selectable": true, "deletable": false, "organization_id": "", "properties": {"guild_id": "", "role_id": "", "guild_token": ""}}, {"created_at": "2022-06-05T08:58:03.644Z", "modified_at": "2023-12-29T19:56:44.465Z", "id": "", "description": "when uh-huh madly unless brightly", "selectable": true, "deletable": false, "organization_id": "", "properties": {"archived": {"key": true, "key1": true, "key2": true}, "files": []}}], "pagination": {"total_count": 900911, "max_page": 50388}} + application/json: {"items": [{"created_at": "2025-01-13T10:26:00.433Z", "modified_at": "2023-07-14T18:23:27.528Z", "id": "", "description": "biodegrade miserably fedora blah", "selectable": false, "deletable": true, "organization_id": "", "properties": {"repository_owner": "polarsource", "repository_name": "private_repo", "permission": "push"}}, {"created_at": "2024-04-19T11:47:41.889Z", "modified_at": "2024-06-10T18:07:18.321Z", "id": "", "description": "cleverly blossom defiantly", "selectable": true, "deletable": false, "organization_id": "", "properties": {"guild_id": "", "role_id": "", "guild_token": ""}}, {"created_at": "2023-06-05T08:58:03.644Z", "modified_at": "2024-12-28T19:56:44.465Z", "id": "", "description": "when uh-huh madly unless brightly", "selectable": true, "deletable": false, "organization_id": "", "properties": {"archived": {"key": true, "key1": true, "key2": true}, "files": []}}], "pagination": {"total_count": 900911, "max_page": 50388}} "422": application/json: {} benefits:create: @@ -1953,7 +2024,7 @@ examples: application/json: {"description": "delightfully fumigate convection though zowie up bulky electronics", "properties": {"guild_token": "", "role_id": ""}} responses: "201": - application/json: {"created_at": "2023-07-24T05:13:02.679Z", "modified_at": "2022-12-24T06:50:18.755Z", "id": "", "description": "while till lazily than clear-cut whoever", "selectable": false, "deletable": false, "organization_id": "", "properties": {"repository_owner": "polarsource", "repository_name": "private_repo", "permission": "admin"}} + application/json: {"created_at": "2024-07-23T05:13:02.679Z", "modified_at": "2023-12-24T06:50:18.755Z", "id": "", "description": "while till lazily than clear-cut whoever", "selectable": false, "deletable": false, "organization_id": "", "properties": {"repository_owner": "polarsource", "repository_name": "private_repo", "permission": "admin"}} "422": application/json: {} benefits:get: @@ -1963,7 +2034,7 @@ examples: id: "" responses: "200": - application/json: {"created_at": "2023-09-05T11:33:52.011Z", "modified_at": "2023-08-20T11:11:04.610Z", "id": "", "description": "hundred whereas dimly unused cone restructure gadzooks", "selectable": false, "deletable": false, "organization_id": "", "properties": {"archived": {"key": true, "key1": false, "key2": true}, "files": []}} + application/json: {"created_at": "2024-09-04T11:33:52.011Z", "modified_at": "2024-08-19T11:11:04.610Z", "id": "", "description": "hundred whereas dimly unused cone restructure gadzooks", "selectable": false, "deletable": false, "organization_id": "", "properties": {"archived": {"key": true, "key1": false, "key2": true}, "files": []}} "404": application/json: {"detail": ""} "422": @@ -1973,9 +2044,11 @@ examples: parameters: path: id: "" + requestBody: + application/json: {} responses: "200": - application/json: {"created_at": "2023-01-13T16:52:57.274Z", "modified_at": "2024-12-22T15:27:45.882Z", "id": "", "description": "hence reconstitute amid miserable daintily certainly yak surprised", "selectable": false, "deletable": true, "organization_id": "", "properties": {"repository_owner": "polarsource", "repository_name": "private_repo", "permission": "maintain"}} + application/json: {"created_at": "2024-01-13T16:52:57.274Z", "modified_at": "2025-12-22T15:27:45.882Z", "id": "", "description": "hence reconstitute amid miserable daintily certainly yak surprised", "selectable": false, "deletable": true, "organization_id": "", "properties": {"repository_owner": "polarsource", "repository_name": "private_repo", "permission": "maintain"}} "403": application/json: {"detail": ""} "404": @@ -1999,28 +2072,34 @@ examples: parameters: path: id: "" - query: {} + query: + page: 1 + limit: 10 responses: "200": - application/json: {"items": [{"created_at": "2022-12-04T08:24:23.192Z", "modified_at": "2024-08-14T16:34:09.973Z", "id": "", "is_granted": false, "is_revoked": true, "subscription_id": "", "order_id": "", "customer_id": "", "user_id": "", "benefit_id": ""}], "pagination": {"total_count": 693229, "max_page": 47010}} + application/json: {"items": [{"created_at": "2023-12-04T08:24:23.192Z", "modified_at": "2025-08-14T16:34:09.973Z", "id": "", "is_granted": false, "is_revoked": true, "subscription_id": "", "order_id": "", "customer_id": "", "user_id": "", "benefit_id": "", "customer": {"created_at": "2024-10-11T12:56:55.986Z", "modified_at": "2025-01-29T18:41:47.026Z", "id": "", "metadata": {}, "email": "Albert_Johnson45@hotmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Singapore"}, "tax_id": [], "organization_id": "", "avatar_url": "https://odd-conservative.org/"}, "properties": {}}], "pagination": {"total_count": 638599, "max_page": 142969}} "404": application/json: {"detail": ""} "422": application/json: {} products:list: speakeasy-default-products:list: + parameters: + query: + page: 1 + limit: 10 responses: "200": - application/json: {"items": [{"created_at": "2023-08-23T19:26:20.850Z", "modified_at": "2024-01-14T10:26:00.433Z", "id": "", "name": "", "description": "bob inwardly beautifully comparison", "is_recurring": true, "is_archived": false, "organization_id": "", "metadata": {}, "prices": [{"created_at": "2024-01-14T10:26:00.433Z", "modified_at": "2022-07-14T18:23:27.528Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 152837, "maximum_amount": 635532, "preset_amount": 639387}], "benefits": [{"created_at": "2024-02-27T06:14:46.641Z", "modified_at": "2022-04-05T09:49:38.010Z", "id": "", "description": "miserably fedora blah", "selectable": false, "deletable": true, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/Library", "mime_type": "", "size": 324206, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-04-16T23:50:27.729Z", "version": "", "is_uploaded": false, "created_at": "2023-05-04T10:59:46.313Z", "size_readable": "", "public_url": "https://stunning-vanadyl.net/"}, {"id": "", "organization_id": "", "name": "", "path": "/proc", "mime_type": "", "size": 948614, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-09-13T12:26:55.235Z", "version": "", "is_uploaded": true, "created_at": "2023-05-28T16:21:14.723Z", "size_readable": "", "public_url": "https://severe-ruin.info"}], "attached_custom_fields": []}, {"created_at": "2023-12-16T22:46:18.179Z", "modified_at": "2024-01-25T21:46:28.752Z", "id": "", "name": "", "description": "censor tenement commonly softly boo massive sorrowful", "is_recurring": true, "is_archived": true, "organization_id": "", "metadata": {}, "prices": [{"created_at": "2023-04-20T11:47:41.889Z", "modified_at": "2023-06-11T18:07:18.321Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 523875, "maximum_amount": 841031, "preset_amount": 410206, "recurring_interval": "year"}], "benefits": [{"created_at": "2023-03-06T16:40:09.484Z", "modified_at": "2022-05-05T09:08:16.530Z", "id": "", "description": "safely briefly ugh fen", "selectable": true, "deletable": false, "organization_id": "", "properties": {"note": ""}, "is_tax_applicable": true}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/usr/libexec", "mime_type": "", "size": 412854, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-10-29T17:09:20.090Z", "version": "", "is_uploaded": true, "created_at": "2023-01-25T00:59:27.422Z", "size_readable": "", "public_url": "https://oblong-inspection.net"}, {"id": "", "organization_id": "", "name": "", "path": "/etc/periodic", "mime_type": "", "size": 783071, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-02-15T10:16:55.982Z", "version": "", "is_uploaded": false, "created_at": "2023-06-28T18:50:42.778Z", "size_readable": "", "public_url": "https://married-presume.net"}, {"id": "", "organization_id": "", "name": "", "path": "/var/mail", "mime_type": "", "size": 674469, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-06-25T16:02:25.369Z", "version": "", "is_uploaded": true, "created_at": "2023-09-11T11:54:14.319Z", "size_readable": "", "public_url": "https://writhing-conversation.com"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2024-06-07T14:29:00.429Z", "modified_at": "2024-11-14T19:49:34.065Z", "id": "", "metadata": {"key": 948614, "key1": true, "key2": 993677}, "slug": "", "name": "", "organization_id": ""}, "order": 974885, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2024-04-21T16:08:32.154Z", "modified_at": "2023-03-22T14:01:55.283Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": "", "properties": {"options": [{"value": "", "label": ""}, {"value": "", "label": ""}]}}, "order": 785481, "required": true}]}, {"created_at": "2023-02-08T13:08:21.816Z", "modified_at": "2022-03-14T00:27:12.916Z", "id": "", "name": "", "description": "char while beneath while whoa piglet apud suffice", "is_recurring": false, "is_archived": true, "organization_id": "", "metadata": {"key": true, "key1": 684218}, "prices": [{"created_at": "2023-03-24T05:46:37.955Z", "modified_at": "2022-02-15T08:57:09.959Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 329360, "maximum_amount": 406391, "preset_amount": 79169}, {"created_at": "2024-12-19T15:02:23.114Z", "modified_at": "2023-04-09T13:05:11.917Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "month"}, {"created_at": "2022-02-25T05:24:29.459Z", "modified_at": "2023-11-17T05:41:51.253Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "month"}], "benefits": [{"created_at": "2022-08-31T18:02:52.360Z", "modified_at": "2022-05-16T00:18:50.934Z", "id": "", "description": "reservation down dramatic damp inasmuch unlined monthly lampoon", "selectable": false, "deletable": true, "organization_id": "", "properties": {"note": ""}, "is_tax_applicable": true}, {"created_at": "2024-09-09T09:50:03.003Z", "modified_at": "2022-09-09T21:43:59.605Z", "id": "", "description": "linear hoot at off", "selectable": true, "deletable": true, "organization_id": "", "properties": {"repository_owner": "polarsource", "repository_name": "private_repo", "permission": "admin"}}, {"created_at": "2023-08-11T21:36:18.548Z", "modified_at": "2023-04-28T03:04:42.633Z", "id": "", "description": "kissingly whether wherever too unfortunately", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2024-02-12T02:35:46.909Z", "modified_at": "2024-05-27T06:03:00.110Z", "id": "", "metadata": {"key": true, "key1": 564321, "key2": false}, "slug": "", "name": "", "organization_id": ""}, "order": 706040, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2022-03-11T17:32:08.709Z", "modified_at": "2023-10-30T05:49:01.311Z", "id": "", "metadata": {"key": true}, "slug": "", "name": "", "organization_id": ""}, "order": 123590, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2023-03-28T14:59:46.668Z", "modified_at": "2022-03-29T23:56:17.126Z", "id": "", "metadata": {"key": "", "key1": false}, "slug": "", "name": "", "organization_id": ""}, "order": 394137, "required": true}]}], "pagination": {"total_count": 929829, "max_page": 134580}} + application/json: {"items": [{"created_at": "2024-08-22T19:26:20.850Z", "modified_at": "2025-01-13T10:26:00.433Z", "id": "", "name": "", "description": "bob inwardly beautifully comparison", "is_recurring": true, "is_archived": false, "organization_id": "", "metadata": {}, "prices": [{"created_at": "2024-06-10T18:07:18.321Z", "modified_at": "2023-04-24T08:24:21.019Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 841031, "maximum_amount": 410206, "preset_amount": 863466, "recurring_interval": "month"}], "benefits": [{"created_at": "2023-07-18T12:08:53.113Z", "modified_at": "2025-09-28T13:56:10.162Z", "id": "", "description": "gosh whenever as", "selectable": true, "deletable": false, "organization_id": "", "properties": {"image_height": 400, "image_width": 400}}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/Library", "mime_type": "", "size": 324206, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-04-16T23:50:27.729Z", "version": "", "is_uploaded": false, "created_at": "2024-05-03T10:59:46.313Z", "size_readable": "", "public_url": "https://stunning-vanadyl.net/"}, {"id": "", "organization_id": "", "name": "", "path": "/proc", "mime_type": "", "size": 948614, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-09-13T12:26:55.235Z", "version": "", "is_uploaded": true, "created_at": "2024-05-27T16:21:14.723Z", "size_readable": "", "public_url": "https://severe-ruin.info"}], "attached_custom_fields": []}, {"created_at": "2024-12-15T22:46:18.179Z", "modified_at": "2025-01-24T21:46:28.752Z", "id": "", "name": "", "description": "censor tenement commonly softly boo massive sorrowful", "is_recurring": true, "is_archived": true, "organization_id": "", "metadata": {}, "prices": [{"created_at": "2024-07-27T09:20:59.531Z", "modified_at": "2023-12-12T02:49:50.316Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 292228}], "benefits": [{"created_at": "2025-03-07T17:43:00.381Z", "modified_at": "2025-06-02T11:43:36.892Z", "id": "", "description": "monthly lampoon colligate linear hoot at off however kissingly whether", "selectable": true, "deletable": false, "organization_id": "", "properties": {"prefix": "", "expires": {"ttl": 232917, "timeframe": "year"}, "activations": {"limit": 197777, "enable_customer_admin": false}, "limit_usage": 832756}}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/usr/libexec", "mime_type": "", "size": 412854, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-10-29T17:09:20.090Z", "version": "", "is_uploaded": true, "created_at": "2024-01-25T00:59:27.422Z", "size_readable": "", "public_url": "https://oblong-inspection.net"}, {"id": "", "organization_id": "", "name": "", "path": "/etc/periodic", "mime_type": "", "size": 783071, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-02-15T10:16:55.982Z", "version": "", "is_uploaded": false, "created_at": "2024-06-27T18:50:42.778Z", "size_readable": "", "public_url": "https://married-presume.net"}, {"id": "", "organization_id": "", "name": "", "path": "/var/mail", "mime_type": "", "size": 674469, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-06-25T16:02:25.369Z", "version": "", "is_uploaded": true, "created_at": "2024-09-10T11:54:14.319Z", "size_readable": "", "public_url": "https://writhing-conversation.com"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2025-08-14T13:01:58.600Z", "modified_at": "2024-01-30T05:46:03.648Z", "id": "", "metadata": {"key": 80289, "key1": true}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 974885, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2024-05-23T05:25:18.593Z", "modified_at": "2023-12-11T04:34:44.230Z", "id": "", "metadata": {"key": true}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 785481, "required": true}]}, {"created_at": "2024-02-08T13:08:21.816Z", "modified_at": "2023-03-14T00:27:12.916Z", "id": "", "name": "", "description": "char while beneath while whoa piglet apud suffice", "is_recurring": false, "is_archived": true, "organization_id": "", "metadata": {"key": true, "key1": 684218}, "prices": [{"created_at": "2025-09-04T00:37:31.188Z", "modified_at": "2023-05-23T19:32:31.453Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 387926}, {"created_at": "2025-05-23T21:54:30.697Z", "modified_at": "2024-12-19T21:19:09.188Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 249879}, {"created_at": "2023-05-07T21:01:22.996Z", "modified_at": "2023-04-17T02:32:11.293Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "month"}], "benefits": [{"created_at": "2025-09-02T23:08:00.186Z", "modified_at": "2025-10-28T04:58:58.509Z", "id": "", "description": "powerfully considering despite darn even heavy ick sadly", "selectable": true, "deletable": false, "organization_id": "", "properties": {"image_height": 400, "image_width": 400}}, {"created_at": "2024-07-05T20:46:49.834Z", "modified_at": "2025-10-05T06:03:04.753Z", "id": "", "description": "in fooey whose rival astride yowza whose portray rectangular mixed", "selectable": false, "deletable": false, "organization_id": "", "properties": {"guild_id": "", "role_id": "", "guild_token": ""}}, {"created_at": "2025-11-28T05:50:05.391Z", "modified_at": "2024-11-05T18:58:59.059Z", "id": "", "description": "supposing limply over simple unlike elliptical", "selectable": false, "deletable": true, "organization_id": "", "properties": {"prefix": "", "expires": {"ttl": 871016, "timeframe": "year"}, "activations": {"limit": 341163, "enable_customer_admin": true}, "limit_usage": 700041}}], "medias": [], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2024-07-13T16:13:57.819Z", "modified_at": "2024-12-20T01:52:19.079Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 706040, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2025-08-12T23:43:12.321Z", "modified_at": "2024-02-10T18:58:34.440Z", "id": "", "metadata": {"key": false, "key1": 178449, "key2": ""}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 123590, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2024-10-08T14:35:58.475Z", "modified_at": "2025-07-31T12:32:19.036Z", "id": "", "metadata": {"key": ""}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 394137, "required": true}]}], "pagination": {"total_count": 929829, "max_page": 134580}} "422": application/json: {} products:create: speakeasy-default-products:create: requestBody: - application/json: {"name": "", "prices": [{"price_amount": 417458, "recurring_interval": "month"}, {"price_amount": 69025, "recurring_interval": "year"}]} + application/json: {"name": "", "prices": [{"recurring_interval": "month"}]} responses: "201": - application/json: {"created_at": "2024-11-08T08:43:39.394Z", "modified_at": "2022-01-01T02:16:41.381Z", "id": "", "name": "", "description": "fumigate convection though zowie", "is_recurring": true, "is_archived": true, "organization_id": "", "metadata": {"key": true}, "prices": [{"created_at": "2022-07-06T00:30:20.403Z", "modified_at": "2022-04-09T14:25:29.356Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 816588}, {"created_at": "2024-11-15T07:40:19.243Z", "modified_at": "2023-01-27T07:05:06.005Z", "id": "", "is_archived": true, "product_id": ""}], "benefits": [{"created_at": "2022-09-10T10:08:53.440Z", "modified_at": "2022-08-20T15:01:30.899Z", "id": "", "description": "approximate though championship", "selectable": false, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/var/tmp", "mime_type": "", "size": 282436, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-06-30T08:34:56.549Z", "version": "", "is_uploaded": false, "created_at": "2024-05-17T00:17:31.738Z", "size_readable": "", "public_url": "https://vivid-understanding.org"}, {"id": "", "organization_id": "", "name": "", "path": "/opt/lib", "mime_type": "", "size": 78523, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-03-01T22:29:56.777Z", "version": "", "is_uploaded": false, "created_at": "2023-02-12T14:03:31.774Z", "size_readable": "", "public_url": "https://frequent-cope.net/"}, {"id": "", "organization_id": "", "name": "", "path": "/var/tmp", "mime_type": "", "size": 239872, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-09-18T18:56:43.213Z", "version": "", "is_uploaded": false, "created_at": "2023-06-02T16:37:35.306Z", "size_readable": "", "public_url": "https://spotless-catalyst.biz/"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2024-04-13T05:49:58.922Z", "modified_at": "2022-08-30T02:12:40.558Z", "id": "", "metadata": {"key": 588497}, "slug": "", "name": "", "organization_id": "", "properties": {"options": []}}, "order": 842284, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2023-06-22T12:00:27.656Z", "modified_at": "2022-12-23T16:58:53.860Z", "id": "", "metadata": {"key": "", "key1": "", "key2": ""}, "slug": "", "name": "", "organization_id": ""}, "order": 978908, "required": true}]} + application/json: {"created_at": "2023-03-17T15:39:20.911Z", "modified_at": "2025-05-22T22:27:14.379Z", "id": "", "name": "", "description": "resolve barracks approximate though championship kookily attend alongside aw blend", "is_recurring": false, "is_archived": false, "organization_id": "", "metadata": {"key": "", "key1": ""}, "prices": [{"created_at": "2025-06-21T18:08:28.651Z", "modified_at": "2023-08-22T04:50:14.370Z", "id": "", "is_archived": false, "product_id": ""}], "benefits": [{"created_at": "2023-10-25T02:31:52.809Z", "modified_at": "2024-06-28T18:56:13.043Z", "id": "", "description": "embalm simple ouch when pfft ah vainly", "selectable": true, "deletable": false, "organization_id": "", "properties": {"repository_owner": "polarsource", "repository_name": "private_repo", "permission": "maintain"}}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/private", "mime_type": "", "size": 931588, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-10-12T04:29:06.039Z", "version": "", "is_uploaded": true, "created_at": "2025-12-13T05:18:01.829Z", "size_readable": "", "public_url": "https://charming-request.com/"}, {"id": "", "organization_id": "", "name": "", "path": "/opt/bin", "mime_type": "", "size": 572012, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-12-08T21:10:50.355Z", "version": "", "is_uploaded": true, "created_at": "2024-11-07T02:43:41.978Z", "size_readable": "", "public_url": "https://different-exterior.net"}, {"id": "", "organization_id": "", "name": "", "path": "/usr/libdata", "mime_type": "", "size": 590634, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-09-03T08:51:57.955Z", "version": "", "is_uploaded": false, "created_at": "2025-07-21T08:37:15.860Z", "size_readable": "", "public_url": "https://distant-horde.org"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2025-02-20T15:45:43.913Z", "modified_at": "2025-08-26T02:51:53.751Z", "id": "", "metadata": {"key": "", "key1": 665035, "key2": true}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 70072, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2025-09-28T14:21:02.300Z", "modified_at": "2024-06-05T11:03:53.648Z", "id": "", "metadata": {"key": "", "key1": ""}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 608435, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2023-09-09T04:13:50.826Z", "modified_at": "2024-05-12T13:20:59.575Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 409874, "required": false}]} "422": application/json: {} products:get: @@ -2030,7 +2109,7 @@ examples: id: "" responses: "200": - application/json: {"created_at": "2024-02-07T13:54:48.821Z", "modified_at": "2023-09-05T11:33:52.011Z", "id": "", "name": "", "description": "tune only fellow scary but embarrassment metabolise", "is_recurring": false, "is_archived": false, "organization_id": "", "metadata": {"key": true, "key1": true}, "prices": [], "benefits": [{"created_at": "2023-09-05T11:33:52.011Z", "modified_at": "2023-08-20T11:11:04.610Z", "id": "", "description": "hundred whereas dimly unused cone restructure gadzooks", "selectable": false, "deletable": false, "organization_id": "", "properties": {"archived": {"key": true, "key1": false, "key2": true}, "files": []}}, {"created_at": "2023-03-07T06:16:39.367Z", "modified_at": "2024-09-22T11:43:32.718Z", "id": "", "description": "jogging airman per border ascertain scholarship to blink nifty", "selectable": true, "deletable": false, "organization_id": "", "properties": {"archived": {}, "files": ["", ""]}}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/rescue", "mime_type": "", "size": 443816, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-12-12T23:35:27.798Z", "version": "", "is_uploaded": true, "created_at": "2023-01-28T12:32:42.599Z", "size_readable": "", "public_url": "https://needy-orchid.biz/"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2022-12-27T04:21:17.306Z", "modified_at": "2022-11-12T06:57:18.668Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": ""}, "order": 893124, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2022-06-04T09:34:39.316Z", "modified_at": "2023-11-10T22:35:34.856Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": "", "properties": {"options": [{"value": "", "label": ""}]}}, "order": 318562, "required": false}]} + application/json: {"created_at": "2025-02-06T13:54:48.821Z", "modified_at": "2024-09-04T11:33:52.011Z", "id": "", "name": "", "description": "tune only fellow scary but embarrassment metabolise", "is_recurring": false, "is_archived": false, "organization_id": "", "metadata": {"key": true, "key1": true}, "prices": [], "benefits": [{"created_at": "2025-09-22T11:43:32.718Z", "modified_at": "2025-04-06T10:37:18.493Z", "id": "", "description": "bravely quizzically how lest given wash fork whose helpful", "selectable": false, "deletable": true, "organization_id": "", "properties": {"guild_id": "", "role_id": "", "guild_token": ""}}, {"created_at": "2025-07-27T18:59:52.807Z", "modified_at": "2023-12-27T04:21:17.306Z", "id": "", "description": "obediently valley vice joshingly although", "selectable": false, "deletable": true, "organization_id": "", "properties": {"repository_owner": "polarsource", "repository_name": "private_repo", "permission": "maintain"}}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/rescue", "mime_type": "", "size": 443816, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-12-12T23:35:27.798Z", "version": "", "is_uploaded": true, "created_at": "2024-01-28T12:32:42.599Z", "size_readable": "", "public_url": "https://needy-orchid.biz/"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2023-12-11T03:15:37.914Z", "modified_at": "2025-10-20T04:57:39.211Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 893124, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2025-09-19T13:07:51.180Z", "modified_at": "2023-02-03T19:38:47.426Z", "id": "", "metadata": {"key": 609810, "key1": 306618, "key2": ""}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 318562, "required": false}]} "404": application/json: {"detail": ""} "422": @@ -2040,9 +2119,11 @@ examples: parameters: path: id: "" + requestBody: + application/json: {} responses: "200": - application/json: {"created_at": "2024-07-28T19:04:48.565Z", "modified_at": "2023-10-17T10:52:42.015Z", "id": "", "name": "", "description": "hydrolyze for drat underneath sticky", "is_recurring": true, "is_archived": true, "organization_id": "", "metadata": {"key": 119053}, "prices": [{"created_at": "2023-01-13T16:52:57.274Z", "modified_at": "2024-12-22T15:27:45.882Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 488852, "maximum_amount": 984008, "preset_amount": 54062}, {"created_at": "2022-12-08T09:52:54.805Z", "modified_at": "2022-10-01T09:16:09.932Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 789275, "maximum_amount": 889838, "preset_amount": 302461}], "benefits": [{"created_at": "2024-04-25T05:43:42.397Z", "modified_at": "2024-01-31T02:01:14.461Z", "id": "", "description": "furthermore graceful hungrily where woot royal", "selectable": true, "deletable": false, "organization_id": "", "properties": {"guild_id": "", "role_id": "", "guild_token": ""}}, {"created_at": "2022-10-18T10:44:09.680Z", "modified_at": "2022-08-06T05:00:55.823Z", "id": "", "description": "blah intensely fragrant lest ferret", "selectable": true, "deletable": false, "organization_id": "", "properties": {"note": ""}, "is_tax_applicable": true}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/root", "mime_type": "", "size": 308458, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-08-20T05:17:08.709Z", "version": "", "is_uploaded": true, "created_at": "2024-05-05T06:06:40.987Z", "size_readable": "", "public_url": "https://nice-lender.net"}, {"id": "", "organization_id": "", "name": "", "path": "/usr/src", "mime_type": "", "size": 224552, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-08-16T05:21:16.931Z", "version": "", "is_uploaded": false, "created_at": "2022-06-01T04:50:20.641Z", "size_readable": "", "public_url": "https://forceful-collectivization.net/"}, {"id": "", "organization_id": "", "name": "", "path": "/etc/defaults", "mime_type": "", "size": 925954, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-08-14T10:29:49.382Z", "version": "", "is_uploaded": false, "created_at": "2022-08-10T12:27:48.657Z", "size_readable": "", "public_url": "https://elderly-devil.net/"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2023-08-11T02:36:04.300Z", "modified_at": "2024-01-10T08:40:25.521Z", "id": "", "metadata": {"key": 44563}, "slug": "", "name": "", "organization_id": ""}, "order": 158724, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2023-07-24T20:53:49.881Z", "modified_at": "2024-02-29T13:16:52.929Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": ""}, "order": 676467, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2024-07-10T11:49:12.863Z", "modified_at": "2024-11-16T14:51:36.195Z", "id": "", "metadata": {"key": true, "key1": false, "key2": 99360}, "slug": "", "name": "", "organization_id": ""}, "order": 619716, "required": true}]} + application/json: {"created_at": "2025-07-28T19:04:48.565Z", "modified_at": "2024-10-16T10:52:42.015Z", "id": "", "name": "", "description": "hydrolyze for drat underneath sticky", "is_recurring": true, "is_archived": true, "organization_id": "", "metadata": {"key": 119053}, "prices": [{"created_at": "2023-04-23T07:27:43.936Z", "modified_at": "2025-05-13T01:40:59.920Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 348627, "maximum_amount": 404031, "preset_amount": 166206, "recurring_interval": "year"}, {"created_at": "2024-03-06T08:49:00.130Z", "modified_at": "2023-10-16T11:25:33.944Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 845914, "maximum_amount": 652850, "preset_amount": 828354}], "benefits": [{"created_at": "2025-01-05T19:25:16.577Z", "modified_at": "2023-09-24T19:37:32.283Z", "id": "", "description": "belabor past wearily broadside backburn", "selectable": false, "deletable": true, "organization_id": "", "properties": {"note": ""}, "is_tax_applicable": true}, {"created_at": "2023-05-10T12:36:21.295Z", "modified_at": "2024-06-16T12:36:03.175Z", "id": "", "description": "represent braid courageously coin highlight norm savour", "selectable": true, "deletable": false, "organization_id": "", "properties": {"prefix": "", "expires": {"ttl": 245780, "timeframe": "month"}, "activations": {"limit": 734197, "enable_customer_admin": true}, "limit_usage": 924554}}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/root", "mime_type": "", "size": 308458, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-08-20T05:17:08.709Z", "version": "", "is_uploaded": true, "created_at": "2025-05-05T06:06:40.987Z", "size_readable": "", "public_url": "https://nice-lender.net"}, {"id": "", "organization_id": "", "name": "", "path": "/usr/src", "mime_type": "", "size": 224552, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-08-16T05:21:16.931Z", "version": "", "is_uploaded": false, "created_at": "2023-06-01T04:50:20.641Z", "size_readable": "", "public_url": "https://forceful-collectivization.net/"}, {"id": "", "organization_id": "", "name": "", "path": "/etc/defaults", "mime_type": "", "size": 925954, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-08-13T10:29:49.382Z", "version": "", "is_uploaded": false, "created_at": "2023-08-10T12:27:48.657Z", "size_readable": "", "public_url": "https://elderly-devil.net/"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2025-02-05T00:04:44.770Z", "modified_at": "2023-09-15T07:55:56.375Z", "id": "", "metadata": {"key": ""}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 158724, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2024-06-04T13:23:06.952Z", "modified_at": "2025-04-14T17:47:24.255Z", "id": "", "metadata": {"key": 462626, "key1": 679791}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 676467, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2023-10-01T21:58:51.340Z", "modified_at": "2024-05-13T05:25:13.723Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 619716, "required": true}]} "403": application/json: {"detail": ""} "404": @@ -2058,7 +2139,7 @@ examples: application/json: {"benefits": [""]} responses: "200": - application/json: {"created_at": "2023-03-21T10:54:06.081Z", "modified_at": "2024-03-05T13:29:26.777Z", "id": "", "name": "", "description": "tag shakily wholly thankfully", "is_recurring": false, "is_archived": false, "organization_id": "", "metadata": {"key": 428702, "key1": 148878}, "prices": [], "benefits": [{"created_at": "2023-03-21T10:54:06.081Z", "modified_at": "2024-03-05T13:29:26.777Z", "id": "", "description": "tag shakily wholly thankfully", "selectable": false, "deletable": false, "organization_id": "", "properties": {"guild_id": "", "role_id": "", "guild_token": ""}}, {"created_at": "2023-03-03T23:01:58.690Z", "modified_at": "2023-04-15T20:34:00.404Z", "id": "", "description": "phooey glossy geez scotch for scarily", "selectable": false, "deletable": true, "organization_id": "", "properties": {"repository_owner": "polarsource", "repository_name": "private_repo", "permission": "maintain"}}, {"created_at": "2023-09-03T01:22:06.093Z", "modified_at": "2022-11-29T15:55:29.808Z", "id": "", "description": "hoot oil for but atomize dreamily", "selectable": false, "deletable": false, "organization_id": "", "properties": {"guild_id": "", "role_id": "", "guild_token": ""}}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/var/tmp", "mime_type": "", "size": 564220, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-10-13T13:56:42.606Z", "version": "", "is_uploaded": true, "created_at": "2022-09-01T05:56:05.291Z", "size_readable": "", "public_url": "https://low-outrun.org/"}, {"id": "", "organization_id": "", "name": "", "path": "/dev", "mime_type": "", "size": 529660, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-06-15T16:28:04.815Z", "version": "", "is_uploaded": false, "created_at": "2022-04-13T09:38:30.260Z", "size_readable": "", "public_url": "https://rare-reorganisation.net"}, {"id": "", "organization_id": "", "name": "", "path": "/etc/periodic", "mime_type": "", "size": 95994, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-07-08T04:10:14.526Z", "version": "", "is_uploaded": true, "created_at": "2023-09-01T13:19:30.143Z", "size_readable": "", "public_url": "https://prickly-petticoat.biz"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2022-10-02T08:13:22.668Z", "modified_at": "2023-03-30T07:41:47.778Z", "id": "", "metadata": {"key": true, "key1": 742936, "key2": false}, "slug": "", "name": "", "organization_id": "", "properties": {"options": [{"value": "", "label": ""}, {"value": "", "label": ""}, {"value": "", "label": ""}]}}, "order": 75934, "required": true}]} + application/json: {"created_at": "2024-03-20T10:54:06.081Z", "modified_at": "2025-03-05T13:29:26.777Z", "id": "", "name": "", "description": "tag shakily wholly thankfully", "is_recurring": false, "is_archived": false, "organization_id": "", "metadata": {"key": 428702, "key1": 148878}, "prices": [], "benefits": [{"created_at": "2025-10-10T14:56:19.830Z", "modified_at": "2025-11-20T11:00:09.297Z", "id": "", "description": "glossy geez scotch", "selectable": false, "deletable": true, "organization_id": "", "properties": {"image_height": 400, "image_width": 400}}, {"created_at": "2025-05-23T20:40:12.507Z", "modified_at": "2024-06-19T17:54:59.183Z", "id": "", "description": "apud even painfully giant till as", "selectable": true, "deletable": false, "organization_id": "", "properties": {"archived": {}, "files": []}}, {"created_at": "2023-05-13T01:26:44.096Z", "modified_at": "2024-06-27T17:47:59.829Z", "id": "", "description": "dreamily ripe commemorate", "selectable": true, "deletable": true, "organization_id": "", "properties": {"image_height": 400, "image_width": 400}}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/var/tmp", "mime_type": "", "size": 564220, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-10-13T13:56:42.606Z", "version": "", "is_uploaded": true, "created_at": "2023-09-01T05:56:05.291Z", "size_readable": "", "public_url": "https://low-outrun.org/"}, {"id": "", "organization_id": "", "name": "", "path": "/dev", "mime_type": "", "size": 529660, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-06-15T16:28:04.815Z", "version": "", "is_uploaded": false, "created_at": "2023-04-13T09:38:30.260Z", "size_readable": "", "public_url": "https://rare-reorganisation.net"}, {"id": "", "organization_id": "", "name": "", "path": "/etc/periodic", "mime_type": "", "size": 95994, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-07-07T04:10:14.526Z", "version": "", "is_uploaded": true, "created_at": "2024-08-31T13:19:30.143Z", "size_readable": "", "public_url": "https://prickly-petticoat.biz"}], "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2025-05-20T01:46:57.228Z", "modified_at": "2023-08-01T22:44:57.999Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 75934, "required": true}]} "403": application/json: {"detail": ""} "404": @@ -2067,9 +2148,13 @@ examples: application/json: {} orders:list: speakeasy-default-orders:list: + parameters: + query: + page: 1 + limit: 10 responses: "200": - application/json: {"items": [{"created_at": "2023-08-23T19:26:20.850Z", "modified_at": "2024-01-14T10:26:00.433Z", "id": "", "metadata": {}, "amount": 229716, "tax_amount": 152837, "currency": "Nepalese Rupee", "billing_reason": "subscription_cycle", "billing_address": {"country": "American Samoa"}, "customer_id": "", "product_id": "", "product_price_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "customer": {"created_at": "2024-02-27T06:14:46.641Z", "modified_at": "2022-04-05T09:49:38.010Z", "id": "", "metadata": {}, "email": "Johnathan.Adams@hotmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Uganda"}, "tax_id": ["in_gst", ""], "organization_id": "", "avatar_url": "https://torn-affiliate.org/"}, "user_id": "", "user": {"id": "", "email": "Tate_Blanda@yahoo.com", "public_name": ""}, "product": {"created_at": "2023-04-12T03:59:08.538Z", "modified_at": "2023-04-20T11:47:41.889Z", "id": "", "name": "", "description": "despite er boom however when uh-huh", "is_recurring": false, "is_archived": false, "organization_id": ""}, "product_price": {"created_at": "2024-01-14T10:26:00.433Z", "modified_at": "2022-07-14T18:23:27.528Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 152837, "maximum_amount": 635532, "preset_amount": 639387}, "discount": {"duration": "repeating", "type": "fixed", "amount": 68504, "currency": "Zloty", "created_at": "2023-07-13T19:57:33.016Z", "modified_at": "2023-11-26T18:23:24.264Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2022-03-01T20:22:54.911Z", "ends_at": "2023-02-08T01:09:52.088Z", "max_redemptions": 485729, "redemptions_count": 73227, "organization_id": ""}, "subscription": {"metadata": {"key": 370293, "key1": 212921, "key2": true}, "created_at": "2023-11-17T05:41:51.253Z", "modified_at": "2023-04-11T08:18:00.740Z", "id": "", "amount": 185394, "currency": "Cuban Peso", "recurring_interval": "month", "status": "incomplete", "current_period_start": "2024-01-09T15:39:01.722Z", "current_period_end": "2024-07-08T10:18:47.471Z", "cancel_at_period_end": true, "started_at": "2024-04-07T21:37:23.489Z", "ended_at": "2022-01-09T23:59:38.923Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "user_id": ""}}, {"created_at": "2023-06-19T05:46:32.685Z", "modified_at": "2024-04-03T18:06:02.533Z", "id": "", "metadata": {"key": "", "key1": 105170, "key2": 567608}, "amount": 100208, "tax_amount": 401228, "currency": "Malaysian Ringgit", "billing_reason": "subscription_create", "billing_address": {"country": "Ukraine"}, "customer_id": "", "product_id": "", "product_price_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "customer": {"created_at": "2024-04-01T19:36:12.946Z", "modified_at": "2024-08-10T12:40:39.409Z", "id": "", "metadata": {"key": "", "key1": ""}, "email": "Jena_Larson16@hotmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Haiti"}, "tax_id": ["", "do_rcn", "cr_tin"], "organization_id": "", "avatar_url": "https://utilized-quit.net/"}, "user_id": "", "user": {"id": "", "email": "Marty_Kshlerin84@hotmail.com", "public_name": ""}, "product": {"created_at": "2023-06-21T13:26:28.598Z", "modified_at": "2023-01-19T17:39:17.317Z", "id": "", "name": "", "description": "earth that early abseil", "is_recurring": false, "is_archived": true, "organization_id": ""}, "product_price": {"created_at": "2024-08-18T13:00:42.665Z", "modified_at": "2023-06-22T03:00:04.393Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 322596, "maximum_amount": 860596, "preset_amount": 18278}, "discount": {"duration": "forever", "duration_in_months": 913465, "type": "fixed", "basis_points": 75058, "created_at": "2024-09-10T04:30:13.188Z", "modified_at": "2022-05-29T14:05:29.727Z", "id": "", "metadata": {"key": 432930}, "name": "", "code": "", "starts_at": "2023-06-11T18:07:18.321Z", "ends_at": "2022-04-24T08:24:21.019Z", "max_redemptions": 523875, "redemptions_count": 841031, "organization_id": ""}, "subscription": {"metadata": {}, "created_at": "2023-04-28T12:09:29.137Z", "modified_at": "2023-03-31T01:03:36.657Z", "id": "", "amount": 253529, "currency": "Tugrik", "recurring_interval": "year", "status": "canceled", "current_period_start": "2022-06-16T22:11:32.719Z", "current_period_end": "2024-10-03T23:44:36.269Z", "cancel_at_period_end": false, "started_at": "2023-06-19T04:12:45.071Z", "ended_at": "2024-12-03T09:47:00.347Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "user_id": ""}}, {"created_at": "2022-09-13T06:39:19.968Z", "modified_at": "2022-01-21T07:06:12.853Z", "id": "", "metadata": {}, "amount": 621450, "tax_amount": 832756, "currency": "Hryvnia", "billing_reason": "subscription_update", "billing_address": {"country": "Iceland"}, "customer_id": "", "product_id": "", "product_price_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "customer": {"created_at": "2024-10-29T17:09:20.090Z", "modified_at": "2022-11-06T03:01:50.647Z", "id": "", "metadata": {"key": 863466}, "email": "Mollie.Sawayn@yahoo.com", "email_verified": false, "name": "", "billing_address": {"country": "Lebanon"}, "tax_id": ["us_ein", "ca_gst_hst"], "organization_id": "", "avatar_url": "https://obedient-plumber.org/"}, "user_id": "", "user": {"id": "", "email": "Anika_Hagenes@gmail.com", "public_name": ""}, "product": {"created_at": "2023-03-28T14:59:46.668Z", "modified_at": "2022-03-29T23:56:17.126Z", "id": "", "name": "", "description": "how though char while beneath while whoa piglet", "is_recurring": true, "is_archived": false, "organization_id": ""}, "product_price": {"created_at": "2022-05-05T09:08:16.530Z", "modified_at": "2022-07-18T12:08:53.113Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 33597, "maximum_amount": 628106, "preset_amount": 934960, "recurring_interval": "year"}, "discount": {"duration": "repeating", "type": "percentage", "amount": 838930, "currency": "Lilangeni", "created_at": "2024-12-27T15:09:02.427Z", "modified_at": "2022-03-31T02:45:39.610Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2022-03-23T01:47:30.770Z", "ends_at": "2024-07-06T02:51:23.749Z", "max_redemptions": 777245, "redemptions_count": 141764, "organization_id": ""}, "subscription": {"metadata": {}, "created_at": "2023-08-15T18:41:19.055Z", "modified_at": "2023-03-02T04:00:01.219Z", "id": "", "amount": 586154, "currency": "Dalasi", "recurring_interval": "year", "status": "past_due", "current_period_start": "2022-10-19T07:09:33.817Z", "current_period_end": "2022-10-01T20:49:37.013Z", "cancel_at_period_end": true, "started_at": "2024-03-08T08:44:16.186Z", "ended_at": "2022-05-07T21:01:22.996Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "user_id": ""}}], "pagination": {"total_count": 96811, "max_page": 35128}} + application/json: {"items": [{"created_at": "2024-08-22T19:26:20.850Z", "modified_at": "2025-01-13T10:26:00.433Z", "id": "", "metadata": {}, "status": "", "amount": 229716, "tax_amount": 152837, "refunded_amount": 635532, "refunded_tax_amount": 639387, "currency": "Lek", "billing_reason": "subscription_cycle", "billing_address": {"country": "Belgium"}, "customer_id": "", "product_id": "", "product_price_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "customer": {"created_at": "2023-03-17T01:57:00.187Z", "modified_at": "2025-01-24T00:05:25.844Z", "id": "", "metadata": {"key": 7468, "key1": ""}, "email": "Jeanette_Waters@yahoo.com", "email_verified": true, "name": "", "billing_address": {"country": "Gabon"}, "tax_id": ["", "hk_br", "ca_pst_bc"], "organization_id": "", "avatar_url": "https://unpleasant-chairperson.info/"}, "user_id": "", "user": {"id": "", "email": "Hope_Brakus@yahoo.com", "public_name": ""}, "product": {"created_at": "2025-08-04T08:35:41.482Z", "modified_at": "2023-12-03T21:35:05.453Z", "id": "", "name": "", "description": "er boom however when uh-huh madly", "is_recurring": false, "is_archived": false, "organization_id": ""}, "product_price": {"created_at": "2023-02-02T01:51:19.643Z", "modified_at": "2024-12-15T22:46:18.179Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 605070, "maximum_amount": 408066, "preset_amount": 41398}, "discount": {"duration": "once", "duration_in_months": 406391, "type": "fixed", "basis_points": 117386, "created_at": "2025-10-31T06:20:54.910Z", "modified_at": "2025-12-19T15:02:23.114Z", "id": "", "metadata": {"key": 457442}, "name": "", "code": "", "starts_at": "2023-08-22T08:40:22.005Z", "ends_at": "2025-09-14T09:33:23.636Z", "max_redemptions": 50388, "redemptions_count": 625217, "organization_id": ""}, "subscription": {"metadata": {"key": ""}, "created_at": "2023-08-16T08:48:23.679Z", "modified_at": "2023-08-31T18:02:52.360Z", "id": "", "amount": 123187, "currency": "Philippine Peso", "recurring_interval": "year", "status": "active", "current_period_start": "2025-04-07T21:37:23.489Z", "current_period_end": "2023-01-09T23:59:38.923Z", "cancel_at_period_end": true, "canceled_at": "2025-04-03T18:06:02.533Z", "started_at": "2025-04-03T17:06:12.891Z", "ends_at": "2023-11-01T03:58:06.965Z", "ended_at": "2024-08-27T04:17:07.015Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "customer_service", "customer_cancellation_comment": "", "user_id": ""}}, {"created_at": "2024-10-14T09:46:50.350Z", "modified_at": "2024-09-14T02:22:04.749Z", "id": "", "metadata": {}, "status": "", "amount": 401228, "tax_amount": 602487, "refunded_amount": 385327, "refunded_tax_amount": 933854, "currency": "Sudanese Pound", "billing_reason": "subscription_update", "billing_address": {"country": "Lebanon"}, "customer_id": "", "product_id": "", "product_price_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "customer": {"created_at": "2023-08-14T22:55:48.443Z", "modified_at": "2023-12-07T04:19:04.202Z", "id": "", "metadata": {"key": 838038, "key1": 774578}, "email": "Chris_Howell@gmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Nauru"}, "tax_id": [""], "organization_id": "", "avatar_url": "https://severe-shipper.org"}, "user_id": "", "user": {"id": "", "email": "Cameron_Ritchie@hotmail.com", "public_name": ""}, "product": {"created_at": "2024-01-19T17:39:17.317Z", "modified_at": "2023-07-28T12:54:58.990Z", "id": "", "name": "", "description": "failing orchestrate lest validity yuck until midst taxicab describe", "is_recurring": true, "is_archived": true, "organization_id": ""}, "product_price": {"created_at": "2025-08-19T10:34:27.488Z", "modified_at": "2025-04-21T05:31:02.040Z", "id": "", "is_archived": true, "product_id": ""}, "discount": {"duration": "once", "duration_in_months": 354965, "type": "percentage", "basis_points": 565282, "created_at": "2024-05-27T07:14:10.577Z", "modified_at": "2025-03-07T02:26:31.358Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2025-05-08T05:53:10.405Z", "ends_at": "2024-02-15T10:16:55.982Z", "max_redemptions": 859260, "redemptions_count": 496154, "organization_id": ""}, "subscription": {"metadata": {"key": 704478, "key1": false, "key2": true}, "created_at": "2024-04-22T16:13:21.235Z", "modified_at": "2024-09-10T11:54:14.319Z", "id": "", "amount": 684222, "currency": "Zambian Kwacha", "recurring_interval": "month", "status": "incomplete", "current_period_start": "2024-10-29T05:49:01.311Z", "current_period_end": "2023-12-07T09:46:44.632Z", "cancel_at_period_end": false, "canceled_at": "2024-01-30T05:46:03.648Z", "started_at": "2024-07-31T16:24:14.183Z", "ends_at": "2024-03-27T14:59:46.668Z", "ended_at": "2023-03-29T23:56:17.126Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "too_expensive", "customer_cancellation_comment": "", "user_id": ""}}, {"created_at": "2023-08-19T17:38:55.606Z", "modified_at": "2025-12-04T11:22:18.277Z", "id": "", "metadata": {"key": "", "key1": 314043, "key2": ""}, "status": "", "amount": 792775, "tax_amount": 421, "refunded_amount": 785481, "refunded_tax_amount": 327973, "currency": "Rupiah", "billing_reason": "purchase", "billing_address": {"country": "Niue"}, "customer_id": "", "product_id": "", "product_price_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "customer": {"created_at": "2024-10-05T17:09:46.559Z", "modified_at": "2023-05-22T12:31:34.361Z", "id": "", "metadata": {"key": 269946, "key1": "", "key2": ""}, "email": "Rolando.Bogan-Mayert89@hotmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Latvia"}, "tax_id": ["no_voec"], "organization_id": "", "avatar_url": "https://strict-distinction.org/"}, "user_id": "", "user": {"id": "", "email": "Aurelie_Tromp@gmail.com", "public_name": ""}, "product": {"created_at": "2024-02-13T03:45:06.616Z", "modified_at": "2025-05-14T04:10:51.679Z", "id": "", "name": "", "description": "ouch till round meaningfully oddly dishonor", "is_recurring": true, "is_archived": false, "organization_id": ""}, "product_price": {"created_at": "2023-02-08T12:01:40.965Z", "modified_at": "2023-11-28T08:17:13.465Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 107757, "recurring_interval": "year"}, "discount": {"duration": "repeating", "duration_in_months": 917801, "type": "percentage", "basis_points": 682370, "created_at": "2025-07-06T18:31:24.280Z", "modified_at": "2023-05-10T00:49:50.875Z", "id": "", "metadata": {"key": 270417}, "name": "", "code": "", "starts_at": "2025-02-15T04:47:55.629Z", "ends_at": "2023-08-25T01:38:35.053Z", "max_redemptions": 841910, "redemptions_count": 147047, "organization_id": ""}, "subscription": {"metadata": {"key": 710428}, "created_at": "2024-03-04T05:58:17.617Z", "modified_at": "2023-09-20T08:34:45.941Z", "id": "", "amount": 981370, "currency": "Kyat", "recurring_interval": "month", "status": "trialing", "current_period_start": "2025-07-14T03:52:58.280Z", "current_period_end": "2024-11-04T15:24:52.551Z", "cancel_at_period_end": true, "canceled_at": "2025-03-15T20:26:37.826Z", "started_at": "2024-07-31T05:59:43.279Z", "ends_at": "2023-10-03T06:38:24.300Z", "ended_at": "2023-08-10T06:23:08.124Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "too_expensive", "customer_cancellation_comment": "", "user_id": ""}}], "pagination": {"total_count": 64260, "max_page": 794717}} "422": application/json: {} orders:get: @@ -2079,7 +2164,7 @@ examples: id: "" responses: "200": - application/json: {"created_at": "2024-02-07T13:54:48.821Z", "modified_at": "2023-09-05T11:33:52.011Z", "id": "", "metadata": {"key": 969961, "key1": 450824}, "amount": 262795, "tax_amount": 213457, "currency": "CFA Franc BEAC", "billing_reason": "subscription_create", "billing_address": {"country": "Sierra Leone"}, "customer_id": "", "product_id": "", "product_price_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "customer": {"created_at": "2022-03-28T11:05:23.685Z", "modified_at": "2022-08-30T01:43:46.030Z", "id": "", "metadata": {"key": ""}, "email": "Rachael_Rogahn55@yahoo.com", "email_verified": true, "name": "", "billing_address": {"country": "Chile"}, "tax_id": [], "organization_id": "", "avatar_url": "https://fond-reconsideration.net"}, "user_id": "", "user": {"id": "", "email": "Sylvester_Bartoletti@hotmail.com", "public_name": ""}, "product": {"created_at": "2022-05-26T16:57:22.796Z", "modified_at": "2022-06-25T00:21:23.098Z", "id": "", "name": "", "description": "roundabout middle ha rise readily usefully raw", "is_recurring": true, "is_archived": true, "organization_id": ""}, "product_price": {"created_at": "2023-08-20T11:11:04.610Z", "modified_at": "2023-07-26T06:33:15.810Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 458049, "maximum_amount": 450824, "preset_amount": 262795}, "discount": {"duration": "repeating", "type": "fixed", "amount": 801373, "currency": "Taka", "created_at": "2022-08-30T01:43:46.030Z", "modified_at": "2022-12-10T13:21:20.945Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2023-08-29T15:06:35.685Z", "ends_at": "2024-06-02T05:45:06.910Z", "max_redemptions": 380699, "redemptions_count": 746585, "organization_id": ""}, "subscription": {"metadata": {"key": "", "key1": 73798, "key2": true}, "created_at": "2024-02-25T00:40:57.545Z", "modified_at": "2022-10-11T17:06:00.229Z", "id": "", "amount": 698722, "currency": "Malagasy Ariary", "recurring_interval": "year", "status": "trialing", "current_period_start": "2024-05-16T19:46:15.177Z", "current_period_end": "2022-03-02T09:16:28.575Z", "cancel_at_period_end": false, "started_at": "2024-07-27T18:59:52.807Z", "ended_at": "2022-12-27T04:21:17.306Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "user_id": ""}} + application/json: {"created_at": "2025-02-06T13:54:48.821Z", "modified_at": "2024-09-04T11:33:52.011Z", "id": "", "metadata": {"key": 969961, "key1": 450824}, "status": "", "amount": 262795, "tax_amount": 213457, "refunded_amount": 937146, "refunded_tax_amount": 438142, "currency": "Dobra", "billing_reason": "purchase", "billing_address": {"country": "Croatia"}, "customer_id": "", "product_id": "", "product_price_id": "", "discount_id": "", "subscription_id": "", "checkout_id": "", "customer": {"created_at": "2023-12-10T13:21:20.945Z", "modified_at": "2023-04-14T16:04:46.468Z", "id": "", "metadata": {"key": true, "key1": false}, "email": "Enid.Dare78@yahoo.com", "email_verified": false, "name": "", "billing_address": {"country": "Samoa"}, "tax_id": ["ec_ruc", ""], "organization_id": "", "avatar_url": "https://jumbo-hippodrome.com"}, "user_id": "", "user": {"id": "", "email": "Kathryn_Stoltenberg53@gmail.com", "public_name": ""}, "product": {"created_at": "2025-03-10T04:17:15.995Z", "modified_at": "2025-04-19T12:48:05.172Z", "id": "", "name": "", "description": "notwithstanding harangue once out effector determined", "is_recurring": true, "is_archived": true, "organization_id": ""}, "product_price": {"created_at": "2024-03-09T03:01:19.173Z", "modified_at": "2023-07-04T22:10:57.702Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "year"}, "discount": {"duration": "forever", "type": "percentage", "amount": 638700, "currency": "Barbados Dollar", "created_at": "2025-12-04T14:13:02.442Z", "modified_at": "2024-08-22T17:07:10.826Z", "id": "", "metadata": {"key": true, "key1": 844917, "key2": 576892}, "name": "", "code": "", "starts_at": "2025-07-16T00:03:53.405Z", "ends_at": "2024-01-20T11:46:53.929Z", "max_redemptions": 534384, "redemptions_count": 901064, "organization_id": ""}, "subscription": {"metadata": {"key": "", "key1": 73798, "key2": true}, "created_at": "2025-02-24T00:40:57.545Z", "modified_at": "2023-10-11T17:06:00.229Z", "id": "", "amount": 698722, "currency": "Malagasy Ariary", "recurring_interval": "year", "status": "trialing", "current_period_start": "2025-05-16T19:46:15.177Z", "current_period_end": "2023-03-02T09:16:28.575Z", "cancel_at_period_end": false, "canceled_at": "2025-07-27T18:59:52.807Z", "started_at": "2023-12-27T04:21:17.306Z", "ends_at": "2023-11-12T06:57:18.668Z", "ended_at": "2023-04-09T16:28:47.030Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "unused", "customer_cancellation_comment": "", "user_id": ""}} "404": application/json: {"detail": ""} "422": @@ -2096,13 +2181,37 @@ examples: application/json: {"detail": ""} "422": application/json: {} + refunds:list: + speakeasy-default-refunds:list: + parameters: + query: + page: 1 + limit: 10 + responses: + "200": + application/json: {"items": [{"created_at": "2024-08-22T19:26:20.850Z", "modified_at": "2025-01-13T10:26:00.433Z", "id": "", "metadata": {}, "status": "pending", "reason": "duplicate", "amount": 635532, "tax_amount": 639387, "currency": "Lek", "organization_id": "", "order_id": "", "subscription_id": "", "customer_id": "", "revoke_benefits": false}, {"created_at": "2023-04-05T09:49:38.010Z", "modified_at": "2023-03-17T01:57:00.187Z", "id": "", "metadata": {"key": 633911, "key1": ""}, "status": "pending", "reason": "customer_request", "amount": 485729, "tax_amount": 73227, "currency": "Tala", "organization_id": "", "order_id": "", "subscription_id": "", "customer_id": "", "revoke_benefits": false}, {"created_at": "2025-08-18T13:00:42.665Z", "modified_at": "2024-06-21T03:00:04.393Z", "id": "", "metadata": {}, "status": "succeeded", "reason": "other", "amount": 18278, "tax_amount": 897196, "currency": "Yen", "organization_id": "", "order_id": "", "subscription_id": "", "customer_id": "", "revoke_benefits": false}], "pagination": {"total_count": 173090, "max_page": 75058}} + "422": + application/json: {} + refunds:create: + speakeasy-default-refunds:create: + requestBody: + application/json: {"order_id": "", "reason": "customer_request", "amount": 638424, "revoke_benefits": false} + responses: + "200": + application/json: {"created_at": "2024-04-02T12:48:32.253Z", "modified_at": "2023-05-28T06:20:22.766Z", "id": "", "metadata": {}, "status": "canceled", "reason": "other", "amount": 86, "tax_amount": 169727, "currency": "Bulgarian Lev", "organization_id": "", "order_id": "", "subscription_id": "", "customer_id": "", "revoke_benefits": false} + "400": + application/json: {"detail": ""} + "403": + application/json: {"detail": ""} + "422": + application/json: {} checkouts:create: speakeasy-default-checkouts:create: requestBody: application/json: {"product_price_id": "", "success_url": "https://probable-heating.com/"} responses: "201": - application/json: {"id": "", "customer_email": "", "customer_name": "", "product": {"created_at": "2022-03-17T15:39:20.911Z", "modified_at": "2024-05-22T22:27:14.379Z", "id": "", "name": "", "description": "resolve barracks approximate though championship kookily attend alongside aw blend", "is_recurring": false, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2023-04-03T12:48:32.253Z", "modified_at": "2022-05-28T06:20:22.766Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 796474, "maximum_amount": 951062, "preset_amount": 86, "recurring_interval": "month"}, {"created_at": "2024-06-13T23:30:51.782Z", "modified_at": "2023-10-05T11:56:21.731Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "year"}], "benefits": [{"created_at": "2024-03-09T19:18:20.415Z", "modified_at": "2024-05-27T15:09:35.417Z", "id": "", "type": "custom", "description": "than rightfully brightly sleet where schedule insolence", "selectable": false, "deletable": true, "organization_id": ""}, {"created_at": "2022-10-10T12:11:05.217Z", "modified_at": "2024-12-13T05:18:01.829Z", "id": "", "type": "discord", "description": "obligation elliptical ick", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/usr/src", "mime_type": "", "size": 199311, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-09-12T01:54:42.561Z", "version": "", "is_uploaded": false, "created_at": "2024-03-28T10:54:13.192Z", "size_readable": "", "public_url": "https://blank-manner.org/"}, {"id": "", "organization_id": "", "name": "", "path": "/var", "mime_type": "", "size": 475786, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-02-02T04:08:07.069Z", "version": "", "is_uploaded": true, "created_at": "2022-10-14T21:15:17.585Z", "size_readable": "", "public_url": "https://impolite-dish.biz"}, {"id": "", "organization_id": "", "name": "", "path": "/private", "mime_type": "", "size": 149413, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-03-26T05:20:06.588Z", "version": "", "is_uploaded": false, "created_at": "2024-02-10T15:32:31.554Z", "size_readable": "", "public_url": "https://mild-switchboard.info/"}]}, "product_price": {"created_at": "2022-01-20T11:09:16.789Z", "modified_at": "2022-09-10T10:08:53.440Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 64738, "recurring_interval": "month"}} + application/json: {"id": "", "customer_email": "", "customer_name": "", "product": {"created_at": "2023-03-17T15:39:20.911Z", "modified_at": "2025-05-22T22:27:14.379Z", "id": "", "name": "", "description": "resolve barracks approximate though championship kookily attend alongside aw blend", "is_recurring": false, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2024-04-19T19:31:49.649Z", "modified_at": "2025-02-19T14:03:40.154Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 823683, "recurring_interval": "month"}, {"created_at": "2024-10-28T18:55:39.709Z", "modified_at": "2023-10-25T02:31:52.809Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 609755}], "benefits": [{"created_at": "2025-03-09T19:18:20.415Z", "modified_at": "2025-05-27T15:09:35.417Z", "id": "", "type": "custom", "description": "than rightfully brightly sleet where schedule insolence", "selectable": false, "deletable": true, "organization_id": ""}, {"created_at": "2023-10-10T12:11:05.217Z", "modified_at": "2025-12-13T05:18:01.829Z", "id": "", "type": "discord", "description": "obligation elliptical ick", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/usr/src", "mime_type": "", "size": 199311, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-09-11T01:54:42.561Z", "version": "", "is_uploaded": false, "created_at": "2025-03-28T10:54:13.192Z", "size_readable": "", "public_url": "https://blank-manner.org/"}, {"id": "", "organization_id": "", "name": "", "path": "/var", "mime_type": "", "size": 475786, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-02-01T04:08:07.069Z", "version": "", "is_uploaded": true, "created_at": "2023-10-14T21:15:17.585Z", "size_readable": "", "public_url": "https://impolite-dish.biz"}, {"id": "", "organization_id": "", "name": "", "path": "/private", "mime_type": "", "size": 149413, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-03-25T05:20:06.588Z", "version": "", "is_uploaded": false, "created_at": "2025-02-09T15:32:31.554Z", "size_readable": "", "public_url": "https://mild-switchboard.info/"}]}, "product_price": {"created_at": "2025-09-17T13:33:11.923Z", "modified_at": "2024-09-03T11:39:39.566Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "year"}} "422": application/json: {} checkouts:get: @@ -2112,23 +2221,27 @@ examples: id: "" responses: "200": - application/json: {"id": "", "customer_email": "", "customer_name": "", "product": {"created_at": "2024-02-07T13:54:48.821Z", "modified_at": "2023-09-05T11:33:52.011Z", "id": "", "name": "", "description": "tune only fellow scary but embarrassment metabolise", "is_recurring": false, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2023-08-20T11:11:04.610Z", "modified_at": "2023-07-26T06:33:15.810Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 458049, "maximum_amount": 450824, "preset_amount": 262795}, {"created_at": "2023-04-26T04:53:50.189Z", "modified_at": "2024-05-28T07:17:57.134Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "month"}], "benefits": [{"created_at": "2024-11-07T20:31:03.453Z", "modified_at": "2023-06-18T09:19:42.888Z", "id": "", "type": "custom", "description": "unless scholarship ick", "selectable": true, "deletable": true, "organization_id": ""}, {"created_at": "2022-03-05T14:01:26.927Z", "modified_at": "2023-08-22T23:59:38.589Z", "id": "", "type": "custom", "description": "wash fork whose helpful calmly council", "selectable": true, "deletable": true, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/dev", "mime_type": "", "size": 363455, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-11-12T10:51:39.493Z", "version": "", "is_uploaded": false, "created_at": "2024-06-10T14:56:30.468Z", "size_readable": "", "public_url": "https://violent-hyphenation.info/"}, {"id": "", "organization_id": "", "name": "", "path": "/var/spool", "mime_type": "", "size": 362683, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-04-16T15:25:27.950Z", "version": "", "is_uploaded": true, "created_at": "2023-11-10T06:42:52.951Z", "size_readable": "", "public_url": "https://descriptive-giggle.biz"}]}, "product_price": {"created_at": "2023-08-29T15:06:35.685Z", "modified_at": "2024-06-02T05:45:06.910Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 746585, "recurring_interval": "year"}} + application/json: {"id": "", "customer_email": "", "customer_name": "", "product": {"created_at": "2025-02-06T13:54:48.821Z", "modified_at": "2024-09-04T11:33:52.011Z", "id": "", "name": "", "description": "tune only fellow scary but embarrassment metabolise", "is_recurring": false, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2025-03-05T14:23:34.462Z", "modified_at": "2024-05-14T03:28:18.685Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 716006, "maximum_amount": 392574, "preset_amount": 908293}, {"created_at": "2024-03-31T04:11:43.083Z", "modified_at": "2023-06-13T10:08:35.363Z", "id": "", "is_archived": false, "product_id": ""}], "benefits": [{"created_at": "2025-11-07T20:31:03.453Z", "modified_at": "2024-06-17T09:19:42.888Z", "id": "", "type": "custom", "description": "unless scholarship ick", "selectable": true, "deletable": true, "organization_id": ""}, {"created_at": "2023-03-05T14:01:26.927Z", "modified_at": "2024-08-21T23:59:38.589Z", "id": "", "type": "custom", "description": "wash fork whose helpful calmly council", "selectable": true, "deletable": true, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/dev", "mime_type": "", "size": 363455, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-11-12T10:51:39.493Z", "version": "", "is_uploaded": false, "created_at": "2025-06-10T14:56:30.468Z", "size_readable": "", "public_url": "https://violent-hyphenation.info/"}, {"id": "", "organization_id": "", "name": "", "path": "/var/spool", "mime_type": "", "size": 362683, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-04-16T15:25:27.950Z", "version": "", "is_uploaded": true, "created_at": "2024-11-09T06:42:52.951Z", "size_readable": "", "public_url": "https://descriptive-giggle.biz"}]}, "product_price": {"created_at": "2025-10-18T08:53:06.113Z", "modified_at": "2023-11-20T17:50:58.298Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 22258}} "422": application/json: {} checkouts:custom:list: speakeasy-default-checkouts:custom:list: + parameters: + query: + page: 1 + limit: 10 responses: "200": - application/json: {"items": [{"created_at": "2023-08-23T19:26:20.850Z", "modified_at": "2024-01-14T10:26:00.433Z", "id": "", "status": "open", "client_secret": "", "url": "https://crooked-overload.name/", "expires_at": "2022-01-20T06:21:22.156Z", "success_url": "https://breakable-bathrobe.net", "embed_origin": "", "amount": 509883, "tax_amount": 633911, "currency": "Afghani", "subtotal_amount": 54607, "total_amount": 367745, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": true, "is_discount_applicable": true, "is_free_product_price": false, "is_payment_required": false, "is_payment_setup_required": false, "is_payment_form_required": true, "customer_id": "", "customer_name": "", "customer_email": "Enid42@gmail.com", "customer_ip_address": "", "customer_billing_address": {"country": "Chad"}, "customer_tax_id": "", "metadata": {}, "product": {"created_at": "2024-09-10T04:30:13.188Z", "modified_at": "2022-05-29T14:05:29.727Z", "id": "", "name": "", "description": "aha although gosh whenever as plastic", "is_recurring": true, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2024-01-14T10:26:00.433Z", "modified_at": "2022-07-14T18:23:27.528Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 152837, "maximum_amount": 635532, "preset_amount": 639387}, {"created_at": "2022-04-05T09:49:38.010Z", "modified_at": "2022-03-17T01:57:00.187Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "year"}, {"created_at": "2022-03-01T20:22:54.911Z", "modified_at": "2023-02-08T01:09:52.088Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 73227}], "benefits": [{"created_at": "2024-12-19T15:02:23.114Z", "modified_at": "2023-04-09T13:05:11.917Z", "id": "", "type": "discord", "description": "fooey a supposing regarding times uselessly", "selectable": true, "deletable": false, "organization_id": ""}, {"created_at": "2022-12-12T02:49:50.316Z", "modified_at": "2023-11-13T05:16:04.525Z", "id": "", "type": "ads", "description": "merrily wherever failing orchestrate lest", "selectable": false, "deletable": true, "organization_id": ""}, {"created_at": "2023-12-12T21:57:01.257Z", "modified_at": "2023-03-24T19:09:17.797Z", "id": "", "type": "ads", "description": "noisily consequently husband", "selectable": false, "deletable": true, "organization_id": ""}], "medias": []}, "product_price": {"created_at": "2024-08-18T13:00:42.665Z", "modified_at": "2023-06-22T03:00:04.393Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 322596, "maximum_amount": 860596, "preset_amount": 18278}, "discount": {"duration": "repeating", "duration_in_months": 232917, "type": "fixed", "amount": 197777, "currency": "Cordoba Oro", "id": "", "name": "", "code": ""}, "subscription_id": "", "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2023-04-11T02:32:42.816Z", "modified_at": "2024-09-28T03:47:03.515Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": ""}, "order": 726370, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2024-09-10T04:30:13.188Z", "modified_at": "2022-05-29T14:05:29.727Z", "id": "", "metadata": {"key": 432930}, "slug": "", "name": "", "organization_id": ""}, "order": 800413, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2022-04-24T08:24:21.019Z", "modified_at": "2023-07-29T04:00:22.486Z", "id": "", "metadata": {"key": 863466, "key1": "", "key2": 113486}, "slug": "", "name": "", "organization_id": ""}, "order": 608798, "required": true}], "customer_metadata": {"key": 527084, "key1": 80289, "key2": true}}, {"created_at": "2024-12-04T11:22:18.277Z", "modified_at": "2024-10-13T14:46:57.561Z", "id": "", "status": "expired", "client_secret": "", "url": "https://gifted-dress.net/", "expires_at": "2022-01-01T11:05:05.995Z", "success_url": "https://good-natured-fundraising.com", "embed_origin": "", "amount": 651266, "tax_amount": 587331, "currency": "Brazilian Real", "subtotal_amount": 779761, "total_amount": 446559, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": true, "is_discount_applicable": true, "is_free_product_price": true, "is_payment_required": false, "is_payment_setup_required": false, "is_payment_form_required": false, "customer_id": "", "customer_name": "", "customer_email": "Kolby.Trantow@gmail.com", "customer_ip_address": "", "customer_billing_address": {"country": "Kazakhstan"}, "customer_tax_id": "", "metadata": {"key": true, "key1": true}, "product": {"created_at": "2024-07-29T15:14:26.705Z", "modified_at": "2022-02-27T11:29:27.249Z", "id": "", "name": "", "description": "ack solicit weakly", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2022-02-06T19:44:52.353Z", "modified_at": "2023-11-20T09:41:40.649Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "year"}], "benefits": [{"created_at": "2022-05-02T01:47:04.536Z", "modified_at": "2023-11-16T04:09:28.193Z", "id": "", "type": "license_keys", "description": "but favorite beneath", "selectable": false, "deletable": true, "organization_id": ""}, {"created_at": "2024-09-02T23:08:00.186Z", "modified_at": "2024-10-28T04:58:58.509Z", "id": "", "type": "downloadables", "description": "how until to onto ouch shrilly ramp ethical busily archaeology", "selectable": true, "deletable": false, "organization_id": ""}, {"created_at": "2022-02-25T17:28:41.442Z", "modified_at": "2023-12-19T20:11:41.014Z", "id": "", "type": "ads", "description": "except following ick verbally drat pillow", "selectable": false, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/usr/ports", "mime_type": "", "size": 850053, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-01-08T04:08:08.901Z", "version": "", "is_uploaded": true, "created_at": "2024-06-16T08:19:05.026Z", "size_readable": "", "public_url": "https://that-plumber.org"}, {"id": "", "organization_id": "", "name": "", "path": "/rescue", "mime_type": "", "size": 915295, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-05-28T03:27:06.201Z", "version": "", "is_uploaded": false, "created_at": "2024-11-28T05:50:05.391Z", "size_readable": "", "public_url": "https://interesting-baseboard.biz"}, {"id": "", "organization_id": "", "name": "", "path": "/usr/X11R6", "mime_type": "", "size": 113341, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-06-03T17:02:41.566Z", "version": "", "is_uploaded": true, "created_at": "2023-10-07T22:24:47.498Z", "size_readable": "", "public_url": "https://skeletal-commercial.net"}]}, "product_price": {"created_at": "2023-09-15T04:48:08.824Z", "modified_at": "2024-07-08T11:13:00.198Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "year"}, "discount": {"duration": "repeating", "type": "percentage", "basis_points": 526858, "id": "", "name": "", "code": ""}, "subscription_id": "", "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2022-06-30T19:14:35.502Z", "modified_at": "2022-03-23T01:47:30.770Z", "id": "", "metadata": {"key": true, "key1": 284580, "key2": false}, "slug": "", "name": "", "organization_id": ""}, "order": 898170, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2022-03-08T17:05:22.411Z", "modified_at": "2022-11-19T07:34:10.466Z", "id": "", "metadata": {"key": true, "key1": "", "key2": ""}, "slug": "", "name": "", "organization_id": ""}, "order": 341163, "required": true}], "customer_metadata": {"key": "", "key1": true}}, {"created_at": "2023-07-14T16:13:57.819Z", "modified_at": "2023-12-21T01:52:19.079Z", "id": "", "status": "open", "client_secret": "", "url": "https://vague-interviewer.org", "expires_at": "2023-02-10T18:58:34.440Z", "success_url": "https://total-scorn.name", "embed_origin": "", "amount": 178449, "tax_amount": 215623, "currency": "Brazilian Real", "subtotal_amount": 140546, "total_amount": 27174, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": false, "is_discount_applicable": false, "is_free_product_price": true, "is_payment_required": true, "is_payment_setup_required": true, "is_payment_form_required": true, "customer_id": "", "customer_name": "", "customer_email": "Brian.Weber-Koss69@hotmail.com", "customer_ip_address": "", "customer_billing_address": {"country": "Burkina Faso"}, "customer_tax_id": "", "metadata": {}, "product": {"created_at": "2022-05-18T17:09:07.291Z", "modified_at": "2022-03-30T23:41:35.059Z", "id": "", "name": "", "description": "what parade kissingly squirm", "is_recurring": true, "is_archived": true, "organization_id": "", "prices": [], "benefits": [{"created_at": "2023-11-27T05:32:47.450Z", "modified_at": "2024-03-10T17:56:58.626Z", "id": "", "type": "custom", "description": "rightfully finally a wobbly knowledgeably", "selectable": false, "deletable": true, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/bin", "mime_type": "", "size": 281738, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-02-04T14:30:50.543Z", "version": "", "is_uploaded": true, "created_at": "2022-04-08T00:58:31.890Z", "size_readable": "", "public_url": "https://calculating-convection.biz"}, {"id": "", "organization_id": "", "name": "", "path": "/Network", "mime_type": "", "size": 9268, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-07-15T11:04:28.100Z", "version": "", "is_uploaded": false, "created_at": "2022-11-17T08:00:09.886Z", "size_readable": "", "public_url": "https://gullible-submitter.com"}]}, "product_price": {"created_at": "2024-11-14T19:49:34.065Z", "modified_at": "2024-05-02T01:42:40.060Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "year"}, "discount": {"duration": "once", "duration_in_months": 276174, "type": "fixed", "amount": 946235, "currency": "North Korean Won", "id": "", "name": "", "code": ""}, "subscription_id": "", "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2022-01-23T14:15:37.576Z", "modified_at": "2023-05-28T16:21:14.723Z", "id": "", "metadata": {"key": false, "key1": 29267, "key2": 688784}, "slug": "", "name": "", "organization_id": ""}, "order": 700765, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2023-03-24T05:46:37.955Z", "modified_at": "2022-02-15T08:57:09.959Z", "id": "", "metadata": {"key": "", "key1": 79169, "key2": ""}, "slug": "", "name": "", "organization_id": "", "properties": {"options": [{"value": "", "label": ""}, {"value": "", "label": ""}, {"value": "", "label": ""}]}}, "order": 663136, "required": true}], "customer_metadata": {"key": ""}}], "pagination": {"total_count": 289576, "max_page": 3852}} + application/json: {"items": [{"created_at": "2024-08-22T19:26:20.850Z", "modified_at": "2025-01-13T10:26:00.433Z", "id": "", "payment_processor": "stripe", "status": "open", "client_secret": "", "url": "https://crooked-overload.name/", "expires_at": "2023-01-20T06:21:22.156Z", "success_url": "https://breakable-bathrobe.net", "embed_origin": "", "amount": 509883, "tax_amount": 633911, "currency": "Afghani", "subtotal_amount": 54607, "total_amount": 367745, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": true, "is_discount_applicable": true, "is_free_product_price": false, "is_payment_required": false, "is_payment_setup_required": false, "is_payment_form_required": true, "customer_id": "", "customer_name": "", "customer_email": "", "customer_ip_address": "", "customer_billing_address": {"country": "Aruba"}, "customer_tax_id": "", "payment_processor_metadata": {"key": ""}, "metadata": {"key": "", "key1": true, "key2": true}, "product": {"created_at": "2023-03-24T06:20:14.879Z", "modified_at": "2025-09-10T04:30:13.188Z", "id": "", "name": "", "description": "sprinkles er since truly", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2024-08-19T22:29:27.736Z", "modified_at": "2023-03-15T10:11:56.132Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "month"}, {"created_at": "2023-10-11T19:17:33.283Z", "modified_at": "2023-12-22T07:54:29.563Z", "id": "", "is_archived": true, "product_id": ""}], "benefits": [{"created_at": "2024-05-03T10:59:46.313Z", "modified_at": "2023-01-06T17:33:20.863Z", "id": "", "type": "downloadables", "description": "yesterday eek censor tenement commonly softly boo massive sorrowful aw", "selectable": true, "deletable": false, "organization_id": ""}, {"created_at": "2023-11-17T06:46:18.694Z", "modified_at": "2023-10-09T03:58:07.827Z", "id": "", "type": "license_keys", "description": "steeple overheard swerve than bicycle twine huzzah obnoxiously", "selectable": true, "deletable": true, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/opt/share", "mime_type": "", "size": 561143, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-08-16T15:42:00.686Z", "version": "", "is_uploaded": true, "created_at": "2024-04-27T12:09:29.137Z", "size_readable": "", "public_url": "https://fair-marketplace.org/"}, {"id": "", "organization_id": "", "name": "", "path": "/usr/local/src", "mime_type": "", "size": 152303, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-10-03T23:44:36.269Z", "version": "", "is_uploaded": false, "created_at": "2024-06-18T04:12:45.071Z", "size_readable": "", "public_url": "https://entire-affiliate.biz"}, {"id": "", "organization_id": "", "name": "", "path": "/System", "mime_type": "", "size": 832756, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-08-19T10:34:27.488Z", "version": "", "is_uploaded": false, "created_at": "2024-03-28T11:42:09.368Z", "size_readable": "", "public_url": "https://flustered-forgery.net"}]}, "product_price": {"created_at": "2025-03-07T02:26:31.358Z", "modified_at": "2023-06-21T02:05:32.746Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 374478, "maximum_amount": 859260, "preset_amount": 496154}, "discount": {"duration": "forever", "duration_in_months": 704478, "type": "percentage", "basis_points": 938369, "id": "", "name": "", "code": ""}, "subscription_id": "", "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2024-04-22T16:13:21.235Z", "modified_at": "2024-09-10T11:54:14.319Z", "id": "", "metadata": {"key": true, "key1": ""}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 608798, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2024-01-30T05:46:03.648Z", "modified_at": "2024-07-31T16:24:14.183Z", "id": "", "metadata": {"key": ""}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 694688, "required": true}], "customer_metadata": {"key": true, "key1": 314043, "key2": ""}}, {"created_at": "2025-05-18T21:08:27.359Z", "modified_at": "2023-01-01T11:05:05.995Z", "id": "", "payment_processor": "stripe", "status": "succeeded", "client_secret": "", "url": "https://hoarse-baseboard.name/", "expires_at": "2024-10-05T17:09:46.559Z", "success_url": "https://sparkling-hydrolyze.biz/", "embed_origin": "", "amount": 211832, "tax_amount": 119137, "currency": "Manat", "subtotal_amount": 839722, "total_amount": 968727, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": true, "is_discount_applicable": false, "is_free_product_price": true, "is_payment_required": false, "is_payment_setup_required": true, "is_payment_form_required": true, "customer_id": "", "customer_name": "", "customer_email": "", "customer_ip_address": "", "customer_billing_address": {"country": "Latvia"}, "customer_tax_id": "", "payment_processor_metadata": {"key": ""}, "metadata": {"key": true, "key1": true}, "product": {"created_at": "2025-07-29T15:14:26.705Z", "modified_at": "2023-02-27T11:29:27.249Z", "id": "", "name": "", "description": "ack solicit weakly", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2023-02-04T16:53:23.272Z", "modified_at": "2025-05-09T13:20:09.208Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "year"}], "benefits": [{"created_at": "2023-05-02T01:47:04.536Z", "modified_at": "2024-11-15T04:09:28.193Z", "id": "", "type": "license_keys", "description": "but favorite beneath", "selectable": false, "deletable": true, "organization_id": ""}, {"created_at": "2025-09-02T23:08:00.186Z", "modified_at": "2025-10-28T04:58:58.509Z", "id": "", "type": "downloadables", "description": "how until to onto ouch shrilly ramp ethical busily archaeology", "selectable": true, "deletable": false, "organization_id": ""}, {"created_at": "2023-02-25T17:28:41.442Z", "modified_at": "2024-12-18T20:11:41.014Z", "id": "", "type": "ads", "description": "except following ick verbally drat pillow", "selectable": false, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/usr/ports", "mime_type": "", "size": 850053, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-01-07T04:08:08.901Z", "version": "", "is_uploaded": true, "created_at": "2025-06-16T08:19:05.026Z", "size_readable": "", "public_url": "https://that-plumber.org"}, {"id": "", "organization_id": "", "name": "", "path": "/rescue", "mime_type": "", "size": 915295, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-05-28T03:27:06.201Z", "version": "", "is_uploaded": false, "created_at": "2025-11-28T05:50:05.391Z", "size_readable": "", "public_url": "https://interesting-baseboard.biz"}, {"id": "", "organization_id": "", "name": "", "path": "/usr/X11R6", "mime_type": "", "size": 113341, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-06-02T17:02:41.566Z", "version": "", "is_uploaded": true, "created_at": "2024-10-06T22:24:47.498Z", "size_readable": "", "public_url": "https://skeletal-commercial.net"}]}, "product_price": {"created_at": "2024-04-30T20:59:40.436Z", "modified_at": "2025-12-21T09:31:52.337Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 552172, "maximum_amount": 206795, "preset_amount": 257426, "recurring_interval": "month"}, "discount": {"duration": "repeating", "type": "percentage", "basis_points": 526858, "id": "", "name": "", "code": ""}, "subscription_id": "", "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2024-08-31T03:57:12.777Z", "modified_at": "2025-03-30T11:09:26.643Z", "id": "", "metadata": {"key": true, "key1": 351638}, "slug": "", "name": "", "organization_id": "", "properties": {"options": []}}, "order": 898170, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2025-03-05T15:08:11.722Z", "modified_at": "2024-01-09T06:57:27.306Z", "id": "", "metadata": {"key": true, "key1": 239463, "key2": true}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 341163, "required": true}], "customer_metadata": {"key": "", "key1": false}}, {"created_at": "2024-07-13T16:13:57.819Z", "modified_at": "2024-12-20T01:52:19.079Z", "id": "", "payment_processor": "stripe", "status": "open", "client_secret": "", "url": "https://vague-interviewer.org", "expires_at": "2024-02-10T18:58:34.440Z", "success_url": "https://total-scorn.name", "embed_origin": "", "amount": 178449, "tax_amount": 215623, "currency": "Brazilian Real", "subtotal_amount": 140546, "total_amount": 27174, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": false, "is_discount_applicable": false, "is_free_product_price": true, "is_payment_required": true, "is_payment_setup_required": true, "is_payment_form_required": true, "customer_id": "", "customer_name": "", "customer_email": "", "customer_ip_address": "", "customer_billing_address": {"country": "Uganda"}, "customer_tax_id": "", "payment_processor_metadata": {}, "metadata": {"key": true, "key1": "", "key2": true}, "product": {"created_at": "2023-06-06T23:34:06.957Z", "modified_at": "2023-09-03T07:41:45.532Z", "id": "", "name": "", "description": "opposite buck shocked unto", "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2024-01-31T21:47:42.410Z", "modified_at": "2024-11-26T05:32:47.450Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 73215, "recurring_interval": "month"}], "benefits": [], "medias": []}, "product_price": {"created_at": "2025-01-21T04:22:35.280Z", "modified_at": "2023-10-20T16:40:10.867Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 510593}, "discount": {"duration": "repeating", "duration_in_months": 256905, "type": "fixed", "basis_points": 539479, "id": "", "name": "", "code": ""}, "subscription_id": "", "attached_custom_fields": [], "customer_metadata": {"key": ""}}], "pagination": {"total_count": 633451, "max_page": 50745}} "422": application/json: {} checkouts:custom:create: speakeasy-default-checkouts:custom:create: requestBody: - application/json: {"product_id": ""} + application/json: {"allow_discount_codes": true, "product_id": ""} responses: "201": - application/json: {"created_at": "2023-12-01T17:06:07.804Z", "modified_at": "2023-04-03T12:48:32.253Z", "id": "", "status": "open", "client_secret": "", "url": "https://standard-utilization.com/", "expires_at": "2022-07-06T00:30:20.403Z", "success_url": "https://stable-skean.name/", "embed_origin": "", "amount": 752438, "tax_amount": 957409, "currency": "Gourde", "subtotal_amount": 259629, "total_amount": 17759, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": true, "is_discount_applicable": true, "is_free_product_price": true, "is_payment_required": true, "is_payment_setup_required": true, "is_payment_form_required": true, "customer_id": "", "customer_name": "", "customer_email": "Mack_Bashirian65@gmail.com", "customer_ip_address": "", "customer_billing_address": {"country": "Algeria"}, "customer_tax_id": "", "metadata": {"key": "", "key1": 550483}, "product": {"created_at": "2024-09-20T13:32:39.611Z", "modified_at": "2023-05-11T15:17:37.707Z", "id": "", "name": "", "description": "round major misjudge yuck forager beneath", "is_recurring": true, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2022-05-28T06:20:22.766Z", "modified_at": "2022-03-17T15:39:20.911Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 951062, "maximum_amount": 86, "preset_amount": 169727}, {"created_at": "2024-06-13T23:30:51.782Z", "modified_at": "2023-10-05T11:56:21.731Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "year"}], "benefits": [{"created_at": "2022-05-10T01:13:36.523Z", "modified_at": "2023-10-09T10:25:33.125Z", "id": "", "type": "license_keys", "description": "simple ouch when pfft ah", "selectable": false, "deletable": true, "organization_id": ""}, {"created_at": "2023-03-21T10:12:21.713Z", "modified_at": "2023-11-21T10:52:58.426Z", "id": "", "type": "downloadables", "description": "victoriously consequently apud to per", "selectable": false, "deletable": false, "organization_id": ""}, {"created_at": "2022-08-07T10:40:26.624Z", "modified_at": "2023-09-12T01:54:42.561Z", "id": "", "type": "github_repository", "description": "scarcely ignorance pish rural determined shush than expensive", "selectable": false, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/mnt", "mime_type": "", "size": 330292, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-10-10T08:21:56.833Z", "version": "", "is_uploaded": false, "created_at": "2022-11-10T16:34:38.355Z", "size_readable": "", "public_url": "https://blushing-equal.net/"}, {"id": "", "organization_id": "", "name": "", "path": "/etc/defaults", "mime_type": "", "size": 226826, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-08-16T05:49:46.698Z", "version": "", "is_uploaded": false, "created_at": "2022-04-14T11:26:41.291Z", "size_readable": "", "public_url": "https://bustling-resolve.net/"}]}, "product_price": {"created_at": "2022-01-20T11:09:16.789Z", "modified_at": "2022-09-10T10:08:53.440Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 64738, "recurring_interval": "month"}, "discount": {"duration": "repeating", "duration_in_months": 70396, "type": "fixed", "amount": 961628, "currency": "Guarani", "id": "", "name": "", "code": ""}, "subscription_id": "", "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2022-03-22T23:50:34.661Z", "modified_at": "2022-04-21T15:49:25.047Z", "id": "", "metadata": {"key": 36521, "key1": 650237}, "slug": "", "name": "", "organization_id": ""}, "order": 473588, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2022-01-18T01:06:03.366Z", "modified_at": "2023-07-28T18:44:31.482Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": ""}, "order": 288002, "required": false}], "customer_metadata": {"key": 550483}} + application/json: {"created_at": "2024-11-30T17:06:07.804Z", "modified_at": "2024-04-02T12:48:32.253Z", "id": "", "payment_processor": "stripe", "status": "open", "client_secret": "", "url": "https://standard-utilization.com/", "expires_at": "2023-07-06T00:30:20.403Z", "success_url": "https://stable-skean.name/", "embed_origin": "", "amount": 752438, "tax_amount": 957409, "currency": "Gourde", "subtotal_amount": 259629, "total_amount": 17759, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": true, "is_discount_applicable": true, "is_free_product_price": true, "is_payment_required": true, "is_payment_setup_required": true, "is_payment_form_required": true, "customer_id": "", "customer_name": "", "customer_email": "", "customer_ip_address": "", "customer_billing_address": {"country": "Bhutan"}, "customer_tax_id": "", "payment_processor_metadata": {"key": "", "key1": ""}, "metadata": {"key": ""}, "product": {"created_at": "2024-11-12T07:30:44.053Z", "modified_at": "2024-12-13T15:50:02.770Z", "id": "", "name": "", "description": "igloo scaffold junior modulo", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2025-06-10T11:35:34.629Z", "modified_at": "2025-09-01T12:33:12.040Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 911742, "recurring_interval": "year"}], "benefits": [{"created_at": "2023-01-19T20:37:54.951Z", "modified_at": "2023-08-06T04:47:29.777Z", "id": "", "type": "license_keys", "description": "beneath please shadowy foodstuffs welcome", "selectable": true, "deletable": true, "organization_id": ""}, {"created_at": "2025-01-14T16:05:16.685Z", "modified_at": "2025-05-17T00:17:31.738Z", "id": "", "type": "downloadables", "description": "yahoo until planula conceal pfft partially till distant zowie nasalise", "selectable": false, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/usr/X11R6", "mime_type": "", "size": 324689, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-10-14T21:15:17.585Z", "version": "", "is_uploaded": false, "created_at": "2024-03-14T20:42:47.633Z", "size_readable": "", "public_url": "https://energetic-ignorance.com/"}]}, "product_price": {"created_at": "2025-02-09T15:32:31.554Z", "modified_at": "2023-02-05T10:25:17.663Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 884414, "maximum_amount": 339267, "preset_amount": 312813, "recurring_interval": "year"}, "discount": {"duration": "forever", "duration_in_months": 643654, "type": "percentage", "basis_points": 770948, "id": "", "name": "", "code": ""}, "subscription_id": "", "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2024-11-11T04:28:11.943Z", "modified_at": "2024-08-21T15:40:14.572Z", "id": "", "metadata": {"key": "", "key1": 37271}, "slug": "", "name": "", "organization_id": "", "properties": {"options": [{"value": "", "label": ""}]}}, "order": 520116, "required": true}], "customer_metadata": {"key": false, "key1": false, "key2": ""}} "422": application/json: {} checkouts:custom:get: @@ -2138,7 +2251,7 @@ examples: id: "" responses: "200": - application/json: {"created_at": "2024-02-07T13:54:48.821Z", "modified_at": "2023-09-05T11:33:52.011Z", "id": "", "status": "confirmed", "client_secret": "", "url": "https://willing-impostor.info", "expires_at": "2022-10-16T00:34:27.106Z", "success_url": "https://warm-hundred.net/", "embed_origin": "", "amount": 78888, "tax_amount": 219956, "currency": "Dalasi", "subtotal_amount": 94589, "total_amount": 552582, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": false, "is_discount_applicable": true, "is_free_product_price": false, "is_payment_required": false, "is_payment_setup_required": false, "is_payment_form_required": true, "customer_id": "", "customer_name": "", "customer_email": "Charlotte73@gmail.com", "customer_ip_address": "", "customer_billing_address": {"country": "Pitcairn Islands"}, "customer_tax_id": "", "metadata": {"key": "", "key1": "", "key2": true}, "product": {"created_at": "2023-04-10T23:37:07.835Z", "modified_at": "2022-05-26T16:57:22.796Z", "id": "", "name": "", "description": "restructure gadzooks alongside daily", "is_recurring": false, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2023-08-20T11:11:04.610Z", "modified_at": "2023-07-26T06:33:15.810Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 458049, "maximum_amount": 450824, "preset_amount": 262795}, {"created_at": "2023-04-26T04:53:50.189Z", "modified_at": "2024-05-28T07:17:57.134Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "month"}, {"created_at": "2023-08-29T15:06:35.685Z", "modified_at": "2024-06-02T05:45:06.910Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 746585, "recurring_interval": "year"}], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/var/mail", "mime_type": "", "size": 395188, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-07-04T22:10:57.702Z", "version": "", "is_uploaded": true, "created_at": "2023-08-22T23:59:38.589Z", "size_readable": "", "public_url": "https://mad-overheard.name/"}]}, "product_price": {"created_at": "2022-12-21T05:04:07.004Z", "modified_at": "2022-07-14T09:41:03.922Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 780262}, "discount": {"duration": "repeating", "duration_in_months": 531548, "type": "percentage", "amount": 845806, "currency": "Gourde", "id": "", "name": "", "code": ""}, "subscription_id": "", "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2024-03-19T09:19:03.347Z", "modified_at": "2024-04-26T05:27:06.241Z", "id": "", "metadata": {"key": true, "key1": ""}, "slug": "", "name": "", "organization_id": ""}, "order": 716267, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2023-05-03T12:57:21.117Z", "modified_at": "2023-04-10T23:37:07.835Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": ""}, "order": 856562, "required": true}], "customer_metadata": {"key": ""}} + application/json: {"created_at": "2025-02-06T13:54:48.821Z", "modified_at": "2024-09-04T11:33:52.011Z", "id": "", "payment_processor": "stripe", "status": "confirmed", "client_secret": "", "url": "https://willing-impostor.info", "expires_at": "2023-10-16T00:34:27.106Z", "success_url": "https://warm-hundred.net/", "embed_origin": "", "amount": 78888, "tax_amount": 219956, "currency": "Dalasi", "subtotal_amount": 94589, "total_amount": 552582, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": false, "is_discount_applicable": true, "is_free_product_price": false, "is_payment_required": false, "is_payment_setup_required": false, "is_payment_form_required": true, "customer_id": "", "customer_name": "", "customer_email": "", "customer_ip_address": "", "customer_billing_address": {"country": "Gabon"}, "customer_tax_id": "", "payment_processor_metadata": {}, "metadata": {}, "product": {"created_at": "2025-05-05T04:00:06.053Z", "modified_at": "2023-11-08T07:25:39.944Z", "id": "", "name": "", "description": "meanwhile bah because impassioned responsibility jogging airman per", "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2024-05-16T17:14:04.529Z", "modified_at": "2023-04-02T16:57:28.496Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 946256}, {"created_at": "2023-03-05T14:01:26.927Z", "modified_at": "2024-08-21T23:59:38.589Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 491026, "recurring_interval": "year"}, {"created_at": "2025-12-04T14:13:02.442Z", "modified_at": "2024-08-22T17:07:10.826Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 972276}], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/usr/ports", "mime_type": "", "size": 531548, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-09-24T06:33:56.610Z", "version": "", "is_uploaded": false, "created_at": "2024-01-20T11:46:53.929Z", "size_readable": "", "public_url": "https://unselfish-tinderbox.biz"}]}, "product_price": {"created_at": "2025-11-06T10:06:37.656Z", "modified_at": "2024-03-01T01:11:57.881Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 258862}, "discount": {"duration": "forever", "type": "percentage", "basis_points": 365275, "id": "", "name": "", "code": ""}, "subscription_id": "", "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2024-09-25T20:07:17.479Z", "modified_at": "2025-07-27T18:59:52.807Z", "id": "", "metadata": {"key": ""}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 90042, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2024-11-09T22:35:34.856Z", "modified_at": "2023-08-19T12:04:37.549Z", "id": "", "metadata": {"key": 198870}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 430812, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2023-03-30T11:50:33.761Z", "modified_at": "2024-02-03T08:18:51.900Z", "id": "", "metadata": {"key": 813525, "key1": 932779, "key2": 343616}, "slug": "", "name": "", "organization_id": "", "properties": {"options": [{"value": "", "label": ""}, {"value": "", "label": ""}, {"value": "", "label": ""}]}}, "order": 362683, "required": true}], "customer_metadata": {"key": 913115}} "404": application/json: {"detail": ""} "422": @@ -2148,9 +2261,13 @@ examples: parameters: path: id: "" + requestBody: + application/json: {} responses: "200": - application/json: {"created_at": "2024-07-28T19:04:48.565Z", "modified_at": "2023-10-17T10:52:42.015Z", "id": "", "status": "expired", "client_secret": "", "url": "https://powerless-juggernaut.org", "expires_at": "2022-03-01T06:03:05.915Z", "success_url": "https://juvenile-exploration.biz", "embed_origin": "", "amount": 139579, "tax_amount": 789275, "currency": "US Dollar", "subtotal_amount": 302461, "total_amount": 464385, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": false, "is_discount_applicable": false, "is_free_product_price": true, "is_payment_required": true, "is_payment_setup_required": false, "is_payment_form_required": false, "customer_id": "", "customer_name": "", "customer_email": "Jewel82@yahoo.com", "customer_ip_address": "", "customer_billing_address": {"country": "Timor-Leste"}, "customer_tax_id": "", "metadata": {"key": 329712, "key1": 579805}, "product": {"created_at": "2023-07-18T17:44:43.444Z", "modified_at": "2024-05-26T21:39:46.926Z", "id": "", "name": "", "description": "from that qualified", "is_recurring": false, "is_archived": false, "organization_id": "", "prices": [], "benefits": [{"created_at": "2022-09-24T19:37:32.283Z", "modified_at": "2022-10-18T10:44:09.680Z", "id": "", "type": "ads", "description": "blah intensely fragrant lest ferret", "selectable": true, "deletable": false, "organization_id": ""}, {"created_at": "2022-05-10T12:36:21.295Z", "modified_at": "2023-06-17T12:36:03.175Z", "id": "", "type": "github_repository", "description": "clamour urgently voluntarily scale gut readies concerning statement", "selectable": false, "deletable": true, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/opt", "mime_type": "", "size": 780342, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-10-17T01:35:15.856Z", "version": "", "is_uploaded": false, "created_at": "2023-07-26T09:32:51.778Z", "size_readable": "", "public_url": "https://unimportant-declaration.biz"}, {"id": "", "organization_id": "", "name": "", "path": "/usr/libexec", "mime_type": "", "size": 137957, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-07-15T06:46:09.402Z", "version": "", "is_uploaded": true, "created_at": "2022-07-02T00:00:11.531Z", "size_readable": "", "public_url": "https://clean-translation.name"}, {"id": "", "organization_id": "", "name": "", "path": "/usr/X11R6", "mime_type": "", "size": 202116, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-12-16T05:25:22.270Z", "version": "", "is_uploaded": true, "created_at": "2022-09-27T20:28:57.413Z", "size_readable": "", "public_url": "https://snappy-interchange.net"}]}, "product_price": {"created_at": "2023-01-13T16:52:57.274Z", "modified_at": "2024-12-22T15:27:45.882Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 488852, "maximum_amount": 984008, "preset_amount": 54062}, "discount": {"duration": "forever", "duration_in_months": 517232, "type": "percentage", "amount": 676467, "currency": "Sudanese Pound", "id": "", "name": "", "code": ""}, "subscription_id": "", "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2023-05-05T18:16:40.936Z", "modified_at": "2022-12-08T09:52:54.805Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": ""}, "order": 40788, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2024-05-15T01:05:20.251Z", "modified_at": "2024-09-02T06:16:41.919Z", "id": "", "metadata": {"key": 771203}, "slug": "", "name": "", "organization_id": ""}, "order": 315330, "required": false}], "customer_metadata": {"key": 60786}} + application/json: {"created_at": "2025-07-28T19:04:48.565Z", "modified_at": "2024-10-16T10:52:42.015Z", "id": "", "payment_processor": "stripe", "status": "expired", "client_secret": "", "url": "https://powerless-juggernaut.org", "expires_at": "2023-03-01T06:03:05.915Z", "success_url": "https://juvenile-exploration.biz", "embed_origin": "", "amount": 139579, "tax_amount": 789275, "currency": "US Dollar", "subtotal_amount": 302461, "total_amount": 464385, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": false, "is_discount_applicable": false, "is_free_product_price": true, "is_payment_required": true, "is_payment_setup_required": false, "is_payment_form_required": false, "customer_id": "", "customer_name": "", "customer_email": "", "customer_ip_address": "", "customer_billing_address": {"country": "Israel"}, "customer_tax_id": "", "payment_processor_metadata": {"key": "", "key1": ""}, "metadata": {}, "product": {"created_at": "2023-09-12T16:22:21.923Z", "modified_at": "2024-01-22T19:32:52.503Z", "id": "", "name": "", "description": "mobility char innocently dowse restfully ew woot through quantify", "is_recurring": true, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2024-09-02T03:35:45.584Z", "modified_at": "2024-05-22T21:03:36.028Z", "id": "", "is_archived": true, "product_id": ""}], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/net", "mime_type": "", "size": 34036, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-09-26T03:13:45.129Z", "version": "", "is_uploaded": true, "created_at": "2024-06-16T12:36:03.175Z", "size_readable": "", "public_url": "https://reflecting-hydrolyze.info"}, {"id": "", "organization_id": "", "name": "", "path": "/boot", "mime_type": "", "size": 20664, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-07-23T20:53:49.881Z", "version": "", "is_uploaded": false, "created_at": "2023-05-28T18:12:24.101Z", "size_readable": "", "public_url": "https://teeming-velocity.net/"}, {"id": "", "organization_id": "", "name": "", "path": "/usr/libdata", "mime_type": "", "size": 86078, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-09-02T01:36:01.445Z", "version": "", "is_uploaded": false, "created_at": "2024-07-06T17:41:05.826Z", "size_readable": "", "public_url": "https://straight-cinema.com/"}]}, "product_price": {"created_at": "2024-04-27T18:43:33.136Z", "modified_at": "2025-08-14T18:17:42.881Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 750835}, "discount": {"duration": "repeating", "type": "percentage", "amount": 623264, "currency": "Boliviano boliviano", "id": "", "name": "", "code": ""}, "subscription_id": "", "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2024-03-14T23:04:44.967Z", "modified_at": "2024-03-02T14:45:30.354Z", "id": "", "metadata": {"key": 257829, "key1": 302363, "key2": 675911}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 65573, "required": true}], "customer_metadata": {"key": false}} + "403": + application/json: {"detail": ""} "404": application/json: {"detail": ""} "422": @@ -2162,7 +2279,7 @@ examples: client_secret: "" responses: "200": - application/json: {"created_at": "2022-06-23T19:45:02.115Z", "modified_at": "2022-11-26T05:04:17.930Z", "id": "", "status": "succeeded", "client_secret": "", "url": "https://firm-median.name", "expires_at": "2024-10-05T02:43:03.106Z", "success_url": "https://distinct-release.info", "embed_origin": "", "amount": 649087, "tax_amount": 818651, "currency": "Costa Rican Colon", "subtotal_amount": 643894, "total_amount": 773661, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": false, "is_discount_applicable": true, "is_free_product_price": false, "is_payment_required": false, "is_payment_setup_required": true, "is_payment_form_required": false, "customer_id": "", "customer_name": "", "customer_email": "June.Welch@gmail.com", "customer_ip_address": "", "customer_billing_address": {"country": "Namibia"}, "customer_tax_id": "", "product": {"created_at": "2024-03-24T21:11:57.960Z", "modified_at": "2022-09-03T17:25:21.121Z", "id": "", "name": "", "description": "row co-producer babushka assured onto", "is_recurring": false, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2024-04-14T21:02:40.457Z", "modified_at": "2023-08-07T16:01:01.665Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 564186, "recurring_interval": "year"}, {"created_at": "2022-08-09T10:44:49.155Z", "modified_at": "2024-03-23T07:06:26.009Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 649087, "maximum_amount": 818651, "preset_amount": 200899}], "benefits": [{"created_at": "2023-12-30T10:29:13.010Z", "modified_at": "2024-04-24T21:58:26.448Z", "id": "", "type": "downloadables", "description": "indeed save orchestrate", "selectable": false, "deletable": true, "organization_id": ""}, {"created_at": "2024-11-28T07:38:21.211Z", "modified_at": "2022-04-20T18:32:12.688Z", "id": "", "type": "license_keys", "description": "upon king slimy hm gee coordination till archaeology yippee fuel", "selectable": true, "deletable": true, "organization_id": ""}], "medias": []}, "product_price": {"created_at": "2024-01-07T03:44:33.409Z", "modified_at": "2023-03-15T11:17:47.100Z", "id": "", "is_archived": false, "product_id": ""}, "discount": {"duration": "repeating", "type": "fixed", "amount": 306879, "currency": "Kip", "id": "", "name": "", "code": ""}, "organization": {"created_at": "2022-11-04T11:36:47.282Z", "modified_at": "2024-10-01T07:30:04.249Z", "id": "", "name": "", "slug": "", "avatar_url": "https://lumpy-jellyfish.com", "bio": "", "company": "Hodkiewicz LLC", "blog": "", "location": "", "email": "Davion_Runolfsdottir-Johnston@gmail.com", "twitter_username": "", "pledge_minimum_amount": 589933, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 205754}, "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2022-09-10T21:17:06.373Z", "modified_at": "2024-10-11T12:01:20.600Z", "id": "", "metadata": {"key": 260681}, "slug": "", "name": "", "organization_id": ""}, "order": 414731, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2022-05-26T18:30:39.536Z", "modified_at": "2024-09-06T08:48:06.798Z", "id": "", "metadata": {"key": 742595}, "slug": "", "name": "", "organization_id": ""}, "order": 824643, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2022-10-02T19:30:27.681Z", "modified_at": "2024-07-02T20:33:07.976Z", "id": "", "metadata": {"key": true}, "slug": "", "name": "", "organization_id": ""}, "order": 31200, "required": false}]} + application/json: {"created_at": "2023-06-23T19:45:02.115Z", "modified_at": "2023-11-26T05:04:17.930Z", "id": "", "payment_processor": "stripe", "status": "succeeded", "client_secret": "", "url": "https://firm-median.name", "expires_at": "2025-10-05T02:43:03.106Z", "success_url": "https://distinct-release.info", "embed_origin": "", "amount": 649087, "tax_amount": 818651, "currency": "Costa Rican Colon", "subtotal_amount": 643894, "total_amount": 773661, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": false, "is_discount_applicable": true, "is_free_product_price": false, "is_payment_required": false, "is_payment_setup_required": true, "is_payment_form_required": false, "customer_id": "", "customer_name": "", "customer_email": "", "customer_ip_address": "", "customer_billing_address": {"country": "French Guiana"}, "customer_tax_id": "", "payment_processor_metadata": {"key": "", "key1": ""}, "product": {"created_at": "2023-10-13T16:57:32.051Z", "modified_at": "2025-11-01T11:47:43.290Z", "id": "", "name": "", "description": "triumphantly rise energetically where", "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2023-02-19T04:21:39.872Z", "modified_at": "2025-11-03T20:37:17.415Z", "id": "", "is_archived": false, "product_id": ""}, {"created_at": "2024-07-17T23:46:27.274Z", "modified_at": "2025-06-13T18:38:01.612Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 973583}, {"created_at": "2025-10-21T12:03:07.471Z", "modified_at": "2023-08-15T10:28:06.670Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 544481, "maximum_amount": 633694, "preset_amount": 670458}], "benefits": [{"created_at": "2025-07-05T20:16:55.610Z", "modified_at": "2024-09-19T12:59:12.930Z", "id": "", "type": "custom", "description": "reporter gee among house incidentally", "selectable": true, "deletable": true, "organization_id": ""}, {"created_at": "2025-07-23T16:17:04.686Z", "modified_at": "2025-10-15T01:25:33.429Z", "id": "", "type": "discord", "description": "definitive as fluffy", "selectable": false, "deletable": true, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/opt/share", "mime_type": "", "size": 625185, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-05-17T14:56:37.099Z", "version": "", "is_uploaded": true, "created_at": "2024-03-07T06:13:50.940Z", "size_readable": "", "public_url": "https://creamy-giant.biz"}]}, "product_price": {"created_at": "2024-08-06T20:46:57.853Z", "modified_at": "2025-10-13T10:31:29.242Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 29169, "recurring_interval": "year"}, "discount": {"duration": "forever", "duration_in_months": 442095, "type": "fixed", "basis_points": 565670, "id": "", "name": "", "code": ""}, "organization": {"created_at": "2023-06-12T01:20:42.663Z", "modified_at": "2023-02-21T05:50:56.610Z", "id": "", "name": "", "slug": "", "avatar_url": "https://bouncy-thyme.info/", "bio": "", "company": "Kerluke, Mayert and Langosh", "blog": "", "location": "", "email": "Kaylee_Cassin36@gmail.com", "twitter_username": "", "pledge_minimum_amount": 449940, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 614629, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": false, "proration_behavior": "invoice"}}, "attached_custom_fields": []} "404": application/json: {"detail": ""} "422": @@ -2172,9 +2289,13 @@ examples: parameters: path: client_secret: "" + requestBody: + application/json: {} responses: "200": - application/json: {"created_at": "2024-10-22T20:45:21.815Z", "modified_at": "2023-07-17T23:31:05.499Z", "id": "", "status": "expired", "client_secret": "", "url": "https://energetic-nectarine.org", "expires_at": "2022-07-02T09:01:58.946Z", "success_url": "https://unsteady-reservation.net", "embed_origin": "", "amount": 169287, "tax_amount": 984514, "currency": "Naira", "subtotal_amount": 839103, "total_amount": 574252, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": true, "is_discount_applicable": false, "is_free_product_price": false, "is_payment_required": true, "is_payment_setup_required": false, "is_payment_form_required": true, "customer_id": "", "customer_name": "", "customer_email": "Reagan_DAmore51@gmail.com", "customer_ip_address": "", "customer_billing_address": {"country": "Serbia"}, "customer_tax_id": "", "product": {"created_at": "2022-07-18T14:46:38.829Z", "modified_at": "2023-12-25T03:42:50.687Z", "id": "", "name": "", "description": "deserted when till warmly capsize", "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [], "benefits": [{"created_at": "2022-12-31T06:13:31.477Z", "modified_at": "2024-07-17T10:51:55.423Z", "id": "", "type": "license_keys", "description": "wedge soap triangular oxidise petticoat probable", "selectable": true, "deletable": true, "organization_id": ""}], "medias": []}, "product_price": {"created_at": "2022-11-16T20:51:18.745Z", "modified_at": "2023-07-14T01:44:24.320Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 597177, "maximum_amount": 947630, "preset_amount": 166401}, "discount": {"duration": "once", "type": "percentage", "basis_points": 506990, "id": "", "name": "", "code": ""}, "organization": {"created_at": "2023-08-24T08:58:55.157Z", "modified_at": "2024-01-26T16:47:29.231Z", "id": "", "name": "", "slug": "", "avatar_url": "https://flickering-validity.biz/", "bio": "", "company": "Fadel - Leffler", "blog": "", "location": "", "email": "Eloise.Brekke58@gmail.com", "twitter_username": "", "pledge_minimum_amount": 809814, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 613632}, "attached_custom_fields": []} + application/json: {"created_at": "2025-10-22T20:45:21.815Z", "modified_at": "2024-07-16T23:31:05.499Z", "id": "", "payment_processor": "stripe", "status": "expired", "client_secret": "", "url": "https://energetic-nectarine.org", "expires_at": "2023-07-02T09:01:58.946Z", "success_url": "https://unsteady-reservation.net", "embed_origin": "", "amount": 169287, "tax_amount": 984514, "currency": "Naira", "subtotal_amount": 839103, "total_amount": 574252, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": true, "is_discount_applicable": false, "is_free_product_price": false, "is_payment_required": true, "is_payment_setup_required": false, "is_payment_form_required": true, "customer_id": "", "customer_name": "", "customer_email": "", "customer_ip_address": "", "customer_billing_address": {"country": "Ecuador"}, "customer_tax_id": "", "payment_processor_metadata": {"key": "", "key1": "", "key2": ""}, "product": {"created_at": "2023-04-02T09:15:44.014Z", "modified_at": "2023-07-09T01:19:03.728Z", "id": "", "name": "", "description": "till after well-documented under though ah inspect", "is_recurring": false, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2025-04-22T09:54:53.338Z", "modified_at": "2025-12-06T03:26:59.167Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "year"}, {"created_at": "2024-05-21T13:31:59.278Z", "modified_at": "2024-07-23T08:48:13.292Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 473173, "maximum_amount": 399171, "preset_amount": 566306}, {"created_at": "2025-05-18T11:07:27.088Z", "modified_at": "2025-08-07T01:01:04.852Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "year"}], "benefits": [{"created_at": "2023-03-15T12:20:36.952Z", "modified_at": "2025-05-20T04:50:42.884Z", "id": "", "type": "custom", "description": "petticoat probable gently polyester aw although shoulder", "selectable": false, "deletable": false, "organization_id": ""}, {"created_at": "2024-11-19T07:53:51.394Z", "modified_at": "2025-03-11T10:27:43.078Z", "id": "", "type": "discord", "description": "that meanwhile receptor futon orchestrate since slushy surprised ick", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/opt", "mime_type": "", "size": 197645, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-11-16T03:17:08.766Z", "version": "", "is_uploaded": true, "created_at": "2023-08-26T11:13:36.032Z", "size_readable": "", "public_url": "https://knotty-vicinity.biz"}, {"id": "", "organization_id": "", "name": "", "path": "/opt/lib", "mime_type": "", "size": 859643, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-03-29T16:21:18.296Z", "version": "", "is_uploaded": true, "created_at": "2024-06-11T19:24:10.100Z", "size_readable": "", "public_url": "https://grounded-soybean.com"}, {"id": "", "organization_id": "", "name": "", "path": "/lib", "mime_type": "", "size": 560820, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-12-13T08:26:39.160Z", "version": "", "is_uploaded": false, "created_at": "2025-06-24T16:48:30.542Z", "size_readable": "", "public_url": "https://lost-bathhouse.org"}]}, "product_price": {"created_at": "2023-02-26T13:38:52.930Z", "modified_at": "2023-02-23T20:39:49.714Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 375172, "maximum_amount": 699553, "preset_amount": 451608}, "discount": {"duration": "forever", "duration_in_months": 37700, "type": "percentage", "amount": 999915, "currency": "New Taiwan Dollar", "id": "", "name": "", "code": ""}, "organization": {"created_at": "2025-10-06T00:49:46.530Z", "modified_at": "2025-06-18T09:23:32.088Z", "id": "", "name": "", "slug": "", "avatar_url": "https://grim-hierarchy.org", "bio": "", "company": "Cummerata, O'Hara and Bartell", "blog": "", "location": "", "email": "Rosemarie34@gmail.com", "twitter_username": "", "pledge_minimum_amount": 970203, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 329221, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": true, "proration_behavior": "invoice"}}, "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2023-09-24T10:32:20.156Z", "modified_at": "2023-07-29T07:38:21.612Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 548675, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2023-10-21T17:51:12.758Z", "modified_at": "2024-12-22T09:13:34.031Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 91865, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2025-01-10T00:58:19.051Z", "modified_at": "2024-08-16T21:07:52.038Z", "id": "", "metadata": {"key": "", "key1": 269993}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 918763, "required": true}]} + "403": + application/json: {"detail": ""} "404": application/json: {"detail": ""} "422": @@ -2184,18 +2305,26 @@ examples: parameters: path: client_secret: "" + requestBody: + application/json: {} responses: "200": - application/json: {"created_at": "2024-09-27T22:33:04.250Z", "modified_at": "2024-07-24T02:45:26.067Z", "id": "", "client_secret": "", "url": "https://difficult-summary.net", "expires_at": "2023-02-11T02:25:13.433Z", "success_url": "https://quixotic-ceramic.name", "embed_origin": "", "amount": 714568, "tax_amount": 682520, "currency": "Taka", "subtotal_amount": 660127, "total_amount": 433381, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": false, "is_discount_applicable": false, "is_free_product_price": true, "is_payment_required": false, "is_payment_setup_required": false, "is_payment_form_required": true, "customer_id": "", "customer_name": "", "customer_email": "Nash_Rolfson71@gmail.com", "customer_ip_address": "", "customer_billing_address": {"country": "Aland Islands"}, "customer_tax_id": "", "product": {"created_at": "2023-10-16T06:21:58.495Z", "modified_at": "2023-04-02T23:39:58.524Z", "id": "", "name": "", "description": "revoke ugh worldly worldly furthermore watery seemingly yahoo intently overwork", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2023-11-15T07:38:37.445Z", "modified_at": "2022-07-30T06:29:51.767Z", "id": "", "is_archived": false, "product_id": ""}, {"created_at": "2024-01-07T19:25:42.663Z", "modified_at": "2023-12-28T12:48:47.240Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 636092, "maximum_amount": 714568, "preset_amount": 682520}, {"created_at": "2023-04-20T23:39:35.416Z", "modified_at": "2024-05-31T11:57:12.852Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 185124, "maximum_amount": 694451, "preset_amount": 648418, "recurring_interval": "month"}], "benefits": [{"created_at": "2023-07-15T01:35:47.336Z", "modified_at": "2022-01-29T19:05:28.910Z", "id": "", "type": "discord", "description": "lest where appropriate well-groomed finally forceful out optimistically psst", "selectable": true, "deletable": true, "organization_id": ""}, {"created_at": "2024-08-15T05:04:38.366Z", "modified_at": "2024-01-13T11:34:41.637Z", "id": "", "type": "custom", "description": "sticky coordinated linseed tabletop woot boohoo", "selectable": true, "deletable": false, "organization_id": ""}, {"created_at": "2022-12-01T02:02:53.967Z", "modified_at": "2022-11-22T01:14:30.421Z", "id": "", "type": "ads", "description": "cop captain sanity worth divert", "selectable": true, "deletable": true, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/media", "mime_type": "", "size": 533777, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-03-18T23:31:38.728Z", "version": "", "is_uploaded": true, "created_at": "2022-06-20T09:28:03.495Z", "size_readable": "", "public_url": "https://untidy-paintwork.net/"}]}, "product_price": {"created_at": "2024-05-15T21:24:29.311Z", "modified_at": "2024-04-02T20:53:59.657Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "year"}, "discount": {"duration": "forever", "type": "fixed", "basis_points": 309170, "id": "", "name": "", "code": ""}, "organization": {"created_at": "2023-08-31T08:44:42.567Z", "modified_at": "2023-01-17T20:40:08.507Z", "id": "", "name": "", "slug": "", "avatar_url": "https://celebrated-obesity.name", "bio": "", "company": "Wiza Group", "blog": "", "location": "", "email": "Jana.Kuhic@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 872332, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 199155}, "attached_custom_fields": [], "customer_session_token": ""} + application/json: {"created_at": "2025-09-27T22:33:04.250Z", "modified_at": "2025-07-24T02:45:26.067Z", "id": "", "payment_processor": "stripe", "client_secret": "", "url": "https://difficult-summary.net", "expires_at": "2024-02-11T02:25:13.433Z", "success_url": "https://quixotic-ceramic.name", "embed_origin": "", "amount": 714568, "tax_amount": 682520, "currency": "Taka", "subtotal_amount": 660127, "total_amount": 433381, "product_id": "", "product_price_id": "", "discount_id": "", "allow_discount_codes": false, "is_discount_applicable": false, "is_free_product_price": true, "is_payment_required": false, "is_payment_setup_required": false, "is_payment_form_required": true, "customer_id": "", "customer_name": "", "customer_email": "", "customer_ip_address": "", "customer_billing_address": {"country": "Andorra"}, "customer_tax_id": "", "payment_processor_metadata": {"key": "", "key1": ""}, "product": {"created_at": "2025-05-15T21:24:29.311Z", "modified_at": "2025-04-02T20:53:59.657Z", "id": "", "name": "", "description": "inculcate expense paintwork rigid slight mmm medium instead", "is_recurring": true, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2024-02-15T08:36:36.257Z", "modified_at": "2024-02-09T09:07:35.326Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 525971, "recurring_interval": "year"}, {"created_at": "2024-01-30T20:43:56.426Z", "modified_at": "2023-08-06T17:09:38.164Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 869549, "recurring_interval": "year"}], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/srv", "mime_type": "", "size": 558056, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-11-10T09:58:46.696Z", "version": "", "is_uploaded": false, "created_at": "2025-11-30T11:03:00.592Z", "size_readable": "", "public_url": "https://firm-laughter.com/"}]}, "product_price": {"created_at": "2025-12-26T20:09:50.416Z", "modified_at": "2023-03-02T11:38:31.977Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 697447}, "discount": {"duration": "once", "duration_in_months": 625024, "type": "percentage", "amount": 40370, "currency": "Bahraini Dinar", "id": "", "name": "", "code": ""}, "organization": {"created_at": "2025-01-28T11:55:38.839Z", "modified_at": "2024-02-24T06:00:35.077Z", "id": "", "name": "", "slug": "", "avatar_url": "https://bulky-tomb.name/", "bio": "", "company": "Kovacek - Schmitt", "blog": "", "location": "", "email": "Walton.Haag@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 531864, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 877778, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": true, "proration_behavior": "prorate"}}, "attached_custom_fields": [{"custom_field_id": "", "custom_field": {"created_at": "2023-11-17T20:38:02.954Z", "modified_at": "2025-01-17T20:39:54.598Z", "id": "", "metadata": {"key": false}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 39121, "required": true}, {"custom_field_id": "", "custom_field": {"created_at": "2025-02-05T08:36:50.941Z", "modified_at": "2024-06-02T01:24:27.441Z", "id": "", "metadata": {"key": false, "key1": 324086, "key2": true}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 217224, "required": false}, {"custom_field_id": "", "custom_field": {"created_at": "2024-05-30T10:52:29.356Z", "modified_at": "2025-12-17T09:50:33.819Z", "id": "", "metadata": {"key": "", "key1": 804883, "key2": ""}, "slug": "", "name": "", "organization_id": "", "properties": {}}, "order": 527536, "required": true}], "customer_session_token": ""} + "403": + application/json: {"detail": ""} "404": application/json: {"detail": ""} "422": application/json: {} files:list: speakeasy-default-files:list: + parameters: + query: + page: 1 + limit: 10 responses: "200": - application/json: {"items": [{"id": "", "organization_id": "", "name": "", "path": "/root", "mime_type": "", "size": 678317, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-07-14T18:23:27.528Z", "version": "", "is_uploaded": true, "created_at": "2022-06-17T12:14:27.999Z", "size_readable": "", "public_url": "https://productive-affect.net"}, {"id": "", "organization_id": "", "name": "", "path": "/dev", "mime_type": "", "size": 687960, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-07-13T19:57:33.016Z", "version": "", "is_uploaded": false, "created_at": "2022-01-09T04:26:27.312Z", "size_readable": ""}, {"id": "", "organization_id": "", "name": "", "path": "/opt/bin", "mime_type": "", "size": 485729, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-03-22T06:10:55.267Z", "version": "", "is_uploaded": false, "created_at": "2023-09-14T22:04:07.138Z", "size_readable": ""}], "pagination": {"total_count": 18278, "max_page": 897196}} + application/json: {"items": [{"id": "", "organization_id": "", "name": "", "path": "/usr", "mime_type": "", "size": 177706, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-09-09T18:28:08.953Z", "version": "", "is_uploaded": true, "created_at": "2024-11-27T13:02:27.296Z", "size_readable": "", "public_url": "https://agile-publicity.com"}, {"id": "", "organization_id": "", "name": "", "path": "/usr/X11R6", "mime_type": "", "size": 509883, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-11-25T18:23:24.264Z", "version": "", "is_uploaded": true, "created_at": "2023-03-01T20:22:54.911Z", "size_readable": ""}, {"id": "", "organization_id": "", "name": "", "path": "/private/var", "mime_type": "", "size": 73227, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-10-17T13:20:28.265Z", "version": "", "is_uploaded": false, "created_at": "2025-08-18T13:00:42.665Z", "size_readable": "", "public_url": "https://average-fedora.org/"}], "pagination": {"total_count": 18278, "max_page": 897196}} "422": application/json: {} files:create: @@ -2204,7 +2333,7 @@ examples: application/json: {"name": "", "mime_type": "", "size": 638424, "upload": {"parts": [{"number": 134365, "chunk_start": 69025, "chunk_end": 796474}]}} responses: "201": - application/json: {"id": "", "organization_id": "", "name": "", "path": "/var/spool", "mime_type": "", "size": 86, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-07-06T00:30:20.403Z", "upload": {"id": "", "path": "/etc", "parts": [{"number": 816588, "chunk_start": 586220, "chunk_end": 752438, "url": "https://harmful-disposer.com", "expires_at": "2022-09-10T10:08:53.440Z"}, {"number": 211337, "chunk_start": 64738, "chunk_end": 322997, "url": "https://blind-breastplate.name/", "expires_at": "2023-01-07T19:16:11.129Z"}, {"number": 36521, "chunk_start": 621636, "chunk_end": 650237, "url": "https://aggravating-lid.com/", "expires_at": "2023-12-25T00:15:46.309Z"}]}, "version": "", "service": "product_media", "size_readable": ""} + application/json: {"id": "", "organization_id": "", "name": "", "path": "/var/spool", "mime_type": "", "size": 86, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-07-06T00:30:20.403Z", "upload": {"id": "", "path": "/etc", "parts": [{"number": 816588, "chunk_start": 586220, "chunk_end": 752438, "url": "https://harmful-disposer.com", "expires_at": "2023-09-10T10:08:53.440Z"}, {"number": 211337, "chunk_start": 64738, "chunk_end": 322997, "url": "https://blind-breastplate.name/", "expires_at": "2024-01-07T19:16:11.129Z"}, {"number": 36521, "chunk_start": 621636, "chunk_end": 650237, "url": "https://aggravating-lid.com/", "expires_at": "2024-12-24T00:15:46.309Z"}]}, "version": "", "is_uploaded": false, "service": "product_media", "size_readable": ""} "422": application/json: {} files:uploaded: @@ -2216,7 +2345,7 @@ examples: application/json: {"id": "", "path": "/sys", "parts": [{"number": 173116, "checksum_etag": "", "checksum_sha256_base64": ""}, {"number": 894030, "checksum_etag": "", "checksum_sha256_base64": ""}, {"number": 673715, "checksum_etag": "", "checksum_sha256_base64": ""}]} responses: "200": - application/json: {"id": "", "organization_id": "", "name": "", "path": "/usr/ports", "mime_type": "", "size": 173116, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-09-06T20:34:00.390Z", "version": "", "is_uploaded": false, "created_at": "2023-12-06T04:28:57.373Z", "size_readable": "", "public_url": "https://heartfelt-folklore.net/"} + application/json: {"id": "", "organization_id": "", "name": "", "path": "/net", "mime_type": "", "size": 361127, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-01-17T04:07:38.336Z", "version": "", "is_uploaded": false, "created_at": "2025-07-26T19:39:54.130Z", "size_readable": "", "public_url": "https://buzzing-step-mother.biz/"} "403": application/json: {"detail": ""} "404": @@ -2228,9 +2357,11 @@ examples: parameters: path: id: "" + requestBody: + application/json: {} responses: "200": - application/json: {"id": "", "organization_id": "", "name": "", "path": "/srv", "mime_type": "", "size": 344620, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-12-22T15:27:45.882Z", "version": "", "is_uploaded": false, "created_at": "2023-06-20T18:46:17.643Z", "size_readable": "", "public_url": "https://awful-technician.info"} + application/json: {"id": "", "organization_id": "", "name": "", "path": "/srv", "mime_type": "", "size": 344620, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-12-22T15:27:45.882Z", "version": "", "is_uploaded": false, "created_at": "2024-06-19T18:46:17.643Z", "size_readable": "", "public_url": "https://awful-technician.info"} "403": application/json: {"detail": ""} "404": @@ -2253,24 +2384,28 @@ examples: speakeasy-default-metrics:get: parameters: query: - start_date: "2024-02-07" - end_date: "2023-09-05" + start_date: "2025-02-06" + end_date: "2024-09-04" interval: "week" responses: "200": - application/json: {"periods": [{"timestamp": "2024-11-29T01:50:48.954Z", "orders": 458049, "revenue": 450824, "average_order_value": 262795, "one_time_products": 213457, "one_time_products_revenue": 937146, "new_subscriptions": 438142, "new_subscriptions_revenue": 801373, "renewed_subscriptions": 78888, "renewed_subscriptions_revenue": 219956, "active_subscriptions": 313464, "monthly_recurring_revenue": 94589}, {"timestamp": "2023-08-29T15:06:35.685Z", "orders": 805876, "revenue": 380699, "average_order_value": 746585, "one_time_products": 608535, "one_time_products_revenue": 550965, "new_subscriptions": 322612, "new_subscriptions_revenue": 323185, "renewed_subscriptions": 177375, "renewed_subscriptions_revenue": 243354, "active_subscriptions": 780262, "monthly_recurring_revenue": 284041}], "metrics": {"orders": {"slug": "", "display_name": "Myrl_Rath32", "type": "currency"}, "revenue": {"slug": "", "display_name": "Irwin.Cole55", "type": "currency"}, "average_order_value": {"slug": "", "display_name": "Lula_Greenholt", "type": "scalar"}, "one_time_products": {"slug": "", "display_name": "Aubrey_Lang", "type": "currency"}, "one_time_products_revenue": {"slug": "", "display_name": "Graham.Klocko", "type": "currency"}, "new_subscriptions": {"slug": "", "display_name": "Nicklaus.Johns", "type": "currency"}, "new_subscriptions_revenue": {"slug": "", "display_name": "Jed64", "type": "currency"}, "renewed_subscriptions": {"slug": "", "display_name": "Albina.Pfeffer89", "type": "scalar"}, "renewed_subscriptions_revenue": {"slug": "", "display_name": "Meredith_Schaefer66", "type": "scalar"}, "active_subscriptions": {"slug": "", "display_name": "Aron.West16", "type": "currency"}, "monthly_recurring_revenue": {"slug": "", "display_name": "Allan7", "type": "currency"}}} + application/json: {"periods": [{"timestamp": "2025-11-29T01:50:48.954Z", "orders": 458049, "revenue": 450824, "cumulative_revenue": 262795, "average_order_value": 213457, "one_time_products": 937146, "one_time_products_revenue": 438142, "new_subscriptions": 801373, "new_subscriptions_revenue": 78888, "renewed_subscriptions": 219956, "renewed_subscriptions_revenue": 313464, "active_subscriptions": 94589, "monthly_recurring_revenue": 552582}, {"timestamp": "2025-06-02T05:45:06.910Z", "orders": 380699, "revenue": 746585, "cumulative_revenue": 608535, "average_order_value": 550965, "one_time_products": 322612, "one_time_products_revenue": 323185, "new_subscriptions": 177375, "new_subscriptions_revenue": 243354, "renewed_subscriptions": 780262, "renewed_subscriptions_revenue": 284041, "active_subscriptions": 737581, "monthly_recurring_revenue": 772105}], "metrics": {"orders": {"slug": "", "display_name": "Meredith.Hane", "type": "scalar"}, "revenue": {"slug": "", "display_name": "Brennon.Lubowitz", "type": "currency"}, "cumulative_revenue": {"slug": "", "display_name": "Elda.Runolfsson38", "type": "currency"}, "average_order_value": {"slug": "", "display_name": "Johanna_Marquardt", "type": "currency"}, "one_time_products": {"slug": "", "display_name": "Jacklyn90", "type": "currency"}, "one_time_products_revenue": {"slug": "", "display_name": "Hassan_Robel", "type": "scalar"}, "new_subscriptions": {"slug": "", "display_name": "Armani_OConner98", "type": "currency"}, "new_subscriptions_revenue": {"slug": "", "display_name": "Martine23", "type": "scalar"}, "renewed_subscriptions": {"slug": "", "display_name": "Pansy.Orn45", "type": "scalar"}, "renewed_subscriptions_revenue": {"slug": "", "display_name": "Tyson.Cummings54", "type": "scalar"}, "active_subscriptions": {"slug": "", "display_name": "Lorenza54", "type": "currency"}, "monthly_recurring_revenue": {"slug": "", "display_name": "Alexandrea57", "type": "scalar"}}} "422": application/json: {} metrics:limits: speakeasy-default-metrics:limits: responses: "200": - application/json: {"min_date": "2024-09-15", "intervals": {"hour": {"max_days": 187794}, "day": {"max_days": 119301}, "week": {"max_days": 20713}, "month": {"max_days": 305673}, "year": {"max_days": 373883}}} + application/json: {"min_date": "2025-09-15", "intervals": {"hour": {"max_days": 187794}, "day": {"max_days": 119301}, "week": {"max_days": 20713}, "month": {"max_days": 305673}, "year": {"max_days": 373883}}} license_keys:list: speakeasy-default-license-keys:list: + parameters: + query: + page: 1 + limit: 10 responses: "200": - application/json: {"items": [{"id": "", "organization_id": "", "user_id": "", "customer_id": "", "user": {"id": "", "email": "Marie.Fay@yahoo.com", "public_name": ""}, "customer": {"created_at": "2022-01-20T06:21:22.156Z", "modified_at": "2024-02-27T06:14:46.641Z", "id": "", "metadata": {}, "email": "Martin.Nader@gmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Bangladesh"}, "tax_id": ["sv_nit", "", ""], "organization_id": "", "avatar_url": "https://torn-affiliate.org/"}, "benefit_id": "", "key": "", "display_key": "", "status": "revoked", "limit_activations": 913465, "usage": 173090, "limit_usage": 75058, "validations": 897069, "last_validated_at": "2022-05-29T14:05:29.727Z", "expires_at": "2023-05-20T11:06:26.987Z"}, {"id": "", "organization_id": "", "user_id": "", "customer_id": "", "user": {"id": "", "email": "Hope_Brakus@yahoo.com", "public_name": ""}, "customer": {"created_at": "2024-08-04T08:35:41.482Z", "modified_at": "2022-12-03T21:35:05.453Z", "id": "", "metadata": {"key": ""}, "email": "Tatyana_Murphy91@gmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Mauritius"}, "tax_id": ["za_vat", "", ""], "organization_id": "", "avatar_url": "https://tasty-sarong.com/"}, "benefit_id": "", "key": "", "display_key": "", "status": "revoked", "limit_activations": 284580, "usage": 781409, "limit_usage": 544651, "validations": 66993, "last_validated_at": "2022-03-08T17:05:22.411Z", "expires_at": "2022-11-19T07:34:10.466Z"}, {"id": "", "organization_id": "", "user_id": "", "customer_id": "", "user": {"id": "", "email": "Neha.Hane@hotmail.com", "public_name": ""}, "customer": {"created_at": "2022-01-06T17:33:20.863Z", "modified_at": "2024-06-07T14:29:00.429Z", "id": "", "metadata": {"key": false, "key1": true, "key2": ""}, "email": "Zackery.Runte@yahoo.com", "email_verified": false, "name": "", "billing_address": {"country": "Morocco"}, "tax_id": [""], "organization_id": "", "avatar_url": "https://graceful-halt.com"}, "benefit_id": "", "key": "", "display_key": "", "status": "granted", "limit_activations": 943672, "usage": 988711, "limit_usage": 422943, "validations": 370293, "last_validated_at": "2023-05-17T08:33:13.471Z", "expires_at": "2022-08-22T08:40:22.005Z"}], "pagination": {"total_count": 900911, "max_page": 50388}} + application/json: {"items": [{"id": "", "organization_id": "", "user_id": "", "customer_id": "", "user": {"id": "", "email": "Marie.Fay@yahoo.com", "public_name": ""}, "customer": {"created_at": "2023-01-20T06:21:22.156Z", "modified_at": "2025-02-26T06:14:46.641Z", "id": "", "metadata": {}, "email": "Martin.Nader@gmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Bangladesh"}, "tax_id": ["sv_nit", "", ""], "organization_id": "", "avatar_url": "https://torn-affiliate.org/"}, "benefit_id": "", "key": "", "display_key": "", "status": "revoked", "limit_activations": 913465, "usage": 173090, "limit_usage": 75058, "validations": 897069, "last_validated_at": "2023-05-29T14:05:29.727Z", "expires_at": "2024-05-19T11:06:26.987Z"}, {"id": "", "organization_id": "", "user_id": "", "customer_id": "", "user": {"id": "", "email": "Hope_Brakus@yahoo.com", "public_name": ""}, "customer": {"created_at": "2025-08-04T08:35:41.482Z", "modified_at": "2023-12-03T21:35:05.453Z", "id": "", "metadata": {"key": ""}, "email": "Tatyana_Murphy91@gmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Mauritius"}, "tax_id": ["za_vat", "", ""], "organization_id": "", "avatar_url": "https://tasty-sarong.com/"}, "benefit_id": "", "key": "", "display_key": "", "status": "revoked", "limit_activations": 284580, "usage": 781409, "limit_usage": 544651, "validations": 66993, "last_validated_at": "2023-03-08T17:05:22.411Z", "expires_at": "2023-11-19T07:34:10.466Z"}, {"id": "", "organization_id": "", "user_id": "", "customer_id": "", "user": {"id": "", "email": "Neha.Hane@hotmail.com", "public_name": ""}, "customer": {"created_at": "2023-01-06T17:33:20.863Z", "modified_at": "2025-06-07T14:29:00.429Z", "id": "", "metadata": {"key": false, "key1": false, "key2": ""}, "email": "Zackery.Runte@yahoo.com", "email_verified": false, "name": "", "billing_address": {"country": "Morocco"}, "tax_id": [""], "organization_id": "", "avatar_url": "https://graceful-halt.com"}, "benefit_id": "", "key": "", "display_key": "", "status": "granted", "limit_activations": 943672, "usage": 988711, "limit_usage": 422943, "validations": 370293, "last_validated_at": "2024-05-16T08:33:13.471Z", "expires_at": "2023-08-22T08:40:22.005Z"}], "pagination": {"total_count": 900911, "max_page": 50388}} "401": application/json: {"detail": ""} "404": @@ -2284,7 +2419,7 @@ examples: id: "" responses: "200": - application/json: {"id": "", "organization_id": "", "user_id": "", "customer_id": "", "user": {"id": "", "email": "Keeley_Lebsack@hotmail.com", "public_name": ""}, "customer": {"created_at": "2022-10-16T00:34:27.106Z", "modified_at": "2022-08-22T22:47:10.166Z", "id": "", "metadata": {"key": 801373, "key1": "", "key2": ""}, "email": "Aurelio.Schoen@gmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Gabon"}, "tax_id": [""], "organization_id": "", "avatar_url": "https://sparse-edge.net/"}, "benefit_id": "", "key": "", "display_key": "", "status": "disabled", "limit_activations": 710500, "usage": 909118, "limit_usage": 324692, "validations": 32069, "last_validated_at": "2024-11-21T18:15:13.381Z", "expires_at": "2023-05-03T12:57:21.117Z", "activations": [{"id": "", "license_key_id": "", "label": "", "created_at": "2022-05-26T16:57:22.796Z", "modified_at": "2022-06-25T00:21:23.098Z"}]} + application/json: {"id": "", "organization_id": "", "user_id": "", "customer_id": "", "user": {"id": "", "email": "Keeley_Lebsack@hotmail.com", "public_name": ""}, "customer": {"created_at": "2023-10-16T00:34:27.106Z", "modified_at": "2023-08-22T22:47:10.166Z", "id": "", "metadata": {"key": 801373, "key1": "", "key2": ""}, "email": "Aurelio.Schoen@gmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Gabon"}, "tax_id": [""], "organization_id": "", "avatar_url": "https://sparse-edge.net/"}, "benefit_id": "", "key": "", "display_key": "", "status": "disabled", "limit_activations": 710500, "usage": 909118, "limit_usage": 324692, "validations": 32069, "last_validated_at": "2025-11-21T18:15:13.381Z", "expires_at": "2024-05-02T12:57:21.117Z", "activations": [{"id": "", "license_key_id": "", "label": "", "meta": {}, "created_at": "2023-05-26T16:57:22.796Z", "modified_at": "2023-06-25T00:21:23.098Z"}]} "401": application/json: {"detail": ""} "404": @@ -2296,9 +2431,11 @@ examples: parameters: path: id: "" + requestBody: + application/json: {"usage": 0} responses: "200": - application/json: {"id": "", "organization_id": "", "user_id": "", "customer_id": "", "user": {"id": "", "email": "Lavern48@hotmail.com", "public_name": ""}, "customer": {"created_at": "2022-03-01T06:03:05.915Z", "modified_at": "2024-09-09T13:32:29.600Z", "id": "", "metadata": {"key": ""}, "email": "Brody46@gmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Hong Kong"}, "tax_id": [], "organization_id": "", "avatar_url": "https://stunning-hunger.name"}, "benefit_id": "", "key": "", "display_key": "", "status": "granted", "limit_activations": 232374, "usage": 352933, "limit_usage": 824679, "validations": 834574, "last_validated_at": "2024-08-31T06:06:29.234Z", "expires_at": "2024-02-19T20:59:13.521Z"} + application/json: {"id": "", "organization_id": "", "user_id": "", "customer_id": "", "user": {"id": "", "email": "Lavern48@hotmail.com", "public_name": ""}, "customer": {"created_at": "2023-03-01T06:03:05.915Z", "modified_at": "2025-09-09T13:32:29.600Z", "id": "", "metadata": {"key": ""}, "email": "Brody46@gmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Hong Kong"}, "tax_id": [], "organization_id": "", "avatar_url": "https://stunning-hunger.name"}, "benefit_id": "", "key": "", "display_key": "", "status": "granted", "limit_activations": 232374, "usage": 352933, "limit_usage": 824679, "validations": 834574, "last_validated_at": "2025-08-31T06:06:29.234Z", "expires_at": "2025-02-18T20:59:13.521Z"} "401": application/json: {"detail": ""} "404": @@ -2313,7 +2450,7 @@ examples: activation_id: "" responses: "200": - application/json: {"id": "", "license_key_id": "", "label": "", "created_at": "2023-12-01T08:59:23.889Z", "modified_at": "2023-05-28T04:18:44.299Z", "license_key": {"id": "", "organization_id": "", "user_id": "", "customer_id": "", "user": {"id": "", "email": "Liliane.Donnelly57@hotmail.com", "public_name": ""}, "customer": {"created_at": "2022-02-12T09:53:47.529Z", "modified_at": "2023-03-29T03:08:34.429Z", "id": "", "metadata": {"key": true, "key1": 467317}, "email": "Jaylon_Jerde@gmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Lesotho"}, "tax_id": [], "organization_id": "", "avatar_url": "https://superb-bidet.name/"}, "benefit_id": "", "key": "", "display_key": "", "status": "disabled", "limit_activations": 966179, "usage": 237111, "limit_usage": 444742, "validations": 555833, "last_validated_at": "2024-08-15T05:27:39.612Z", "expires_at": "2024-10-07T20:58:07.617Z"}} + application/json: {"id": "", "license_key_id": "", "label": "", "meta": {}, "created_at": "2024-11-30T08:59:23.889Z", "modified_at": "2024-05-27T04:18:44.299Z", "license_key": {"id": "", "organization_id": "", "user_id": "", "customer_id": "", "user": {"id": "", "email": "Liliane.Donnelly57@hotmail.com", "public_name": ""}, "customer": {"created_at": "2023-02-12T09:53:47.529Z", "modified_at": "2024-03-28T03:08:34.429Z", "id": "", "metadata": {"key": true, "key1": false}, "email": "Jaylon_Jerde@gmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Lesotho"}, "tax_id": [], "organization_id": "", "avatar_url": "https://superb-bidet.name/"}, "benefit_id": "", "key": "", "display_key": "", "status": "disabled", "limit_activations": 966179, "usage": 237111, "limit_usage": 444742, "validations": 555833, "last_validated_at": "2025-08-15T05:27:39.612Z", "expires_at": "2025-10-07T20:58:07.617Z"}} "401": application/json: {"detail": ""} "404": @@ -2322,18 +2459,22 @@ examples: application/json: {} checkout-links:list: speakeasy-default-checkout-links:list: + parameters: + query: + page: 1 + limit: 10 responses: "200": - application/json: {"items": [{"created_at": "2023-08-23T19:26:20.850Z", "modified_at": "2024-01-14T10:26:00.433Z", "id": "", "metadata": {}, "client_secret": "", "success_url": "https://crooked-overload.name/", "label": "", "allow_discount_codes": true, "product_id": "", "product_price_id": "", "discount_id": "", "product": {"created_at": "2024-02-27T06:14:46.641Z", "modified_at": "2022-04-05T09:49:38.010Z", "id": "", "name": "", "description": "miserably fedora blah", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2024-01-14T10:26:00.433Z", "modified_at": "2022-07-14T18:23:27.528Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 152837, "maximum_amount": 635532, "preset_amount": 639387}], "benefits": [{"created_at": "2022-05-05T09:08:16.530Z", "modified_at": "2022-07-18T12:08:53.113Z", "id": "", "type": "license_keys", "description": "gosh whenever as", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/Library", "mime_type": "", "size": 324206, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-04-16T23:50:27.729Z", "version": "", "is_uploaded": false, "created_at": "2023-05-04T10:59:46.313Z", "size_readable": "", "public_url": "https://stunning-vanadyl.net/"}, {"id": "", "organization_id": "", "name": "", "path": "/proc", "mime_type": "", "size": 948614, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-09-13T12:26:55.235Z", "version": "", "is_uploaded": true, "created_at": "2023-05-28T16:21:14.723Z", "size_readable": "", "public_url": "https://severe-ruin.info"}]}, "product_price": {"created_at": "2022-04-05T09:49:38.010Z", "modified_at": "2022-03-17T01:57:00.187Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "year"}, "discount": {"duration": "once", "type": "percentage", "amount": 988711, "currency": "Yen", "created_at": "2023-02-10T20:11:51.410Z", "modified_at": "2023-05-17T08:33:13.471Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2024-09-14T09:33:23.636Z", "ends_at": "2022-02-25T05:24:29.459Z", "max_redemptions": 625217, "redemptions_count": 424586, "organization_id": ""}, "url": "https://dreary-dead.com/"}, {"created_at": "2024-01-09T15:39:01.722Z", "modified_at": "2024-07-08T10:18:47.471Z", "id": "", "metadata": {"key": true}, "client_secret": "", "success_url": "https://skeletal-reservation.biz/", "label": "", "allow_discount_codes": false, "product_id": "", "product_price_id": "", "discount_id": "", "product": {"created_at": "2022-04-26T06:24:09.264Z", "modified_at": "2023-10-15T09:46:50.350Z", "id": "", "name": "", "description": "stigmatize minor oh what steeple overheard swerve", "is_recurring": true, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2022-03-01T20:22:54.911Z", "modified_at": "2023-02-08T01:09:52.088Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 73227}, {"created_at": "2024-08-18T13:00:42.665Z", "modified_at": "2023-06-22T03:00:04.393Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 322596, "maximum_amount": 860596, "preset_amount": 18278}], "benefits": [], "medias": []}, "product_price": {"created_at": "2024-09-28T03:47:03.515Z", "modified_at": "2022-07-09T16:58:41.012Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 897069, "maximum_amount": 135572, "preset_amount": 460276}, "discount": {"duration": "forever", "duration_in_months": 480616, "type": "fixed", "amount": 523875, "currency": "Tunisian Dinar", "created_at": "2023-03-26T14:03:52.771Z", "modified_at": "2024-08-04T08:35:41.482Z", "id": "", "metadata": {"key": 113486}, "name": "", "code": "", "starts_at": "2022-07-18T12:08:53.113Z", "ends_at": "2024-09-28T13:56:10.162Z", "max_redemptions": 33597, "redemptions_count": 628106, "organization_id": ""}, "url": "https://joyous-hawk.biz/"}, {"created_at": "2023-08-29T08:32:20.644Z", "modified_at": "2024-09-07T14:10:22.892Z", "id": "", "metadata": {"key": "", "key1": false, "key2": 973913}, "client_secret": "", "success_url": "https://agitated-couch.name/", "label": "", "allow_discount_codes": false, "product_id": "", "product_price_id": "", "discount_id": "", "product": {"created_at": "2024-08-19T10:34:27.488Z", "modified_at": "2024-04-21T05:31:02.040Z", "id": "", "name": "", "description": "what married owlishly which wonderfully CD", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2023-09-15T04:48:08.824Z", "modified_at": "2024-07-08T11:13:00.198Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "year"}], "benefits": [{"created_at": "2024-07-09T08:01:51.932Z", "modified_at": "2024-11-27T17:23:02.117Z", "id": "", "type": "custom", "description": "till boo ack solicit weakly segregate boo", "selectable": true, "deletable": false, "organization_id": ""}, {"created_at": "2024-10-06T07:08:41.329Z", "modified_at": "2024-12-31T08:16:04.009Z", "id": "", "type": "custom", "description": "opposite amnesty tomography how until to onto ouch shrilly ramp", "selectable": true, "deletable": false, "organization_id": ""}, {"created_at": "2022-09-15T23:31:11.246Z", "modified_at": "2024-10-29T11:50:25.062Z", "id": "", "type": "discord", "description": "icy council meanwhile except following ick verbally drat", "selectable": false, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/etc/mail", "mime_type": "", "size": 993741, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-11-16T01:22:49.169Z", "version": "", "is_uploaded": false, "created_at": "2023-12-09T05:38:21.152Z", "size_readable": "", "public_url": "https://tender-squid.org"}, {"id": "", "organization_id": "", "name": "", "path": "/usr", "mime_type": "", "size": 440830, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-06-16T08:19:05.026Z", "version": "", "is_uploaded": false, "created_at": "2024-07-16T11:55:05.618Z", "size_readable": "", "public_url": "https://unwelcome-license.org"}]}, "product_price": {"created_at": "2022-03-23T01:47:30.770Z", "modified_at": "2024-07-06T02:51:23.749Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 141764, "recurring_interval": "year"}, "discount": {"duration": "repeating", "duration_in_months": 544651, "type": "fixed", "amount": 60868, "currency": "Lari", "created_at": "2024-12-24T15:52:28.107Z", "modified_at": "2024-03-30T07:52:25.805Z", "id": "", "metadata": {"key": ""}, "name": "", "code": "", "starts_at": "2022-04-16T23:50:27.729Z", "ends_at": "2024-01-14T06:48:49.446Z", "max_redemptions": 445673, "redemptions_count": 5229, "organization_id": ""}, "url": "https://dramatic-dish.com"}], "pagination": {"total_count": 679829, "max_page": 770830}} + application/json: {"items": [{"created_at": "2024-08-22T19:26:20.850Z", "modified_at": "2025-01-13T10:26:00.433Z", "id": "", "metadata": {}, "payment_processor": "stripe", "client_secret": "", "success_url": "https://crooked-overload.name/", "label": "", "allow_discount_codes": true, "product_id": "", "product_price_id": "", "discount_id": "", "product": {"created_at": "2025-02-26T06:14:46.641Z", "modified_at": "2023-04-05T09:49:38.010Z", "id": "", "name": "", "description": "miserably fedora blah", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2024-06-10T18:07:18.321Z", "modified_at": "2023-04-24T08:24:21.019Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 841031, "maximum_amount": 410206, "preset_amount": 863466, "recurring_interval": "month"}], "benefits": [{"created_at": "2023-05-05T09:08:16.530Z", "modified_at": "2023-07-18T12:08:53.113Z", "id": "", "type": "license_keys", "description": "gosh whenever as", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/Library", "mime_type": "", "size": 324206, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-04-16T23:50:27.729Z", "version": "", "is_uploaded": false, "created_at": "2024-05-03T10:59:46.313Z", "size_readable": "", "public_url": "https://stunning-vanadyl.net/"}, {"id": "", "organization_id": "", "name": "", "path": "/proc", "mime_type": "", "size": 948614, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-09-13T12:26:55.235Z", "version": "", "is_uploaded": true, "created_at": "2024-05-27T16:21:14.723Z", "size_readable": "", "public_url": "https://severe-ruin.info"}]}, "product_price": {"created_at": "2025-01-24T21:46:28.752Z", "modified_at": "2024-10-25T03:45:41.195Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 41398, "maximum_amount": 829409, "preset_amount": 329360, "recurring_interval": "month"}, "discount": {"duration": "once", "type": "percentage", "amount": 988711, "currency": "Yen", "created_at": "2024-02-10T20:11:51.410Z", "modified_at": "2024-05-16T08:33:13.471Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2025-09-14T09:33:23.636Z", "ends_at": "2023-02-25T05:24:29.459Z", "max_redemptions": 625217, "redemptions_count": 424586, "organization_id": ""}, "url": "https://dreary-dead.com/"}, {"created_at": "2025-01-08T15:39:01.722Z", "modified_at": "2025-07-08T10:18:47.471Z", "id": "", "metadata": {"key": true}, "payment_processor": "stripe", "client_secret": "", "success_url": "https://skeletal-reservation.biz/", "label": "", "allow_discount_codes": false, "product_id": "", "product_price_id": "", "discount_id": "", "product": {"created_at": "2023-04-26T06:24:09.264Z", "modified_at": "2024-10-14T09:46:50.350Z", "id": "", "name": "", "description": "stigmatize minor oh what steeple overheard swerve", "is_recurring": true, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2025-10-04T22:19:43.532Z", "modified_at": "2025-05-17T20:40:45.053Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 472871, "maximum_amount": 580639, "preset_amount": 212750}, {"created_at": "2023-03-14T00:43:13.016Z", "modified_at": "2024-12-11T21:57:01.257Z", "id": "", "is_archived": true, "product_id": ""}], "benefits": [], "medias": []}, "product_price": {"created_at": "2025-10-27T03:34:38.356Z", "modified_at": "2025-09-24T21:13:12.223Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 415930, "maximum_amount": 527743, "preset_amount": 19629}, "discount": {"duration": "once", "type": "percentage", "basis_points": 625809, "created_at": "2023-01-22T06:30:00.744Z", "modified_at": "2023-06-03T14:18:34.914Z", "id": "", "metadata": {"key": "", "key1": 439898, "key2": ""}, "name": "", "code": "", "starts_at": "2025-08-22T13:40:19.150Z", "ends_at": "2024-04-29T04:53:25.451Z", "max_redemptions": 561143, "redemptions_count": 207713, "organization_id": ""}, "url": "https://joyous-hawk.biz/"}, {"created_at": "2024-08-28T08:32:20.644Z", "modified_at": "2025-09-07T14:10:22.892Z", "id": "", "metadata": {"key": "", "key1": false, "key2": 973913}, "payment_processor": "stripe", "client_secret": "", "success_url": "https://agitated-couch.name/", "label": "", "allow_discount_codes": false, "product_id": "", "product_price_id": "", "discount_id": "", "product": {"created_at": "2025-08-19T10:34:27.488Z", "modified_at": "2025-04-21T05:31:02.040Z", "id": "", "name": "", "description": "what married owlishly which wonderfully CD", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2024-10-05T17:09:46.559Z", "modified_at": "2023-05-22T12:31:34.361Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 446559, "maximum_amount": 269946, "preset_amount": 211832, "recurring_interval": "month"}], "benefits": [{"created_at": "2025-07-09T08:01:51.932Z", "modified_at": "2025-11-27T17:23:02.117Z", "id": "", "type": "custom", "description": "till boo ack solicit weakly segregate boo", "selectable": true, "deletable": false, "organization_id": ""}, {"created_at": "2025-10-06T07:08:41.329Z", "modified_at": "2025-12-31T08:16:04.009Z", "id": "", "type": "custom", "description": "opposite amnesty tomography how until to onto ouch shrilly ramp", "selectable": true, "deletable": false, "organization_id": ""}, {"created_at": "2023-09-15T23:31:11.246Z", "modified_at": "2025-10-29T11:50:25.062Z", "id": "", "type": "discord", "description": "icy council meanwhile except following ick verbally drat", "selectable": false, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/etc/mail", "mime_type": "", "size": 993741, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-11-15T01:22:49.169Z", "version": "", "is_uploaded": false, "created_at": "2024-12-08T05:38:21.152Z", "size_readable": "", "public_url": "https://tender-squid.org"}, {"id": "", "organization_id": "", "name": "", "path": "/usr", "mime_type": "", "size": 440830, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-06-16T08:19:05.026Z", "version": "", "is_uploaded": false, "created_at": "2025-07-16T11:55:05.618Z", "size_readable": "", "public_url": "https://unwelcome-license.org"}]}, "product_price": {"created_at": "2025-11-28T05:50:05.391Z", "modified_at": "2024-11-05T18:58:59.059Z", "id": "", "is_archived": true, "product_id": ""}, "discount": {"duration": "once", "type": "percentage", "amount": 113341, "currency": "Kuwaiti Dinar", "created_at": "2023-01-13T23:48:07.394Z", "modified_at": "2024-10-06T22:24:47.498Z", "id": "", "metadata": {"key": true, "key1": true}, "name": "", "code": "", "starts_at": "2024-05-17T10:01:40.294Z", "ends_at": "2024-04-30T20:59:40.436Z", "max_redemptions": 990326, "redemptions_count": 263498, "organization_id": ""}, "url": "https://dramatic-dish.com"}], "pagination": {"total_count": 679829, "max_page": 770830}} "422": application/json: {} checkout-links:create: speakeasy-default-checkout-links:create: requestBody: - application/json: {"product_id": ""} + application/json: {"allow_discount_codes": true, "product_id": ""} responses: "201": - application/json: {"created_at": "2023-12-01T17:06:07.804Z", "modified_at": "2023-04-03T12:48:32.253Z", "id": "", "metadata": {}, "client_secret": "", "success_url": "https://standard-utilization.com/", "label": "", "allow_discount_codes": true, "product_id": "", "product_price_id": "", "discount_id": "", "product": {"created_at": "2022-04-09T14:25:29.356Z", "modified_at": "2024-05-18T17:03:53.906Z", "id": "", "name": "", "description": "geez pearl nicely disposer demob fencing fencing vainly kookily", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2022-05-28T06:20:22.766Z", "modified_at": "2022-03-17T15:39:20.911Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 951062, "maximum_amount": 86, "preset_amount": 169727}, {"created_at": "2024-06-13T23:30:51.782Z", "modified_at": "2023-10-05T11:56:21.731Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "year"}, {"created_at": "2022-01-20T11:09:16.789Z", "modified_at": "2022-09-10T10:08:53.440Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 64738, "recurring_interval": "month"}], "benefits": [{"created_at": "2022-04-15T08:31:18.832Z", "modified_at": "2024-10-17T04:31:41.259Z", "id": "", "type": "github_repository", "description": "where until waver colorless beyond victoriously consequently", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/home", "mime_type": "", "size": 616892, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-12-07T10:32:46.074Z", "version": "", "is_uploaded": true, "created_at": "2022-12-11T08:10:46.096Z", "size_readable": "", "public_url": "https://smooth-mouser.biz"}, {"id": "", "organization_id": "", "name": "", "path": "/usr/libdata", "mime_type": "", "size": 850693, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-08-07T16:03:54.759Z", "version": "", "is_uploaded": true, "created_at": "2023-04-15T15:17:22.965Z", "size_readable": "", "public_url": "https://well-groomed-coordination.net"}, {"id": "", "organization_id": "", "name": "", "path": "/usr/share", "mime_type": "", "size": 892770, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-08-07T10:40:26.624Z", "version": "", "is_uploaded": false, "created_at": "2023-12-30T21:05:10.955Z", "size_readable": "", "public_url": "https://fortunate-begonia.name"}]}, "product_price": {"created_at": "2022-04-21T15:49:25.047Z", "modified_at": "2023-12-16T13:47:55.993Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 36521, "recurring_interval": "year"}, "discount": {"duration": "once", "type": "fixed", "basis_points": 523523, "created_at": "2022-01-31T06:30:36.486Z", "modified_at": "2023-12-25T00:15:46.309Z", "id": "", "metadata": {"key": true, "key1": 259772}, "name": "", "code": "", "starts_at": "2024-05-07T11:22:17.516Z", "ends_at": "2022-05-31T12:10:19.425Z", "max_redemptions": 703441, "redemptions_count": 920994, "organization_id": ""}, "url": "https://proud-premier.net"} + application/json: {"created_at": "2024-11-30T17:06:07.804Z", "modified_at": "2024-04-02T12:48:32.253Z", "id": "", "metadata": {}, "payment_processor": "stripe", "client_secret": "", "success_url": "https://standard-utilization.com/", "label": "", "allow_discount_codes": true, "product_id": "", "product_price_id": "", "discount_id": "", "product": {"created_at": "2023-04-09T14:25:29.356Z", "modified_at": "2025-05-18T17:03:53.906Z", "id": "", "name": "", "description": "geez pearl nicely disposer demob fencing fencing vainly kookily", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2023-11-20T22:21:08.259Z", "modified_at": "2023-08-11T18:29:05.567Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 712214, "maximum_amount": 995852, "preset_amount": 823683}, {"created_at": "2023-11-08T09:30:18.760Z", "modified_at": "2024-10-28T18:55:39.709Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 497070, "maximum_amount": 609755, "preset_amount": 520049, "recurring_interval": "year"}, {"created_at": "2024-10-08T10:25:33.125Z", "modified_at": "2025-08-06T15:05:56.075Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 770370}], "benefits": [{"created_at": "2023-04-15T08:31:18.832Z", "modified_at": "2025-10-17T04:31:41.259Z", "id": "", "type": "github_repository", "description": "where until waver colorless beyond victoriously consequently", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/home", "mime_type": "", "size": 616892, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-12-07T10:32:46.074Z", "version": "", "is_uploaded": true, "created_at": "2023-12-11T08:10:46.096Z", "size_readable": "", "public_url": "https://smooth-mouser.biz"}, {"id": "", "organization_id": "", "name": "", "path": "/usr/libdata", "mime_type": "", "size": 850693, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-08-07T16:03:54.759Z", "version": "", "is_uploaded": true, "created_at": "2024-04-14T15:17:22.965Z", "size_readable": "", "public_url": "https://well-groomed-coordination.net"}, {"id": "", "organization_id": "", "name": "", "path": "/usr/share", "mime_type": "", "size": 892770, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-08-07T10:40:26.624Z", "version": "", "is_uploaded": false, "created_at": "2024-12-29T21:05:10.955Z", "size_readable": "", "public_url": "https://fortunate-begonia.name"}]}, "product_price": {"created_at": "2024-06-05T11:03:53.648Z", "modified_at": "2025-02-01T04:08:07.069Z", "id": "", "is_archived": true, "product_id": ""}, "discount": {"duration": "forever", "duration_in_months": 400422, "type": "fixed", "amount": 229175, "currency": "Comoro Franc", "created_at": "2023-06-13T18:10:46.985Z", "modified_at": "2024-03-25T05:20:06.588Z", "id": "", "metadata": {"key": true, "key1": 884414}, "name": "", "code": "", "starts_at": "2024-01-07T20:05:20.802Z", "ends_at": "2023-12-09T20:13:45.912Z", "max_redemptions": 885411, "redemptions_count": 903800, "organization_id": ""}, "url": "https://proud-premier.net"} "422": application/json: {} checkout-links:get: @@ -2343,7 +2484,7 @@ examples: id: "" responses: "200": - application/json: {"created_at": "2024-02-07T13:54:48.821Z", "modified_at": "2023-09-05T11:33:52.011Z", "id": "", "metadata": {"key": 969961, "key1": 450824}, "client_secret": "", "success_url": "https://earnest-tuber.info/", "label": "", "allow_discount_codes": false, "product_id": "", "product_price_id": "", "discount_id": "", "product": {"created_at": "2022-03-28T11:05:23.685Z", "modified_at": "2022-08-30T01:43:46.030Z", "id": "", "name": "", "description": "neaten qua meanwhile bah because", "is_recurring": false, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2023-08-20T11:11:04.610Z", "modified_at": "2023-07-26T06:33:15.810Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 458049, "maximum_amount": 450824, "preset_amount": 262795}, {"created_at": "2023-04-26T04:53:50.189Z", "modified_at": "2024-05-28T07:17:57.134Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "month"}], "benefits": [{"created_at": "2023-07-07T00:34:30.082Z", "modified_at": "2024-11-07T20:31:03.453Z", "id": "", "type": "discord", "description": "quizzically how lest", "selectable": false, "deletable": true, "organization_id": ""}, {"created_at": "2022-07-04T22:10:57.702Z", "modified_at": "2022-03-05T14:01:26.927Z", "id": "", "type": "github_repository", "description": "scholarship to blink", "selectable": false, "deletable": true, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/Library", "mime_type": "", "size": 698722, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-08-12T22:26:32.433Z", "version": "", "is_uploaded": false, "created_at": "2023-02-05T08:11:26.016Z", "size_readable": "", "public_url": "https://babyish-mixture.org"}, {"id": "", "organization_id": "", "name": "", "path": "/net", "mime_type": "", "size": 287673, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-04-09T16:28:47.030Z", "version": "", "is_uploaded": false, "created_at": "2022-06-04T09:34:39.316Z", "size_readable": "", "public_url": "https://dutiful-grass.name"}]}, "product_price": {"created_at": "2023-08-29T15:06:35.685Z", "modified_at": "2024-06-02T05:45:06.910Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 746585, "recurring_interval": "year"}, "discount": {"duration": "once", "type": "fixed", "basis_points": 177375, "created_at": "2022-09-24T17:11:04.561Z", "modified_at": "2024-05-05T04:00:06.053Z", "id": "", "metadata": {"key": false}, "name": "", "code": "", "starts_at": "2024-02-18T16:58:52.102Z", "ends_at": "2024-09-23T09:26:26.647Z", "max_redemptions": 324692, "redemptions_count": 32069, "organization_id": ""}, "url": "https://alert-requirement.com"} + application/json: {"created_at": "2025-02-06T13:54:48.821Z", "modified_at": "2024-09-04T11:33:52.011Z", "id": "", "metadata": {"key": 969961, "key1": 450824}, "payment_processor": "stripe", "client_secret": "", "success_url": "https://earnest-tuber.info/", "label": "", "allow_discount_codes": false, "product_id": "", "product_price_id": "", "discount_id": "", "product": {"created_at": "2023-03-28T11:05:23.685Z", "modified_at": "2023-08-30T01:43:46.030Z", "id": "", "name": "", "description": "neaten qua meanwhile bah because", "is_recurring": false, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2025-05-29T14:54:03.265Z", "modified_at": "2024-03-11T15:23:46.888Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 455424, "maximum_amount": 103111, "preset_amount": 716006}, {"created_at": "2025-04-06T10:37:18.493Z", "modified_at": "2025-07-13T14:31:52.430Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "month"}], "benefits": [{"created_at": "2024-07-06T00:34:30.082Z", "modified_at": "2025-11-07T20:31:03.453Z", "id": "", "type": "discord", "description": "quizzically how lest", "selectable": false, "deletable": true, "organization_id": ""}, {"created_at": "2023-07-04T22:10:57.702Z", "modified_at": "2023-03-05T14:01:26.927Z", "id": "", "type": "github_repository", "description": "scholarship to blink", "selectable": false, "deletable": true, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/Library", "mime_type": "", "size": 698722, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-08-11T22:26:32.433Z", "version": "", "is_uploaded": false, "created_at": "2024-02-05T08:11:26.016Z", "size_readable": "", "public_url": "https://babyish-mixture.org"}, {"id": "", "organization_id": "", "name": "", "path": "/net", "mime_type": "", "size": 287673, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-04-09T16:28:47.030Z", "version": "", "is_uploaded": false, "created_at": "2023-06-04T09:34:39.316Z", "size_readable": "", "public_url": "https://dutiful-grass.name"}]}, "product_price": {"created_at": "2023-11-15T11:05:23.221Z", "modified_at": "2024-11-30T03:14:17.295Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 363455, "maximum_amount": 954793, "preset_amount": 530112, "recurring_interval": "year"}, "discount": {"duration": "repeating", "duration_in_months": 449497, "type": "fixed", "amount": 960234, "currency": "Forint", "created_at": "2023-04-16T15:25:27.950Z", "modified_at": "2024-06-25T21:05:40.122Z", "id": "", "metadata": {"key": true, "key1": 247958}, "name": "", "code": "", "starts_at": "2025-05-08T18:55:26.211Z", "ends_at": "2023-06-29T15:48:45.688Z", "max_redemptions": 931908, "redemptions_count": 295386, "organization_id": ""}, "url": "https://alert-requirement.com"} "404": application/json: {"detail": ""} "422": @@ -2353,9 +2494,11 @@ examples: parameters: path: id: "" + requestBody: + application/json: {} responses: "200": - application/json: {"created_at": "2024-07-28T19:04:48.565Z", "modified_at": "2023-10-17T10:52:42.015Z", "id": "", "metadata": {"key": false}, "client_secret": "", "success_url": "https://worthwhile-avalanche.org/", "label": "", "allow_discount_codes": true, "product_id": "", "product_price_id": "", "discount_id": "", "product": {"created_at": "2022-12-08T09:52:54.805Z", "modified_at": "2022-10-01T09:16:09.932Z", "id": "", "name": "", "description": "impressionable furthermore graceful hungrily", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2023-11-19T22:44:58.301Z", "modified_at": "2023-06-20T18:46:17.643Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "month"}, {"created_at": "2022-12-08T09:52:54.805Z", "modified_at": "2022-10-01T09:16:09.932Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 789275, "maximum_amount": 889838, "preset_amount": 302461}], "benefits": [{"created_at": "2022-08-12T00:40:23.342Z", "modified_at": "2024-01-06T19:25:16.577Z", "id": "", "type": "ads", "description": "belabor past wearily broadside backburn", "selectable": false, "deletable": true, "organization_id": ""}, {"created_at": "2022-02-07T07:18:25.786Z", "modified_at": "2024-09-26T03:13:45.129Z", "id": "", "type": "custom", "description": "misjudge scare cinema ouch weary euphonium", "selectable": false, "deletable": false, "organization_id": ""}], "medias": []}, "product_price": {"created_at": "2024-01-31T02:01:14.461Z", "modified_at": "2023-03-20T01:46:46.018Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "year"}, "discount": {"duration": "forever", "duration_in_months": 501135, "type": "fixed", "basis_points": 232374, "created_at": "2023-01-22T19:32:52.503Z", "modified_at": "2024-06-22T20:20:38.468Z", "id": "", "metadata": {"key": false, "key1": 329712, "key2": 579805}, "name": "", "code": "", "starts_at": "2023-07-18T17:44:43.444Z", "ends_at": "2024-05-26T21:39:46.926Z", "max_redemptions": 72219, "redemptions_count": 151827, "organization_id": ""}, "url": "https://unimportant-declaration.biz"} + application/json: {"created_at": "2025-07-28T19:04:48.565Z", "modified_at": "2024-10-16T10:52:42.015Z", "id": "", "metadata": {"key": false}, "payment_processor": "stripe", "client_secret": "", "success_url": "https://worthwhile-avalanche.org/", "label": "", "allow_discount_codes": true, "product_id": "", "product_price_id": "", "discount_id": "", "product": {"created_at": "2023-12-08T09:52:54.805Z", "modified_at": "2023-10-01T09:16:09.932Z", "id": "", "name": "", "description": "impressionable furthermore graceful hungrily", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2023-04-23T07:27:43.936Z", "modified_at": "2025-05-13T01:40:59.920Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 348627, "maximum_amount": 404031, "preset_amount": 166206, "recurring_interval": "year"}, {"created_at": "2024-03-06T08:49:00.130Z", "modified_at": "2023-10-16T11:25:33.944Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 845914, "maximum_amount": 652850, "preset_amount": 828354}], "benefits": [{"created_at": "2023-08-12T00:40:23.342Z", "modified_at": "2025-01-05T19:25:16.577Z", "id": "", "type": "ads", "description": "belabor past wearily broadside backburn", "selectable": false, "deletable": true, "organization_id": ""}, {"created_at": "2023-02-07T07:18:25.786Z", "modified_at": "2025-09-26T03:13:45.129Z", "id": "", "type": "custom", "description": "misjudge scare cinema ouch weary euphonium", "selectable": false, "deletable": false, "organization_id": ""}], "medias": []}, "product_price": {"created_at": "2025-12-05T01:57:12.137Z", "modified_at": "2025-03-14T17:31:49.028Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 372087, "recurring_interval": "year"}, "discount": {"duration": "forever", "type": "percentage", "amount": 239080, "currency": "Vatu", "created_at": "2025-08-08T14:33:10.018Z", "modified_at": "2024-08-11T02:39:15.905Z", "id": "", "metadata": {"key": true}, "name": "", "code": "", "starts_at": "2025-05-05T06:06:40.987Z", "ends_at": "2025-10-17T01:35:15.856Z", "max_redemptions": 553018, "redemptions_count": 521348, "organization_id": ""}, "url": "https://unimportant-declaration.biz"} "404": application/json: {"detail": ""} "422": @@ -2372,18 +2515,22 @@ examples: application/json: {} custom-fields:list: speakeasy-default-custom-fields:list: + parameters: + query: + page: 1 + limit: 10 responses: "200": - application/json: {"items": [{"created_at": "2023-08-23T19:26:20.850Z", "modified_at": "2024-01-14T10:26:00.433Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": "", "properties": {"options": []}}, {"created_at": "2023-11-28T13:02:27.296Z", "modified_at": "2023-12-02T18:25:37.169Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": ""}, {"created_at": "2022-04-05T09:49:38.010Z", "modified_at": "2022-03-17T01:57:00.187Z", "id": "", "metadata": {"key": 633911, "key1": ""}, "slug": "", "name": "", "organization_id": "", "properties": {"options": []}}], "pagination": {"total_count": 367745, "max_page": 485729}} + application/json: {"items": [{"created_at": "2025-01-13T10:26:00.433Z", "modified_at": "2023-07-14T18:23:27.528Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": "", "properties": {}}, {"created_at": "2024-11-27T13:02:27.296Z", "modified_at": "2024-12-01T18:25:37.169Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": "", "properties": {}}, {"created_at": "2023-04-05T09:49:38.010Z", "modified_at": "2023-03-17T01:57:00.187Z", "id": "", "metadata": {"key": 633911, "key1": ""}, "slug": "", "name": "", "organization_id": "", "properties": {"options": []}}], "pagination": {"total_count": 367745, "max_page": 485729}} "422": application/json: {} custom-fields:create: speakeasy-default-custom-fields:create: requestBody: - application/json: {"slug": "", "name": ""} + application/json: {"slug": "", "name": "", "properties": {}} responses: "201": - application/json: {"created_at": "2023-04-03T12:48:32.253Z", "modified_at": "2022-05-28T06:20:22.766Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": "", "properties": {"options": [{"value": "", "label": ""}, {"value": "", "label": ""}, {"value": "", "label": ""}]}} + application/json: {"created_at": "2024-04-02T12:48:32.253Z", "modified_at": "2023-05-28T06:20:22.766Z", "id": "", "metadata": {}, "slug": "", "name": "", "organization_id": "", "properties": {"options": [{"value": "", "label": ""}, {"value": "", "label": ""}, {"value": "", "label": ""}]}} "422": application/json: {} custom-fields:get: @@ -2393,7 +2540,7 @@ examples: id: "" responses: "200": - application/json: {"created_at": "2023-09-05T11:33:52.011Z", "modified_at": "2023-08-20T11:11:04.610Z", "id": "", "metadata": {"key": true, "key1": 262795}, "slug": "", "name": "", "organization_id": "", "properties": {"options": []}} + application/json: {"created_at": "2024-09-04T11:33:52.011Z", "modified_at": "2024-08-19T11:11:04.610Z", "id": "", "metadata": {"key": true, "key1": 262795}, "slug": "", "name": "", "organization_id": "", "properties": {"options": []}} "404": application/json: {"detail": ""} "422": @@ -2403,9 +2550,11 @@ examples: parameters: path: id: "" + requestBody: + application/json: {} responses: "200": - application/json: {"created_at": "2023-01-13T16:52:57.274Z", "modified_at": "2024-12-22T15:27:45.882Z", "id": "", "metadata": {"key": 984008, "key1": ""}, "slug": "", "name": "", "organization_id": ""} + application/json: {"created_at": "2024-01-13T16:52:57.274Z", "modified_at": "2025-12-22T15:27:45.882Z", "id": "", "metadata": {"key": 984008, "key1": ""}, "slug": "", "name": "", "organization_id": "", "properties": {}} "404": application/json: {"detail": ""} "422": @@ -2422,18 +2571,22 @@ examples: application/json: {} discounts:list: speakeasy-default-discounts:list: + parameters: + query: + page: 1 + limit: 10 responses: "200": - application/json: {"items": [{"duration": "forever", "duration_in_months": 678317, "type": "fixed", "basis_points": 229716, "created_at": "2022-06-17T12:14:27.999Z", "modified_at": "2023-11-28T13:02:27.296Z", "id": "", "metadata": {"key": "", "key1": true}, "name": "", "code": "", "starts_at": "2022-03-17T01:57:00.187Z", "ends_at": "2024-01-25T00:05:25.844Z", "max_redemptions": 509883, "redemptions_count": 633911, "organization_id": "", "products": []}, {"duration": "forever", "type": "fixed", "amount": 73227, "currency": "Tala", "created_at": "2023-09-14T22:04:07.138Z", "modified_at": "2024-08-18T13:00:42.665Z", "id": "", "metadata": {"key": ""}, "name": "", "code": "", "starts_at": "2022-12-20T13:34:28.286Z", "ends_at": "2024-08-01T05:06:49.492Z", "max_redemptions": 18278, "redemptions_count": 897196, "organization_id": "", "products": [{"created_at": "2024-09-28T03:47:03.515Z", "modified_at": "2022-07-09T16:58:41.012Z", "id": "", "name": "", "description": "brook cleverly blossom", "is_recurring": false, "is_archived": false, "organization_id": ""}]}, {"duration": "repeating", "duration_in_months": 996014, "type": "fixed", "basis_points": 164965, "created_at": "2022-03-23T01:47:30.770Z", "modified_at": "2024-07-06T02:51:23.749Z", "id": "", "metadata": {"key": "", "key1": 284580, "key2": false}, "name": "", "code": "", "starts_at": "2022-03-15T10:11:56.132Z", "ends_at": "2022-03-08T17:05:22.411Z", "max_redemptions": 294083, "redemptions_count": 993305, "organization_id": "", "products": [{"created_at": "2022-10-11T19:17:33.283Z", "modified_at": "2022-12-22T07:54:29.563Z", "id": "", "name": "", "description": "memorise ruin apparatus", "is_recurring": false, "is_archived": true, "organization_id": ""}, {"created_at": "2023-03-22T09:41:56.524Z", "modified_at": "2022-03-28T18:28:26.777Z", "id": "", "name": "", "description": "tenement commonly softly", "is_recurring": false, "is_archived": true, "organization_id": ""}]}], "pagination": {"total_count": 551258, "max_page": 105170}} + application/json: {"items": [{"duration": "repeating", "type": "fixed", "basis_points": 229716, "created_at": "2023-06-17T12:14:27.999Z", "modified_at": "2024-11-27T13:02:27.296Z", "id": "", "metadata": {"key": "", "key1": true}, "name": "", "code": "", "starts_at": "2023-03-17T01:57:00.187Z", "ends_at": "2025-01-24T00:05:25.844Z", "max_redemptions": 509883, "redemptions_count": 633911, "organization_id": "", "products": []}, {"duration": "forever", "type": "fixed", "amount": 73227, "currency": "Tala", "created_at": "2024-09-13T22:04:07.138Z", "modified_at": "2025-08-18T13:00:42.665Z", "id": "", "metadata": {"key": ""}, "name": "", "code": "", "starts_at": "2023-12-20T13:34:28.286Z", "ends_at": "2025-08-01T05:06:49.492Z", "max_redemptions": 18278, "redemptions_count": 897196, "organization_id": "", "products": [{"created_at": "2025-09-28T03:47:03.515Z", "modified_at": "2023-07-09T16:58:41.012Z", "id": "", "name": "", "description": "brook cleverly blossom", "is_recurring": false, "is_archived": false, "organization_id": ""}]}, {"duration": "repeating", "duration_in_months": 996014, "type": "fixed", "basis_points": 164965, "created_at": "2023-03-23T01:47:30.770Z", "modified_at": "2025-07-06T02:51:23.749Z", "id": "", "metadata": {"key": "", "key1": 284580, "key2": false}, "name": "", "code": "", "starts_at": "2023-03-15T10:11:56.132Z", "ends_at": "2023-03-08T17:05:22.411Z", "max_redemptions": 294083, "redemptions_count": 993305, "organization_id": "", "products": [{"created_at": "2023-10-11T19:17:33.283Z", "modified_at": "2023-12-22T07:54:29.563Z", "id": "", "name": "", "description": "memorise ruin apparatus", "is_recurring": false, "is_archived": true, "organization_id": ""}, {"created_at": "2024-03-21T09:41:56.524Z", "modified_at": "2023-03-28T18:28:26.777Z", "id": "", "name": "", "description": "tenement commonly softly", "is_recurring": false, "is_archived": true, "organization_id": ""}]}], "pagination": {"total_count": 551258, "max_page": 105170}} "422": application/json: {} discounts:create: speakeasy-default-discounts:create: requestBody: - application/json: {"duration": "forever", "duration_in_months": 417458, "type": "fixed", "amount": 69025, "name": ""} + application/json: {"duration": "forever", "duration_in_months": 417458, "type": "fixed", "amount": 69025, "currency": "usd", "name": ""} responses: "201": - application/json: {"duration": "forever", "duration_in_months": 417458, "type": "fixed", "amount": 69025, "currency": "South Sudanese pound", "created_at": "2024-11-08T08:43:39.394Z", "modified_at": "2022-01-01T02:16:41.381Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2022-04-09T14:25:29.356Z", "ends_at": "2024-05-18T17:03:53.906Z", "max_redemptions": 816588, "redemptions_count": 586220, "organization_id": "", "products": [{"created_at": "2024-11-15T07:40:19.243Z", "modified_at": "2023-01-27T07:05:06.005Z", "id": "", "name": "", "description": "bench around igloo scaffold junior", "is_recurring": true, "is_archived": true, "organization_id": ""}, {"created_at": "2024-10-10T05:37:22.119Z", "modified_at": "2022-02-19T18:37:18.227Z", "id": "", "name": "", "description": "coordination affect hmph worth", "is_recurring": false, "is_archived": true, "organization_id": ""}, {"created_at": "2023-11-12T08:08:14.535Z", "modified_at": "2022-11-08T09:30:18.760Z", "id": "", "name": "", "description": "clear-cut whoever defiantly indolent apud formula other", "is_recurring": false, "is_archived": true, "organization_id": ""}]} + application/json: {"duration": "repeating", "duration_in_months": 86, "type": "fixed", "basis_points": 89964, "created_at": "2025-05-18T17:03:53.906Z", "modified_at": "2025-06-13T23:30:51.782Z", "id": "", "metadata": {"key": false, "key1": 259629}, "name": "", "code": "", "starts_at": "2023-01-20T11:09:16.789Z", "ends_at": "2023-09-10T10:08:53.440Z", "max_redemptions": 211337, "redemptions_count": 64738, "organization_id": "", "products": [{"created_at": "2023-07-23T12:28:22.635Z", "modified_at": "2023-03-22T23:50:34.661Z", "id": "", "name": "", "description": "yuck mortally round", "is_recurring": true, "is_archived": true, "organization_id": ""}]} "422": application/json: {} discounts:get: @@ -2443,7 +2596,7 @@ examples: id: "" responses: "200": - application/json: {"duration": "forever", "type": "percentage", "basis_points": 521235, "created_at": "2024-11-29T01:50:48.954Z", "modified_at": "2023-05-18T00:32:02.244Z", "id": "", "metadata": {"key": ""}, "name": "", "code": "", "starts_at": "2022-08-22T22:47:10.166Z", "ends_at": "2024-10-24T02:41:21.259Z", "max_redemptions": 438142, "redemptions_count": 801373, "organization_id": "", "products": []} + application/json: {"duration": "forever", "type": "percentage", "basis_points": 521235, "created_at": "2025-11-29T01:50:48.954Z", "modified_at": "2024-05-17T00:32:02.244Z", "id": "", "metadata": {"key": ""}, "name": "", "code": "", "starts_at": "2023-08-22T22:47:10.166Z", "ends_at": "2025-10-24T02:41:21.259Z", "max_redemptions": 438142, "redemptions_count": 801373, "organization_id": "", "products": []} "404": application/json: {"detail": ""} "422": @@ -2453,9 +2606,11 @@ examples: parameters: path: id: "" + requestBody: + application/json: {"currency": "usd"} responses: "200": - application/json: {"duration": "forever", "duration_in_months": 344620, "type": "percentage", "basis_points": 627690, "created_at": "2023-06-20T18:46:17.643Z", "modified_at": "2024-12-14T11:19:45.098Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2024-09-09T13:32:29.600Z", "ends_at": "2023-05-05T18:16:40.936Z", "max_redemptions": 311507, "redemptions_count": 249440, "organization_id": "", "products": []} + application/json: {"duration": "forever", "duration_in_months": 344620, "type": "percentage", "basis_points": 627690, "created_at": "2024-06-19T18:46:17.643Z", "modified_at": "2025-12-14T11:19:45.098Z", "id": "", "metadata": {}, "name": "", "code": "", "starts_at": "2025-09-09T13:32:29.600Z", "ends_at": "2024-05-04T18:16:40.936Z", "max_redemptions": 311507, "redemptions_count": 249440, "organization_id": "", "products": []} "404": application/json: {"detail": ""} "422": @@ -2472,9 +2627,13 @@ examples: application/json: {} customers:list: speakeasy-default-customers:list: + parameters: + query: + page: 1 + limit: 10 responses: "200": - application/json: {"items": [{"created_at": "2023-08-23T19:26:20.850Z", "modified_at": "2024-01-14T10:26:00.433Z", "id": "", "metadata": {}, "email": "Candelario.Nikolaus71@gmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Panama"}, "tax_id": ["ad_nrt", ""], "organization_id": "", "avatar_url": "https://lovely-bench.org/"}, {"created_at": "2023-09-14T22:04:07.138Z", "modified_at": "2024-08-18T13:00:42.665Z", "id": "", "metadata": {"key": ""}, "email": "Sabrina.Treutel91@gmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Tokelau"}, "tax_id": [], "organization_id": "", "avatar_url": "https://instructive-hospitalization.info/"}, {"created_at": "2022-04-24T08:24:21.019Z", "modified_at": "2023-07-29T04:00:22.486Z", "id": "", "metadata": {"key": 863466, "key1": "", "key2": 113486}, "email": "Tatyana_Murphy91@gmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Mauritius"}, "tax_id": ["za_vat", "", ""], "organization_id": "", "avatar_url": "https://tasty-sarong.com/"}], "pagination": {"total_count": 664080, "max_page": 284580}} + application/json: {"items": [{"created_at": "2024-08-22T19:26:20.850Z", "modified_at": "2025-01-13T10:26:00.433Z", "id": "", "metadata": {}, "email": "Candelario.Nikolaus71@gmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Panama"}, "tax_id": ["ad_nrt", ""], "organization_id": "", "avatar_url": "https://lovely-bench.org/"}, {"created_at": "2024-09-13T22:04:07.138Z", "modified_at": "2025-08-18T13:00:42.665Z", "id": "", "metadata": {"key": ""}, "email": "Sabrina.Treutel91@gmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Tokelau"}, "tax_id": [], "organization_id": "", "avatar_url": "https://instructive-hospitalization.info/"}, {"created_at": "2023-04-24T08:24:21.019Z", "modified_at": "2024-07-28T04:00:22.486Z", "id": "", "metadata": {"key": 863466, "key1": "", "key2": 113486}, "email": "Tatyana_Murphy91@gmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Mauritius"}, "tax_id": ["za_vat", "", ""], "organization_id": "", "avatar_url": "https://tasty-sarong.com/"}], "pagination": {"total_count": 664080, "max_page": 284580}} "422": application/json: {} customers:create: @@ -2483,7 +2642,7 @@ examples: application/json: {"email": "Loyal79@yahoo.com"} responses: "201": - application/json: {"created_at": "2022-01-01T02:16:41.381Z", "modified_at": "2022-07-06T00:30:20.403Z", "id": "", "metadata": {}, "email": "Raymundo_Rolfson35@hotmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Cyprus"}, "tax_id": [], "organization_id": "", "avatar_url": "https://glorious-convection.com/"} + application/json: {"created_at": "2023-01-01T02:16:41.381Z", "modified_at": "2023-07-06T00:30:20.403Z", "id": "", "metadata": {}, "email": "Raymundo_Rolfson35@hotmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Cyprus"}, "tax_id": [], "organization_id": "", "avatar_url": "https://glorious-convection.com/"} "422": application/json: {} customers:get: @@ -2493,7 +2652,7 @@ examples: id: "" responses: "200": - application/json: {"created_at": "2024-02-07T13:54:48.821Z", "modified_at": "2023-09-05T11:33:52.011Z", "id": "", "metadata": {"key": 969961, "key1": 450824}, "email": "Creola_Kessler7@gmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Benin"}, "tax_id": ["eu_vat", "mx_rfc"], "organization_id": "", "avatar_url": "https://glorious-fellow.biz"} + application/json: {"created_at": "2025-02-06T13:54:48.821Z", "modified_at": "2024-09-04T11:33:52.011Z", "id": "", "metadata": {"key": 969961, "key1": 450824}, "email": "Creola_Kessler7@gmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Benin"}, "tax_id": ["eu_vat", "mx_rfc"], "organization_id": "", "avatar_url": "https://glorious-fellow.biz"} "404": application/json: {"detail": ""} "422": @@ -2503,9 +2662,11 @@ examples: parameters: path: id: "" + requestBody: + application/json: {} responses: "200": - application/json: {"created_at": "2024-07-28T19:04:48.565Z", "modified_at": "2023-10-17T10:52:42.015Z", "id": "", "metadata": {"key": false}, "email": "Wilson.Treutel31@yahoo.com", "email_verified": true, "name": "", "billing_address": {"country": "Senegal"}, "tax_id": ["", "", "no_voec"], "organization_id": "", "avatar_url": "https://animated-retention.net/"} + application/json: {"created_at": "2025-07-28T19:04:48.565Z", "modified_at": "2024-10-16T10:52:42.015Z", "id": "", "metadata": {"key": false}, "email": "Wilson.Treutel31@yahoo.com", "email_verified": true, "name": "", "billing_address": {"country": "Senegal"}, "tax_id": ["", "", "no_voec"], "organization_id": "", "avatar_url": "https://animated-retention.net/"} "404": application/json: {"detail": ""} "422": @@ -2522,9 +2683,13 @@ examples: application/json: {} customer_portal:benefit-grants:list: speakeasy-default-customer-portal:benefit-grants:list: + parameters: + query: + page: 1 + limit: 10 responses: "200": - application/json: {"items": [{"created_at": "2023-08-23T19:26:20.850Z", "modified_at": "2024-01-14T10:26:00.433Z", "id": "", "granted_at": "2022-07-14T18:23:27.528Z", "revoked_at": "2022-09-09T18:28:08.953Z", "customer_id": "", "benefit_id": "", "subscription_id": "", "order_id": "", "is_granted": true, "is_revoked": false, "benefit": {"created_at": "2023-12-02T18:25:37.169Z", "modified_at": "2022-01-20T06:21:22.156Z", "id": "", "description": "avalanche jungle unto meanwhile beside tromp worth reluctantly", "selectable": true, "deletable": false, "organization_id": "", "organization": {"created_at": "2023-08-20T22:29:27.736Z", "modified_at": "2022-03-15T10:11:56.132Z", "id": "", "name": "", "slug": "", "avatar_url": "https://free-yak.net/", "bio": "", "company": "Hane - Boyer", "blog": "", "location": "", "email": "Isabell_Schroeder@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 948614, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 20615}}, "properties": {"advertisement_campaign_id": ""}}, {"created_at": "2024-12-25T01:40:30.203Z", "modified_at": "2024-03-07T11:07:08.720Z", "id": "", "granted_at": "2024-04-21T16:08:32.154Z", "revoked_at": "2023-03-22T14:01:55.283Z", "customer_id": "", "benefit_id": "", "subscription_id": "", "order_id": "", "is_granted": true, "is_revoked": false, "benefit": {"created_at": "2024-01-25T21:46:28.752Z", "modified_at": "2023-10-26T03:45:41.195Z", "id": "", "description": "ick absent righteously reservation down dramatic", "selectable": true, "deletable": false, "organization_id": "", "organization": {"created_at": "2023-06-21T06:51:31.298Z", "modified_at": "2024-07-07T11:43:51.448Z", "id": "", "name": "", "slug": "", "avatar_url": "https://sorrowful-coil.biz", "bio": "", "company": "Howell - Tremblay", "blog": "", "location": "", "email": "Judah25@gmail.com", "twitter_username": "", "pledge_minimum_amount": 726951, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 895424}, "properties": {"active_files": ["", ""]}}}, {"created_at": "2023-06-11T07:32:02.289Z", "modified_at": "2024-03-21T06:52:57.825Z", "id": "", "granted_at": "2024-07-20T01:34:08.268Z", "revoked_at": "2022-11-06T04:06:54.106Z", "customer_id": "", "benefit_id": "", "subscription_id": "", "order_id": "", "is_granted": true, "is_revoked": true, "benefit": {"created_at": "2022-07-28T12:54:58.990Z", "modified_at": "2024-06-29T11:50:30.649Z", "id": "", "description": "never tooth swelter", "selectable": true, "deletable": false, "organization_id": "", "organization": {"created_at": "2023-03-24T19:09:17.797Z", "modified_at": "2022-09-28T14:04:50.967Z", "id": "", "name": "", "slug": "", "avatar_url": "https://well-lit-fund.org/", "bio": "", "company": "Feest, Johns and Legros", "blog": "", "location": "", "email": "Kaleb_Windler1@gmail.com", "twitter_username": "", "pledge_minimum_amount": 900213, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 536405}, "properties": {"guild_id": ""}}}], "pagination": {"total_count": 900213, "max_page": 29339}} + application/json: {"items": [{"created_at": "2025-01-13T10:26:00.433Z", "modified_at": "2023-07-14T18:23:27.528Z", "id": "", "granted_at": "2023-09-09T18:28:08.953Z", "revoked_at": "2023-06-17T12:14:27.999Z", "customer_id": "", "benefit_id": "", "subscription_id": "", "order_id": "", "is_granted": false, "is_revoked": false, "customer": {"created_at": "2023-01-20T06:21:22.156Z", "modified_at": "2025-02-26T06:14:46.641Z", "id": "", "email": "Annetta_Langosh0@gmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Kuwait"}, "tax_id": [], "oauth_accounts": {"key": {"account_id": "", "account_username": ""}, "key1": {"account_id": "", "account_username": ""}, "key2": {"account_id": "", "account_username": ""}}}, "benefit": {"created_at": "2024-09-13T22:04:07.138Z", "modified_at": "2025-08-18T13:00:42.665Z", "id": "", "description": "unto meanwhile beside tromp worth reluctantly", "selectable": true, "deletable": false, "organization_id": "", "organization": {"created_at": "2024-08-19T22:29:27.736Z", "modified_at": "2023-03-15T10:11:56.132Z", "id": "", "name": "", "slug": "", "avatar_url": "https://free-yak.net/", "bio": "", "company": "Hane - Boyer", "blog": "", "location": "", "email": "Isabell_Schroeder@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 948614, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 20615, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": false, "proration_behavior": "prorate"}}, "properties": {"prefix": "", "expires": {"ttl": 767950, "timeframe": "month"}, "activations": {"limit": 29267, "enable_customer_admin": false}, "limit_usage": 688784}}, "properties": {}}, {"created_at": "2024-03-23T05:46:37.955Z", "modified_at": "2023-02-15T08:57:09.959Z", "id": "", "granted_at": "2025-06-28T00:46:13.804Z", "revoked_at": "2023-12-27T23:30:11.053Z", "customer_id": "", "benefit_id": "", "subscription_id": "", "order_id": "", "is_granted": true, "is_revoked": true, "customer": {"created_at": "2023-05-09T15:43:49.850Z", "modified_at": "2025-10-31T06:20:54.910Z", "id": "", "email": "Henderson.Koch90@hotmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Iran"}, "tax_id": [], "oauth_accounts": {}}, "benefit": {"created_at": "2023-08-31T18:02:52.360Z", "modified_at": "2023-05-16T00:18:50.934Z", "id": "", "description": "reservation down dramatic damp inasmuch unlined monthly lampoon", "selectable": false, "deletable": true, "organization_id": "", "organization": {"created_at": "2024-05-02T02:57:15.201Z", "modified_at": "2024-07-23T23:46:23.843Z", "id": "", "name": "", "slug": "", "avatar_url": "https://energetic-cheese.name", "bio": "", "company": "Mann and Sons", "blog": "", "location": "", "email": "Keon53@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 65720, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 408575, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": true, "proration_behavior": "prorate"}}, "properties": {"prefix": "", "expires": {"ttl": 367314, "timeframe": "day"}, "activations": {"limit": 910479, "enable_customer_admin": true}, "limit_usage": 415930}}, "properties": {}}, {"created_at": "2023-01-22T12:19:34.261Z", "modified_at": "2024-08-12T02:33:31.911Z", "id": "", "granted_at": "2023-07-09T17:20:28.194Z", "revoked_at": "2025-11-21T00:24:26.155Z", "customer_id": "", "benefit_id": "", "subscription_id": "", "order_id": "", "is_granted": false, "is_revoked": true, "customer": {"created_at": "2023-06-03T14:18:34.914Z", "modified_at": "2025-09-13T15:11:12.432Z", "id": "", "email": "Kailyn_Greenfelder@gmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Afghanistan"}, "tax_id": [""], "oauth_accounts": {"key": {"account_id": "", "account_username": ""}}}, "benefit": {"created_at": "2024-08-28T08:32:20.644Z", "modified_at": "2025-09-07T14:10:22.892Z", "id": "", "description": "yuck unbalance cuddly ha plumber hm transcend ack phew", "selectable": true, "deletable": true, "organization_id": "", "organization": {"created_at": "2023-08-21T04:01:37.813Z", "modified_at": "2023-05-11T13:47:55.486Z", "id": "", "name": "", "slug": "", "avatar_url": "https://tedious-video.com", "bio": "", "company": "Dickens and Sons", "blog": "", "location": "", "email": "Benton_Kohler69@gmail.com", "twitter_username": "", "pledge_minimum_amount": 806940, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 858244, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": true, "proration_behavior": "prorate"}}, "properties": {"prefix": "", "expires": {"ttl": 899687, "timeframe": "day"}, "activations": {"limit": 728947, "enable_customer_admin": true}, "limit_usage": 372405}}, "properties": {}}], "pagination": {"total_count": 788480, "max_page": 477827}} "422": application/json: {} customer_portal:benefit-grants:get: @@ -2534,7 +2699,7 @@ examples: id: "" responses: "200": - application/json: {"created_at": "2023-09-05T11:33:52.011Z", "modified_at": "2023-08-20T11:11:04.610Z", "id": "", "granted_at": "2023-07-26T06:33:15.810Z", "revoked_at": "2024-11-29T01:50:48.954Z", "customer_id": "", "benefit_id": "", "subscription_id": "", "order_id": "", "is_granted": true, "is_revoked": true, "benefit": {"created_at": "2022-10-16T00:34:27.106Z", "modified_at": "2022-08-22T22:47:10.166Z", "id": "", "description": "only fellow scary but embarrassment metabolise last huddle after unless", "selectable": true, "deletable": false, "organization_id": "", "organization": {"created_at": "2022-11-11T01:19:41.687Z", "modified_at": "2022-09-18T20:12:25.613Z", "id": "", "name": "", "slug": "", "avatar_url": "https://fantastic-scholarship.net", "bio": "", "company": "Dickens, Koch and Boehm", "blog": "", "location": "", "email": "Tyson.Cummings54@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 491026, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 638700}}, "properties": {"advertisement_campaign_id": ""}} + application/json: {"created_at": "2024-09-04T11:33:52.011Z", "modified_at": "2024-08-19T11:11:04.610Z", "id": "", "granted_at": "2024-07-25T06:33:15.810Z", "revoked_at": "2025-11-29T01:50:48.954Z", "customer_id": "", "benefit_id": "", "subscription_id": "", "order_id": "", "is_granted": true, "is_revoked": true, "customer": {"created_at": "2023-10-16T00:34:27.106Z", "modified_at": "2023-08-22T22:47:10.166Z", "id": "", "email": "Ian.Block31@hotmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Singapore"}, "tax_id": ["mx_rfc"], "oauth_accounts": {"key": {"account_id": "", "account_username": ""}, "key1": {"account_id": "", "account_username": ""}}}, "benefit": {"created_at": "2023-12-20T13:59:56.783Z", "modified_at": "2023-12-21T05:04:07.004Z", "id": "", "description": "unused cone restructure gadzooks", "selectable": false, "deletable": false, "organization_id": "", "organization": {"created_at": "2025-05-29T14:54:03.265Z", "modified_at": "2024-03-11T15:23:46.888Z", "id": "", "name": "", "slug": "", "avatar_url": "https://last-brook.net", "bio": "", "company": "Upton and Sons", "blog": "", "location": "", "email": "Hassan_Robel@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 72108, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 165215, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": false, "proration_behavior": "prorate"}}, "properties": {"image_height": 400, "image_width": 400}}, "properties": {"advertisement_campaign_id": ""}} "404": application/json: {"detail": ""} "422": @@ -2544,9 +2709,11 @@ examples: parameters: path: id: "" + requestBody: + application/json: {} responses: "200": - application/json: {"created_at": "2023-01-13T16:52:57.274Z", "modified_at": "2024-12-22T15:27:45.882Z", "id": "", "granted_at": "2023-11-19T22:44:58.301Z", "revoked_at": "2023-06-20T18:46:17.643Z", "customer_id": "", "benefit_id": "", "subscription_id": "", "order_id": "", "is_granted": false, "is_revoked": true, "benefit": {"created_at": "2024-09-09T13:32:29.600Z", "modified_at": "2023-05-05T18:16:40.936Z", "id": "", "description": "scowl mostly rekindle bleak from", "selectable": true, "deletable": false, "organization_id": "", "organization": {"created_at": "2023-01-06T08:10:12.343Z", "modified_at": "2023-01-18T02:16:35.227Z", "id": "", "name": "", "slug": "", "avatar_url": "https://dazzling-paintwork.org/", "bio": "", "company": "Huel Inc", "blog": "", "location": "", "email": "Rosario20@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 243447, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 198183}, "properties": {"prefix": "", "expires": {"ttl": 338673, "timeframe": "day"}, "activations": {"limit": 175843, "enable_customer_admin": true}, "limit_usage": 332914}}} + application/json: {"created_at": "2024-01-13T16:52:57.274Z", "modified_at": "2025-12-22T15:27:45.882Z", "id": "", "granted_at": "2024-11-18T22:44:58.301Z", "revoked_at": "2024-06-19T18:46:17.643Z", "customer_id": "", "benefit_id": "", "subscription_id": "", "order_id": "", "is_granted": false, "is_revoked": true, "customer": {"created_at": "2025-09-09T13:32:29.600Z", "modified_at": "2024-05-04T18:16:40.936Z", "id": "", "email": "Delphia_Schamberger@gmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Papua New Guinea"}, "tax_id": [""], "oauth_accounts": {"key": {"account_id": "", "account_username": ""}, "key1": {"account_id": "", "account_username": ""}, "key2": {"account_id": "", "account_username": ""}}}, "benefit": {"created_at": "2025-06-07T17:17:15.505Z", "modified_at": "2024-04-26T07:27:10.489Z", "id": "", "description": "rekindle bleak from that qualified cycle woot", "selectable": true, "deletable": true, "organization_id": "", "organization": {"created_at": "2025-08-25T18:26:56.554Z", "modified_at": "2024-04-04T03:41:48.272Z", "id": "", "name": "", "slug": "", "avatar_url": "https://rundown-abacus.info", "bio": "", "company": "Mertz and Sons", "blog": "", "location": "", "email": "Una.Greenfelder@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 249026, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 335191, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": false, "proration_behavior": "prorate"}}, "properties": {"prefix": "", "expires": {"ttl": 463392, "timeframe": "month"}, "activations": {"limit": 58704, "enable_customer_admin": false}, "limit_usage": 326276}}, "properties": {}} "403": application/json: {"detail": ""} "404": @@ -2560,16 +2727,20 @@ examples: id: "" responses: "200": - application/json: {"created_at": "2024-02-07T13:54:48.821Z", "modified_at": "2023-09-05T11:33:52.011Z", "id": "", "email": "Jovanny21@yahoo.com", "email_verified": true, "name": "", "billing_address": {"country": "Sierra Leone"}, "tax_id": [], "oauth_accounts": {}} + application/json: {"created_at": "2025-02-06T13:54:48.821Z", "modified_at": "2024-09-04T11:33:52.011Z", "id": "", "email": "Jovanny21@yahoo.com", "email_verified": true, "name": "", "billing_address": {"country": "Sierra Leone"}, "tax_id": [], "oauth_accounts": {}} "404": application/json: {"detail": ""} "422": application/json: {} customer_portal:downloadables:list: speakeasy-default-customer-portal:downloadables:list: + parameters: + query: + page: 1 + limit: 10 responses: "200": - application/json: {"items": [{"id": "", "benefit_id": "", "file": {"id": "", "organization_id": "", "name": "", "path": "/root", "mime_type": "", "size": 678317, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-07-14T18:23:27.528Z", "download": {"url": "https://crooked-overload.name/", "expires_at": "2022-01-20T06:21:22.156Z"}, "version": "", "is_uploaded": false, "service": "downloadable", "size_readable": ""}}, {"id": "", "benefit_id": "", "file": {"id": "", "organization_id": "", "name": "", "path": "/dev", "mime_type": "", "size": 687960, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-07-13T19:57:33.016Z", "download": {"url": "https://acidic-avalanche.info", "expires_at": "2023-06-17T08:36:51.636Z"}, "version": "", "is_uploaded": true, "service": "organization_avatar", "size_readable": ""}}, {"id": "", "benefit_id": "", "file": {"id": "", "organization_id": "", "name": "", "path": "/selinux", "mime_type": "", "size": 876407, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-06-22T03:00:04.393Z", "download": {"url": "https://glorious-strategy.com/", "expires_at": "2024-09-10T07:49:25.657Z"}, "version": "", "is_uploaded": true, "service": "organization_avatar", "size_readable": ""}}], "pagination": {"total_count": 173090, "max_page": 75058}} + application/json: {"items": [{"id": "", "benefit_id": "", "file": {"id": "", "organization_id": "", "name": "", "path": "/root", "mime_type": "", "size": 678317, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-07-14T18:23:27.528Z", "download": {"url": "https://crooked-overload.name/", "expires_at": "2023-01-20T06:21:22.156Z"}, "version": "", "is_uploaded": false, "service": "downloadable", "size_readable": ""}}, {"id": "", "benefit_id": "", "file": {"id": "", "organization_id": "", "name": "", "path": "/dev", "mime_type": "", "size": 687960, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-07-12T19:57:33.016Z", "download": {"url": "https://acidic-avalanche.info", "expires_at": "2024-06-16T08:36:51.636Z"}, "version": "", "is_uploaded": true, "service": "organization_avatar", "size_readable": ""}}, {"id": "", "benefit_id": "", "file": {"id": "", "organization_id": "", "name": "", "path": "/selinux", "mime_type": "", "size": 876407, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-06-21T03:00:04.393Z", "download": {"url": "https://glorious-strategy.com/", "expires_at": "2025-09-10T07:49:25.657Z"}, "version": "", "is_uploaded": true, "service": "organization_avatar", "size_readable": ""}}], "pagination": {"total_count": 173090, "max_page": 75058}} "422": application/json: {} customer_portal:downloadables:customer_portal.downloadables.get: @@ -2584,9 +2755,13 @@ examples: application/json: {} customer_portal:license_keys:list: speakeasy-default-customer-portal:license-keys:list: + parameters: + query: + page: 1 + limit: 10 responses: "200": - application/json: {"items": [{"id": "", "organization_id": "", "user_id": "", "customer_id": "", "user": {"id": "", "email": "Marie.Fay@yahoo.com", "public_name": ""}, "customer": {"created_at": "2022-01-20T06:21:22.156Z", "modified_at": "2024-02-27T06:14:46.641Z", "id": "", "metadata": {}, "email": "Martin.Nader@gmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Bangladesh"}, "tax_id": ["sv_nit", "", ""], "organization_id": "", "avatar_url": "https://torn-affiliate.org/"}, "benefit_id": "", "key": "", "display_key": "", "status": "revoked", "limit_activations": 913465, "usage": 173090, "limit_usage": 75058, "validations": 897069, "last_validated_at": "2022-05-29T14:05:29.727Z", "expires_at": "2023-05-20T11:06:26.987Z"}, {"id": "", "organization_id": "", "user_id": "", "customer_id": "", "user": {"id": "", "email": "Hope_Brakus@yahoo.com", "public_name": ""}, "customer": {"created_at": "2024-08-04T08:35:41.482Z", "modified_at": "2022-12-03T21:35:05.453Z", "id": "", "metadata": {"key": ""}, "email": "Tatyana_Murphy91@gmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Mauritius"}, "tax_id": ["za_vat", "", ""], "organization_id": "", "avatar_url": "https://tasty-sarong.com/"}, "benefit_id": "", "key": "", "display_key": "", "status": "revoked", "limit_activations": 284580, "usage": 781409, "limit_usage": 544651, "validations": 66993, "last_validated_at": "2022-03-08T17:05:22.411Z", "expires_at": "2022-11-19T07:34:10.466Z"}, {"id": "", "organization_id": "", "user_id": "", "customer_id": "", "user": {"id": "", "email": "Neha.Hane@hotmail.com", "public_name": ""}, "customer": {"created_at": "2022-01-06T17:33:20.863Z", "modified_at": "2024-06-07T14:29:00.429Z", "id": "", "metadata": {"key": false, "key1": true, "key2": ""}, "email": "Zackery.Runte@yahoo.com", "email_verified": false, "name": "", "billing_address": {"country": "Morocco"}, "tax_id": [""], "organization_id": "", "avatar_url": "https://graceful-halt.com"}, "benefit_id": "", "key": "", "display_key": "", "status": "granted", "limit_activations": 943672, "usage": 988711, "limit_usage": 422943, "validations": 370293, "last_validated_at": "2023-05-17T08:33:13.471Z", "expires_at": "2022-08-22T08:40:22.005Z"}], "pagination": {"total_count": 900911, "max_page": 50388}} + application/json: {"items": [{"id": "", "organization_id": "", "user_id": "", "customer_id": "", "user": {"id": "", "email": "Marie.Fay@yahoo.com", "public_name": ""}, "customer": {"created_at": "2023-01-20T06:21:22.156Z", "modified_at": "2025-02-26T06:14:46.641Z", "id": "", "metadata": {}, "email": "Martin.Nader@gmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Bangladesh"}, "tax_id": ["sv_nit", "", ""], "organization_id": "", "avatar_url": "https://torn-affiliate.org/"}, "benefit_id": "", "key": "", "display_key": "", "status": "revoked", "limit_activations": 913465, "usage": 173090, "limit_usage": 75058, "validations": 897069, "last_validated_at": "2023-05-29T14:05:29.727Z", "expires_at": "2024-05-19T11:06:26.987Z"}, {"id": "", "organization_id": "", "user_id": "", "customer_id": "", "user": {"id": "", "email": "Hope_Brakus@yahoo.com", "public_name": ""}, "customer": {"created_at": "2025-08-04T08:35:41.482Z", "modified_at": "2023-12-03T21:35:05.453Z", "id": "", "metadata": {"key": ""}, "email": "Tatyana_Murphy91@gmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Mauritius"}, "tax_id": ["za_vat", "", ""], "organization_id": "", "avatar_url": "https://tasty-sarong.com/"}, "benefit_id": "", "key": "", "display_key": "", "status": "revoked", "limit_activations": 284580, "usage": 781409, "limit_usage": 544651, "validations": 66993, "last_validated_at": "2023-03-08T17:05:22.411Z", "expires_at": "2023-11-19T07:34:10.466Z"}, {"id": "", "organization_id": "", "user_id": "", "customer_id": "", "user": {"id": "", "email": "Neha.Hane@hotmail.com", "public_name": ""}, "customer": {"created_at": "2023-01-06T17:33:20.863Z", "modified_at": "2025-06-07T14:29:00.429Z", "id": "", "metadata": {"key": false, "key1": false, "key2": ""}, "email": "Zackery.Runte@yahoo.com", "email_verified": false, "name": "", "billing_address": {"country": "Morocco"}, "tax_id": [""], "organization_id": "", "avatar_url": "https://graceful-halt.com"}, "benefit_id": "", "key": "", "display_key": "", "status": "granted", "limit_activations": 943672, "usage": 988711, "limit_usage": 422943, "validations": 370293, "last_validated_at": "2024-05-16T08:33:13.471Z", "expires_at": "2023-08-22T08:40:22.005Z"}], "pagination": {"total_count": 900911, "max_page": 50388}} "401": application/json: {"detail": ""} "404": @@ -2600,7 +2775,7 @@ examples: id: "" responses: "200": - application/json: {"id": "", "organization_id": "", "user_id": "", "customer_id": "", "user": {"id": "", "email": "Keeley_Lebsack@hotmail.com", "public_name": ""}, "customer": {"created_at": "2022-10-16T00:34:27.106Z", "modified_at": "2022-08-22T22:47:10.166Z", "id": "", "metadata": {"key": 801373, "key1": "", "key2": ""}, "email": "Aurelio.Schoen@gmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Gabon"}, "tax_id": [""], "organization_id": "", "avatar_url": "https://sparse-edge.net/"}, "benefit_id": "", "key": "", "display_key": "", "status": "disabled", "limit_activations": 710500, "usage": 909118, "limit_usage": 324692, "validations": 32069, "last_validated_at": "2024-11-21T18:15:13.381Z", "expires_at": "2023-05-03T12:57:21.117Z", "activations": [{"id": "", "license_key_id": "", "label": "", "created_at": "2022-05-26T16:57:22.796Z", "modified_at": "2022-06-25T00:21:23.098Z"}]} + application/json: {"id": "", "organization_id": "", "user_id": "", "customer_id": "", "user": {"id": "", "email": "Keeley_Lebsack@hotmail.com", "public_name": ""}, "customer": {"created_at": "2023-10-16T00:34:27.106Z", "modified_at": "2023-08-22T22:47:10.166Z", "id": "", "metadata": {"key": 801373, "key1": "", "key2": ""}, "email": "Aurelio.Schoen@gmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Gabon"}, "tax_id": [""], "organization_id": "", "avatar_url": "https://sparse-edge.net/"}, "benefit_id": "", "key": "", "display_key": "", "status": "disabled", "limit_activations": 710500, "usage": 909118, "limit_usage": 324692, "validations": 32069, "last_validated_at": "2025-11-21T18:15:13.381Z", "expires_at": "2024-05-02T12:57:21.117Z", "activations": [{"id": "", "license_key_id": "", "label": "", "meta": {}, "created_at": "2023-05-26T16:57:22.796Z", "modified_at": "2023-06-25T00:21:23.098Z"}]} "404": application/json: {"detail": ""} "422": @@ -2611,7 +2786,7 @@ examples: application/json: {"key": "", "organization_id": ""} responses: "200": - application/json: {"id": "", "organization_id": "", "user_id": "", "customer_id": "", "user": {"id": "", "email": "Clotilde.Frami@hotmail.com", "public_name": ""}, "customer": {"created_at": "2023-06-20T08:52:32.019Z", "modified_at": "2022-01-16T10:18:54.359Z", "id": "", "metadata": {"key": 495384, "key1": 982092, "key2": true}, "email": "Garrett.Gottlieb-Mayer@hotmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Gambia"}, "tax_id": ["", "", ""], "organization_id": "", "avatar_url": "https://sore-meal.name"}, "benefit_id": "", "key": "", "display_key": "", "status": "granted", "limit_activations": 583538, "usage": 399852, "limit_usage": 903429, "validations": 426755, "last_validated_at": "2024-12-01T23:16:48.830Z", "expires_at": "2024-12-29T17:14:08.855Z"} + application/json: {"id": "", "organization_id": "", "user_id": "", "customer_id": "", "user": {"id": "", "email": "Clotilde.Frami@hotmail.com", "public_name": ""}, "customer": {"created_at": "2024-06-19T08:52:32.019Z", "modified_at": "2023-01-16T10:18:54.359Z", "id": "", "metadata": {"key": 495384, "key1": 982092, "key2": false}, "email": "Garrett.Gottlieb-Mayer@hotmail.com", "email_verified": false, "name": "", "billing_address": {"country": "Gambia"}, "tax_id": ["", "", ""], "organization_id": "", "avatar_url": "https://sore-meal.name"}, "benefit_id": "", "key": "", "display_key": "", "status": "granted", "limit_activations": 583538, "usage": 399852, "limit_usage": 903429, "validations": 426755, "last_validated_at": "2025-12-01T23:16:48.830Z", "expires_at": "2025-12-29T17:14:08.855Z"} "404": application/json: {"detail": ""} "422": @@ -2622,7 +2797,7 @@ examples: application/json: {"key": "", "organization_id": "", "label": ""} responses: "200": - application/json: {"id": "", "license_key_id": "", "label": "", "created_at": "2023-08-13T13:11:06.353Z", "modified_at": "2022-07-31T16:19:56.063Z", "license_key": {"id": "", "organization_id": "", "user_id": "", "customer_id": "", "user": {"id": "", "email": "Katelynn.Schoen@hotmail.com", "public_name": ""}, "customer": {"created_at": "2023-05-18T10:55:35.861Z", "modified_at": "2024-10-24T06:01:44.424Z", "id": "", "metadata": {"key": "", "key1": 296877, "key2": 92223}, "email": "Manley29@yahoo.com", "email_verified": true, "name": "", "billing_address": {"country": "Nepal"}, "tax_id": ["za_vat", ""], "organization_id": "", "avatar_url": "https://lucky-cod.biz"}, "benefit_id": "", "key": "", "display_key": "", "status": "revoked", "limit_activations": 820152, "usage": 553354, "limit_usage": 520631, "validations": 78695, "last_validated_at": "2024-02-04T09:57:04.431Z", "expires_at": "2023-02-01T10:51:15.981Z"}} + application/json: {"id": "", "license_key_id": "", "label": "", "meta": {}, "created_at": "2024-08-12T13:11:06.353Z", "modified_at": "2023-07-31T16:19:56.063Z", "license_key": {"id": "", "organization_id": "", "user_id": "", "customer_id": "", "user": {"id": "", "email": "Katelynn.Schoen@hotmail.com", "public_name": ""}, "customer": {"created_at": "2024-05-17T10:55:35.861Z", "modified_at": "2025-10-24T06:01:44.424Z", "id": "", "metadata": {"key": "", "key1": 296877, "key2": 92223}, "email": "Manley29@yahoo.com", "email_verified": true, "name": "", "billing_address": {"country": "Nepal"}, "tax_id": ["za_vat", ""], "organization_id": "", "avatar_url": "https://lucky-cod.biz"}, "benefit_id": "", "key": "", "display_key": "", "status": "revoked", "limit_activations": 820152, "usage": 553354, "limit_usage": 520631, "validations": 78695, "last_validated_at": "2025-02-03T09:57:04.431Z", "expires_at": "2024-02-01T10:51:15.981Z"}} "403": application/json: {"detail": ""} "404": @@ -2640,9 +2815,13 @@ examples: application/json: {} customer_portal:orders:list: speakeasy-default-customer-portal:orders:list: + parameters: + query: + page: 1 + limit: 10 responses: "200": - application/json: {"items": [{"created_at": "2023-08-23T19:26:20.850Z", "modified_at": "2024-01-14T10:26:00.433Z", "id": "", "amount": 177706, "tax_amount": 229716, "currency": "Belize Dollar", "customer_id": "", "product_id": "", "product_price_id": "", "subscription_id": "", "user_id": "", "product": {"created_at": "2023-11-28T13:02:27.296Z", "modified_at": "2023-12-02T18:25:37.169Z", "id": "", "name": "", "description": "accountability pish likewise", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [], "benefits": [{"created_at": "2022-05-29T14:05:29.727Z", "modified_at": "2023-05-20T11:06:26.987Z", "id": "", "type": "discord", "description": "beside tromp worth reluctantly wound accompanist", "selectable": false, "deletable": false, "organization_id": ""}, {"created_at": "2024-05-02T01:42:40.060Z", "modified_at": "2023-07-09T07:59:15.466Z", "id": "", "type": "license_keys", "description": "angrily inasmuch irritably finally round alongside whoever jump joyfully discourse", "selectable": false, "deletable": false, "organization_id": ""}, {"created_at": "2024-06-02T11:43:36.892Z", "modified_at": "2024-09-08T09:13:39.168Z", "id": "", "type": "downloadables", "description": "finally earth that early", "selectable": false, "deletable": false, "organization_id": ""}], "medias": [], "organization": {"created_at": "2023-12-12T21:57:01.257Z", "modified_at": "2023-03-24T19:09:17.797Z", "id": "", "name": "", "slug": "", "avatar_url": "https://acceptable-validity.info/", "bio": "", "company": "Vandervort, Feest and Johns", "blog": "", "location": "", "email": "Aimee_DAmore62@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 140142, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 29339}}, "product_price": {"created_at": "2024-01-14T10:26:00.433Z", "modified_at": "2022-07-14T18:23:27.528Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 152837, "maximum_amount": 635532, "preset_amount": 639387}, "subscription": {"created_at": "2023-04-28T12:09:29.137Z", "modified_at": "2023-03-31T01:03:36.657Z", "id": "", "amount": 253529, "currency": "Tugrik", "recurring_interval": "year", "status": "canceled", "current_period_start": "2022-06-16T22:11:32.719Z", "current_period_end": "2024-10-03T23:44:36.269Z", "cancel_at_period_end": false, "started_at": "2023-06-19T04:12:45.071Z", "ended_at": "2024-12-03T09:47:00.347Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": ""}}, {"created_at": "2022-09-13T06:39:19.968Z", "modified_at": "2022-01-21T07:06:12.853Z", "id": "", "amount": 197777, "tax_amount": 621450, "currency": "Manat", "customer_id": "", "product_id": "", "product_price_id": "", "subscription_id": "", "user_id": "", "product": {"created_at": "2024-08-19T10:34:27.488Z", "modified_at": "2024-04-21T05:31:02.040Z", "id": "", "name": "", "description": "what married owlishly which wonderfully CD", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2022-04-05T09:49:38.010Z", "modified_at": "2022-03-17T01:57:00.187Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "year"}], "benefits": [{"created_at": "2024-07-09T08:01:51.932Z", "modified_at": "2024-11-27T17:23:02.117Z", "id": "", "type": "custom", "description": "till boo ack solicit weakly segregate boo", "selectable": true, "deletable": false, "organization_id": ""}, {"created_at": "2024-10-06T07:08:41.329Z", "modified_at": "2024-12-31T08:16:04.009Z", "id": "", "type": "custom", "description": "opposite amnesty tomography how until to onto ouch shrilly ramp", "selectable": true, "deletable": false, "organization_id": ""}, {"created_at": "2022-09-15T23:31:11.246Z", "modified_at": "2024-10-29T11:50:25.062Z", "id": "", "type": "discord", "description": "icy council meanwhile except following ick verbally drat", "selectable": false, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/etc/mail", "mime_type": "", "size": 993741, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-11-16T01:22:49.169Z", "version": "", "is_uploaded": false, "created_at": "2023-12-09T05:38:21.152Z", "size_readable": "", "public_url": "https://tender-squid.org"}, {"id": "", "organization_id": "", "name": "", "path": "/usr", "mime_type": "", "size": 440830, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-06-16T08:19:05.026Z", "version": "", "is_uploaded": false, "created_at": "2024-07-16T11:55:05.618Z", "size_readable": "", "public_url": "https://unwelcome-license.org"}], "organization": {"created_at": "2024-05-28T03:27:06.201Z", "modified_at": "2024-08-23T10:37:24.845Z", "id": "", "name": "", "slug": "", "avatar_url": "https://plump-horde.com", "bio": "", "company": "Pfeffer - Bruen", "blog": "", "location": "", "email": "Adolf17@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 73002, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 443316}}, "product_price": {"created_at": "2022-03-01T20:22:54.911Z", "modified_at": "2023-02-08T01:09:52.088Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 73227}, "subscription": {"created_at": "2024-01-16T02:12:31.415Z", "modified_at": "2024-04-24T19:54:59.989Z", "id": "", "amount": 537373, "currency": "Moldovan Leu", "recurring_interval": "year", "status": "past_due", "current_period_start": "2023-09-01T03:57:12.777Z", "current_period_end": "2024-03-30T11:09:26.643Z", "cancel_at_period_end": false, "started_at": "2024-03-07T05:10:23.090Z", "ended_at": "2023-06-12T11:22:18.392Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": ""}}, {"created_at": "2023-04-27T04:18:19.309Z", "modified_at": "2023-01-21T09:29:51.966Z", "id": "", "amount": 213662, "tax_amount": 898170, "currency": "Comoro Franc", "customer_id": "", "product_id": "", "product_price_id": "", "subscription_id": "", "user_id": "", "product": {"created_at": "2023-07-09T08:27:04.982Z", "modified_at": "2024-03-05T15:08:11.722Z", "id": "", "name": "", "description": "boo larva homely commonly grass", "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [], "benefits": [{"created_at": "2024-10-22T23:23:39.791Z", "modified_at": "2023-05-30T02:21:30.439Z", "id": "", "type": "ads", "description": "blowgun zowie yahoo on drum dusk rightfully finally", "selectable": true, "deletable": true, "organization_id": ""}, {"created_at": "2023-11-26T06:16:53.741Z", "modified_at": "2022-02-25T14:48:29.331Z", "id": "", "type": "license_keys", "description": "technician jaggedly scarcely honestly submitter", "selectable": true, "deletable": false, "organization_id": ""}, {"created_at": "2024-05-26T16:28:35.656Z", "modified_at": "2022-08-22T17:51:41.532Z", "id": "", "type": "custom", "description": "aw ew once underneath mid impressionable jovially", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/mnt", "mime_type": "", "size": 196134, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-04-13T21:18:45.526Z", "version": "", "is_uploaded": true, "created_at": "2024-01-14T08:44:55.565Z", "size_readable": "", "public_url": "https://oddball-cricket.name"}], "organization": {"created_at": "2022-06-11T01:25:26.848Z", "modified_at": "2022-04-01T21:39:44.500Z", "id": "", "name": "", "slug": "", "avatar_url": "https://helpful-barracks.org/", "bio": "", "company": "Schmidt, Ferry and Cormier", "blog": "", "location": "", "email": "Irma_McCullough30@gmail.com", "twitter_username": "", "pledge_minimum_amount": 974, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 206014}}, "product_price": {"created_at": "2024-08-18T13:00:42.665Z", "modified_at": "2023-06-22T03:00:04.393Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 322596, "maximum_amount": 860596, "preset_amount": 18278}, "subscription": {"created_at": "2023-01-19T21:34:42.876Z", "modified_at": "2024-08-07T03:26:01.283Z", "id": "", "amount": 772002, "currency": "Malaysian Ringgit", "recurring_interval": "year", "status": "past_due", "current_period_start": "2022-02-25T21:21:59.049Z", "current_period_end": "2024-02-14T12:44:36.784Z", "cancel_at_period_end": true, "started_at": "2023-06-19T20:01:25.362Z", "ended_at": "2022-11-08T22:14:18.852Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": ""}}], "pagination": {"total_count": 584415, "max_page": 883301}} + application/json: {"items": [{"created_at": "2024-08-22T19:26:20.850Z", "modified_at": "2025-01-13T10:26:00.433Z", "id": "", "amount": 177706, "tax_amount": 229716, "currency": "Belize Dollar", "customer_id": "", "product_id": "", "product_price_id": "", "subscription_id": "", "user_id": "", "product": {"created_at": "2024-11-27T13:02:27.296Z", "modified_at": "2024-12-01T18:25:37.169Z", "id": "", "name": "", "description": "accountability pish likewise", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [], "benefits": [{"created_at": "2023-05-29T14:05:29.727Z", "modified_at": "2024-05-19T11:06:26.987Z", "id": "", "type": "discord", "description": "beside tromp worth reluctantly wound accompanist", "selectable": false, "deletable": false, "organization_id": ""}, {"created_at": "2025-05-02T01:42:40.060Z", "modified_at": "2024-07-08T07:59:15.466Z", "id": "", "type": "license_keys", "description": "angrily inasmuch irritably finally round alongside whoever jump joyfully discourse", "selectable": false, "deletable": false, "organization_id": ""}, {"created_at": "2025-06-02T11:43:36.892Z", "modified_at": "2025-09-08T09:13:39.168Z", "id": "", "type": "downloadables", "description": "finally earth that early", "selectable": false, "deletable": false, "organization_id": ""}], "medias": [], "organization": {"created_at": "2024-12-11T21:57:01.257Z", "modified_at": "2024-03-23T19:09:17.797Z", "id": "", "name": "", "slug": "", "avatar_url": "https://acceptable-validity.info/", "bio": "", "company": "Vandervort, Feest and Johns", "blog": "", "location": "", "email": "Aimee_DAmore62@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 140142, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 29339, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": true, "proration_behavior": "invoice"}}}, "product_price": {"created_at": "2024-09-07T00:17:39.154Z", "modified_at": "2023-08-16T15:42:00.686Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 440243, "maximum_amount": 414274, "preset_amount": 253529}, "subscription": {"created_at": "2024-08-28T08:32:20.644Z", "modified_at": "2025-09-07T14:10:22.892Z", "id": "", "amount": 810689, "currency": "Belize Dollar", "recurring_interval": "year", "status": "canceled", "current_period_start": "2024-06-18T04:12:45.071Z", "current_period_end": "2025-12-03T09:47:00.347Z", "cancel_at_period_end": true, "canceled_at": "2023-01-21T07:06:12.853Z", "started_at": "2023-08-05T18:20:08.987Z", "ends_at": "2024-11-12T02:36:59.348Z", "ended_at": "2025-07-01T16:47:46.535Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "other", "customer_cancellation_comment": ""}}, {"created_at": "2025-04-21T05:31:02.040Z", "modified_at": "2024-03-28T11:42:09.368Z", "id": "", "amount": 942258, "tax_amount": 282049, "currency": "Gourde", "customer_id": "", "product_id": "", "product_price_id": "", "subscription_id": "", "user_id": "", "product": {"created_at": "2025-06-23T03:47:51.468Z", "modified_at": "2024-09-11T13:10:32.933Z", "id": "", "name": "", "description": "widow less if cuckoo ack so", "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2023-05-11T13:47:55.486Z", "modified_at": "2025-07-04T09:28:02.624Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 968727, "recurring_interval": "month"}], "benefits": [{"created_at": "2023-07-28T05:18:58.410Z", "modified_at": "2025-09-05T07:44:59.336Z", "id": "", "type": "ads", "description": "distinction range flood", "selectable": false, "deletable": true, "organization_id": ""}, {"created_at": "2025-07-12T11:27:51.614Z", "modified_at": "2025-03-30T00:07:45.253Z", "id": "", "type": "github_repository", "description": "excluding sightseeing up so pro pish", "selectable": false, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/usr/bin", "mime_type": "", "size": 682370, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-07-06T18:31:24.280Z", "version": "", "is_uploaded": true, "created_at": "2023-10-25T16:33:13.224Z", "size_readable": "", "public_url": "https://finished-procurement.biz"}, {"id": "", "organization_id": "", "name": "", "path": "/usr/ports", "mime_type": "", "size": 147047, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-06-15T02:57:43.819Z", "version": "", "is_uploaded": true, "created_at": "2025-02-17T15:05:38.382Z", "size_readable": "", "public_url": "https://evil-wedding.name/"}, {"id": "", "organization_id": "", "name": "", "path": "/bin", "mime_type": "", "size": 393279, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-07-14T03:52:58.280Z", "version": "", "is_uploaded": false, "created_at": "2023-11-08T22:51:52.592Z", "size_readable": "", "public_url": "https://monumental-director.biz"}], "organization": {"created_at": "2024-12-10T13:25:02.054Z", "modified_at": "2023-03-12T10:18:32.792Z", "id": "", "name": "", "slug": "", "avatar_url": "https://usable-disconnection.biz", "bio": "", "company": "Robel - Rowe", "blog": "", "location": "", "email": "Jeremy73@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 291784, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 955132, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": false, "proration_behavior": "prorate"}}}, "product_price": {"created_at": "2023-09-15T23:31:11.246Z", "modified_at": "2025-10-29T11:50:25.062Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "year"}, "subscription": {"created_at": "2023-09-17T17:12:34.050Z", "modified_at": "2025-06-14T21:21:53.369Z", "id": "", "amount": 358849, "currency": "Sri Lanka Rupee", "recurring_interval": "year", "status": "unpaid", "current_period_start": "2024-02-23T23:44:40.827Z", "current_period_end": "2023-04-06T05:41:10.109Z", "cancel_at_period_end": true, "canceled_at": "2024-01-19T22:50:38.991Z", "started_at": "2024-07-22T06:43:38.498Z", "ends_at": "2025-11-01T20:47:26.029Z", "ended_at": "2024-06-30T05:56:59.196Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "low_quality", "customer_cancellation_comment": ""}}, {"created_at": "2023-02-21T11:53:00.306Z", "modified_at": "2023-12-08T03:17:39.708Z", "id": "", "amount": 668554, "tax_amount": 50847, "currency": "Balboa", "customer_id": "", "product_id": "", "product_price_id": "", "subscription_id": "", "user_id": "", "product": {"created_at": "2023-08-12T15:15:51.578Z", "modified_at": "2024-05-03T11:56:14.302Z", "id": "", "name": "", "description": "ew ack formula", "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2025-10-07T12:14:45.651Z", "modified_at": "2025-08-07T16:09:30.509Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 367737, "recurring_interval": "month"}, {"created_at": "2024-05-06T15:47:36.270Z", "modified_at": "2025-11-17T16:20:28.397Z", "id": "", "is_archived": false, "product_id": ""}], "benefits": [{"created_at": "2023-05-25T14:23:25.427Z", "modified_at": "2025-12-25T03:21:22.140Z", "id": "", "type": "github_repository", "description": "joyous upbeat pfft ouch barring motor severe labourer", "selectable": false, "deletable": true, "organization_id": ""}, {"created_at": "2025-06-20T20:39:56.038Z", "modified_at": "2025-02-23T13:40:33.504Z", "id": "", "type": "ads", "description": "as er polished whether welcome deck gratefully", "selectable": false, "deletable": true, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/var", "mime_type": "", "size": 650946, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-10-09T07:21:47.148Z", "version": "", "is_uploaded": true, "created_at": "2023-04-15T11:16:29.756Z", "size_readable": "", "public_url": "https://prudent-glider.net/"}, {"id": "", "organization_id": "", "name": "", "path": "/root", "mime_type": "", "size": 571921, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-03-17T01:40:00.319Z", "version": "", "is_uploaded": true, "created_at": "2024-03-30T00:13:32.477Z", "size_readable": "", "public_url": "https://gracious-obesity.biz"}], "organization": {"created_at": "2025-09-30T03:31:07.896Z", "modified_at": "2023-12-08T06:21:02.247Z", "id": "", "name": "", "slug": "", "avatar_url": "https://fine-independence.biz", "bio": "", "company": "Nicolas LLC", "blog": "", "location": "", "email": "Drew9@gmail.com", "twitter_username": "", "pledge_minimum_amount": 267057, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 510593, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": false, "proration_behavior": "invoice"}}}, "product_price": {"created_at": "2023-08-03T11:15:58.409Z", "modified_at": "2024-04-13T07:36:48.420Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 633451, "maximum_amount": 50745, "preset_amount": 947132, "recurring_interval": "month"}, "subscription": {"created_at": "2023-01-05T04:04:43.881Z", "modified_at": "2024-06-08T21:14:34.541Z", "id": "", "amount": 355576, "currency": "Singapore Dollar", "recurring_interval": "year", "status": "active", "current_period_start": "2025-09-09T02:23:31.754Z", "current_period_end": "2025-12-05T18:43:14.862Z", "cancel_at_period_end": false, "canceled_at": "2024-07-26T13:39:28.807Z", "started_at": "2025-12-08T02:23:12.655Z", "ends_at": "2023-03-22T15:36:05.437Z", "ended_at": "2023-10-15T22:44:40.264Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "missing_features", "customer_cancellation_comment": ""}}], "pagination": {"total_count": 427197, "max_page": 765317}} "422": application/json: {} customer_portal:orders:get: @@ -2652,7 +2831,7 @@ examples: id: "" responses: "200": - application/json: {"created_at": "2024-02-07T13:54:48.821Z", "modified_at": "2023-09-05T11:33:52.011Z", "id": "", "amount": 544221, "tax_amount": 521235, "currency": "Rand", "customer_id": "", "product_id": "", "product_price_id": "", "subscription_id": "", "user_id": "", "product": {"created_at": "2023-05-18T00:32:02.244Z", "modified_at": "2023-05-10T02:28:23.533Z", "id": "", "name": "", "description": "extract neaten qua meanwhile bah", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2023-08-20T11:11:04.610Z", "modified_at": "2023-07-26T06:33:15.810Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 458049, "maximum_amount": 450824, "preset_amount": 262795}, {"created_at": "2023-04-26T04:53:50.189Z", "modified_at": "2024-05-28T07:17:57.134Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "month"}], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/opt/include", "mime_type": "", "size": 908293, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-04-06T10:37:18.493Z", "version": "", "is_uploaded": false, "created_at": "2023-04-01T04:11:43.083Z", "size_readable": "", "public_url": "https://shy-knuckle.org/"}, {"id": "", "organization_id": "", "name": "", "path": "/private/var", "mime_type": "", "size": 72108, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-03-31T04:26:02.125Z", "version": "", "is_uploaded": true, "created_at": "2023-12-13T10:59:52.193Z", "size_readable": "", "public_url": "https://writhing-airman.name"}], "organization": {"created_at": "2024-01-25T20:29:18.334Z", "modified_at": "2022-11-17T13:07:10.938Z", "id": "", "name": "", "slug": "", "avatar_url": "https://foolish-descendant.net", "bio": "", "company": "Schaefer - Sawayn", "blog": "", "location": "", "email": "Citlalli.Boehm@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 168726, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 546533}}, "product_price": {"created_at": "2023-08-29T15:06:35.685Z", "modified_at": "2024-06-02T05:45:06.910Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 746585, "recurring_interval": "year"}, "subscription": {"created_at": "2022-02-04T11:10:26.128Z", "modified_at": "2023-01-08T11:20:01.925Z", "id": "", "amount": 844917, "currency": "Moldovan Leu", "recurring_interval": "year", "status": "canceled", "current_period_start": "2023-01-20T11:46:53.929Z", "current_period_end": "2023-08-09T16:26:13.017Z", "cancel_at_period_end": false, "started_at": "2024-09-27T20:59:18.499Z", "ended_at": "2022-08-28T17:52:37.706Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": ""}} + application/json: {"created_at": "2025-02-06T13:54:48.821Z", "modified_at": "2024-09-04T11:33:52.011Z", "id": "", "amount": 544221, "tax_amount": 521235, "currency": "Rand", "customer_id": "", "product_id": "", "product_price_id": "", "subscription_id": "", "user_id": "", "product": {"created_at": "2024-05-17T00:32:02.244Z", "modified_at": "2024-05-09T02:28:23.533Z", "id": "", "name": "", "description": "extract neaten qua meanwhile bah", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2024-02-26T18:55:59.898Z", "modified_at": "2023-04-10T19:02:17.424Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 508887, "maximum_amount": 656841, "preset_amount": 570980}, {"created_at": "2024-03-11T15:23:46.888Z", "modified_at": "2025-03-05T14:23:34.462Z", "id": "", "is_archived": true, "product_id": ""}], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/opt/include", "mime_type": "", "size": 908293, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-04-06T10:37:18.493Z", "version": "", "is_uploaded": false, "created_at": "2024-03-31T04:11:43.083Z", "size_readable": "", "public_url": "https://shy-knuckle.org/"}, {"id": "", "organization_id": "", "name": "", "path": "/private/var", "mime_type": "", "size": 72108, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-03-31T04:26:02.125Z", "version": "", "is_uploaded": true, "created_at": "2024-12-12T10:59:52.193Z", "size_readable": "", "public_url": "https://writhing-airman.name"}], "organization": {"created_at": "2025-01-24T20:29:18.334Z", "modified_at": "2023-11-17T13:07:10.938Z", "id": "", "name": "", "slug": "", "avatar_url": "https://foolish-descendant.net", "bio": "", "company": "Schaefer - Sawayn", "blog": "", "location": "", "email": "Citlalli.Boehm@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 168726, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 546533, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": true, "proration_behavior": "prorate"}}}, "product_price": {"created_at": "2025-12-04T14:13:02.442Z", "modified_at": "2024-08-22T17:07:10.826Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 972276}, "subscription": {"created_at": "2023-02-04T11:10:26.128Z", "modified_at": "2024-01-08T11:20:01.925Z", "id": "", "amount": 844917, "currency": "Moldovan Leu", "recurring_interval": "year", "status": "canceled", "current_period_start": "2024-01-20T11:46:53.929Z", "current_period_end": "2024-08-08T16:26:13.017Z", "cancel_at_period_end": false, "canceled_at": "2025-09-27T20:59:18.499Z", "started_at": "2023-08-28T17:52:37.706Z", "ends_at": "2024-08-08T00:55:49.489Z", "ended_at": "2023-03-22T21:11:05.801Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "other", "customer_cancellation_comment": ""}} "404": application/json: {"detail": ""} "422": @@ -2676,16 +2855,20 @@ examples: slug: "" responses: "200": - application/json: {"created_at": "2024-02-07T13:54:48.821Z", "modified_at": "2023-09-05T11:33:52.011Z", "id": "", "name": "", "slug": "", "avatar_url": "https://misguided-violin.info", "bio": "", "company": "Gislason Group", "blog": "", "location": "", "email": "Ian.Block31@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 552582, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 380699} + application/json: {"created_at": "2025-02-06T13:54:48.821Z", "modified_at": "2024-09-04T11:33:52.011Z", "id": "", "name": "", "slug": "", "avatar_url": "https://misguided-violin.info", "bio": "", "company": "Gislason Group", "blog": "", "location": "", "email": "Ian.Block31@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 552582, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 380699, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": false, "proration_behavior": "prorate"}} "404": application/json: {"detail": ""} "422": application/json: {} customer_portal:subscriptions:list: speakeasy-default-customer-portal:subscriptions:list: + parameters: + query: + page: 1 + limit: 10 responses: "200": - application/json: {"items": [{"created_at": "2023-08-23T19:26:20.850Z", "modified_at": "2024-01-14T10:26:00.433Z", "id": "", "amount": 177706, "currency": "Danish Krone", "recurring_interval": "month", "status": "past_due", "current_period_start": "2023-12-02T18:25:37.169Z", "current_period_end": "2022-01-20T06:21:22.156Z", "cancel_at_period_end": false, "started_at": "2022-04-05T09:49:38.010Z", "ended_at": "2022-03-17T01:57:00.187Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "user_id": "", "product": {"created_at": "2024-01-25T00:05:25.844Z", "modified_at": "2023-07-13T19:57:33.016Z", "id": "", "name": "", "description": "since zowie loudly aha although gosh whenever as", "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2024-01-14T10:26:00.433Z", "modified_at": "2022-07-14T18:23:27.528Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 152837, "maximum_amount": 635532, "preset_amount": 639387}, {"created_at": "2022-04-05T09:49:38.010Z", "modified_at": "2022-03-17T01:57:00.187Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "year"}], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/var/yp", "mime_type": "", "size": 726700, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-04-21T16:08:32.154Z", "version": "", "is_uploaded": true, "created_at": "2022-02-02T01:51:19.643Z", "size_readable": "", "public_url": "https://robust-nightlife.info"}], "organization": {"created_at": "2022-02-15T08:57:09.959Z", "modified_at": "2024-06-28T00:46:13.804Z", "id": "", "name": "", "slug": "", "avatar_url": "https://improbable-bin.com/", "bio": "", "company": "Yundt, Kassulke and Hilpert", "blog": "", "location": "", "email": "Craig_Beatty42@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 207451, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 123187}}, "price": {"created_at": "2022-03-01T20:22:54.911Z", "modified_at": "2023-02-08T01:09:52.088Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 73227}}, {"created_at": "2023-06-19T05:46:32.685Z", "modified_at": "2024-04-03T18:06:02.533Z", "id": "", "amount": 751563, "currency": "Fiji Dollar", "recurring_interval": "year", "status": "incomplete", "current_period_start": "2023-10-15T09:46:50.350Z", "current_period_end": "2023-09-15T02:22:04.749Z", "cancel_at_period_end": true, "started_at": "2023-03-16T17:53:52.024Z", "ended_at": "2023-10-23T07:49:38.272Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "user_id": "", "product": {"created_at": "2023-02-27T07:39:18.966Z", "modified_at": "2024-10-20T12:04:56.060Z", "id": "", "name": "", "description": "times uselessly toothpick silently aftermath never tooth swelter", "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2024-08-18T13:00:42.665Z", "modified_at": "2023-06-22T03:00:04.393Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 322596, "maximum_amount": 860596, "preset_amount": 18278}], "benefits": [{"created_at": "2023-08-02T09:45:28.536Z", "modified_at": "2022-01-22T12:19:34.261Z", "id": "", "type": "github_repository", "description": "obnoxiously after crooked enthusiastically", "selectable": false, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/usr/libexec", "mime_type": "", "size": 412854, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-10-29T17:09:20.090Z", "version": "", "is_uploaded": true, "created_at": "2023-01-25T00:59:27.422Z", "size_readable": "", "public_url": "https://oblong-inspection.net"}, {"id": "", "organization_id": "", "name": "", "path": "/etc/periodic", "mime_type": "", "size": 783071, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-02-15T10:16:55.982Z", "version": "", "is_uploaded": false, "created_at": "2023-06-28T18:50:42.778Z", "size_readable": "", "public_url": "https://married-presume.net"}, {"id": "", "organization_id": "", "name": "", "path": "/var/mail", "mime_type": "", "size": 674469, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-06-25T16:02:25.369Z", "version": "", "is_uploaded": true, "created_at": "2023-09-11T11:54:14.319Z", "size_readable": "", "public_url": "https://writhing-conversation.com"}], "organization": {"created_at": "2023-10-30T05:49:01.311Z", "modified_at": "2022-12-07T09:46:44.632Z", "id": "", "name": "", "slug": "", "avatar_url": "https://hateful-linseed.info", "bio": "", "company": "Powlowski - Ebert", "blog": "", "location": "", "email": "Timmy27@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 421, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 327973}}, "price": {"created_at": "2024-09-28T03:47:03.515Z", "modified_at": "2022-07-09T16:58:41.012Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 897069, "maximum_amount": 135572, "preset_amount": 460276}}, {"created_at": "2022-10-23T20:39:57.368Z", "modified_at": "2022-08-21T04:01:37.813Z", "id": "", "amount": 119137, "currency": "Manat", "recurring_interval": "year", "status": "unpaid", "current_period_start": "2022-04-04T09:25:47.730Z", "current_period_end": "2023-09-27T01:29:37.942Z", "cancel_at_period_end": true, "started_at": "2024-09-05T07:44:59.336Z", "ended_at": "2022-07-24T14:46:52.205Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "user_id": "", "product": {"created_at": "2022-04-28T15:20:19.317Z", "modified_at": "2023-06-28T02:37:34.714Z", "id": "", "name": "", "description": "and jaggedly aftermath after although while", "is_recurring": true, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2023-06-11T18:07:18.321Z", "modified_at": "2022-04-24T08:24:21.019Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 841031, "maximum_amount": 410206, "preset_amount": 863466, "recurring_interval": "month"}, {"created_at": "2022-07-18T12:08:53.113Z", "modified_at": "2024-09-28T13:56:10.162Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 628106, "recurring_interval": "year"}], "benefits": [], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/etc/defaults", "mime_type": "", "size": 96811, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-02-08T12:01:40.965Z", "version": "", "is_uploaded": true, "created_at": "2024-07-17T07:32:23.211Z", "size_readable": "", "public_url": "https://unimportant-tusk.net/"}, {"id": "", "organization_id": "", "name": "", "path": "/var/log", "mime_type": "", "size": 714491, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-01-18T21:03:55.557Z", "version": "", "is_uploaded": false, "created_at": "2022-05-10T00:49:50.875Z", "size_readable": "", "public_url": "https://passionate-dream.net/"}], "organization": {"created_at": "2022-08-25T01:38:35.053Z", "modified_at": "2024-07-11T17:35:14.425Z", "id": "", "name": "", "slug": "", "avatar_url": "https://lovable-gift.net/", "bio": "", "company": "Fisher and Sons", "blog": "", "location": "", "email": "Akeem28@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 526688, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 201885}}, "price": {"created_at": "2024-01-30T10:30:11.361Z", "modified_at": "2023-09-15T04:48:08.824Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 816637}}], "pagination": {"total_count": 206196, "max_page": 741584}} + application/json: {"items": [{"created_at": "2024-08-22T19:26:20.850Z", "modified_at": "2025-01-13T10:26:00.433Z", "id": "", "amount": 177706, "currency": "Danish Krone", "recurring_interval": "month", "status": "past_due", "current_period_start": "2024-12-01T18:25:37.169Z", "current_period_end": "2023-01-20T06:21:22.156Z", "cancel_at_period_end": false, "canceled_at": "2023-04-05T09:49:38.010Z", "started_at": "2023-03-17T01:57:00.187Z", "ends_at": "2025-01-24T00:05:25.844Z", "ended_at": "2024-07-12T19:57:33.016Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "too_expensive", "customer_cancellation_comment": "", "user_id": "", "product": {"created_at": "2023-01-09T04:26:27.312Z", "modified_at": "2023-03-01T20:22:54.911Z", "id": "", "name": "", "description": "beautifully comparison now despite er", "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2025-12-27T15:09:02.427Z", "modified_at": "2023-03-31T02:45:39.610Z", "id": "", "is_archived": true, "product_id": ""}, {"created_at": "2025-05-01T20:38:29.097Z", "modified_at": "2023-06-05T08:58:03.644Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "month"}], "benefits": [{"created_at": "2024-08-19T22:29:27.736Z", "modified_at": "2023-03-15T10:11:56.132Z", "id": "", "type": "custom", "description": "meanwhile synthesise angrily inasmuch irritably", "selectable": true, "deletable": true, "organization_id": ""}, {"created_at": "2025-09-14T09:33:23.636Z", "modified_at": "2023-02-25T05:24:29.459Z", "id": "", "type": "github_repository", "description": "gah only despite seemingly eventually ah", "selectable": true, "deletable": false, "organization_id": ""}, {"created_at": "2025-03-07T17:43:00.381Z", "modified_at": "2025-06-02T11:43:36.892Z", "id": "", "type": "license_keys", "description": "fork shampoo outnumber so hence heartache afford pish", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [], "organization": {"created_at": "2023-01-01T09:29:03.176Z", "modified_at": "2024-04-27T12:09:29.137Z", "id": "", "name": "", "slug": "", "avatar_url": "https://fair-marketplace.org/", "bio": "", "company": "Cremin, VonRueden and Sporer", "blog": "", "location": "", "email": "Wayne62@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 877227, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 412854, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": false, "allow_customer_updates": true, "proration_behavior": "invoice"}}}, "price": {"created_at": "2024-05-27T07:14:10.577Z", "modified_at": "2025-03-07T02:26:31.358Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 783071, "maximum_amount": 374478, "preset_amount": 859260}}, {"created_at": "2024-06-27T18:50:42.778Z", "modified_at": "2025-12-16T05:11:35.383Z", "id": "", "amount": 498898, "currency": "New Leu", "recurring_interval": "year", "status": "unpaid", "current_period_start": "2025-01-09T05:13:52.456Z", "current_period_end": "2023-06-25T16:02:25.369Z", "cancel_at_period_end": true, "canceled_at": "2024-09-10T11:54:14.319Z", "started_at": "2025-01-19T21:45:37.595Z", "ends_at": "2025-12-19T02:03:54.761Z", "ended_at": "2023-07-24T21:01:11.396Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "customer_service", "customer_cancellation_comment": "", "user_id": "", "product": {"created_at": "2024-10-29T05:49:01.311Z", "modified_at": "2023-12-07T09:46:44.632Z", "id": "", "name": "", "description": "wonderfully CD whoa soap cheerfully distinction range flood bah", "is_recurring": true, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2024-04-23T03:52:08.925Z", "modified_at": "2023-09-22T23:25:46.808Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 31664}, {"created_at": "2025-08-25T02:25:37.454Z", "modified_at": "2025-06-08T14:13:41.397Z", "id": "", "is_archived": true, "product_id": ""}, {"created_at": "2023-04-07T19:39:54.371Z", "modified_at": "2024-06-06T09:30:51.196Z", "id": "", "is_archived": false, "product_id": ""}], "benefits": [{"created_at": "2025-12-31T08:16:04.009Z", "modified_at": "2023-06-26T17:38:16.835Z", "id": "", "type": "license_keys", "description": "favorite beneath remand until", "selectable": true, "deletable": false, "organization_id": ""}, {"created_at": "2023-06-11T03:56:34.876Z", "modified_at": "2024-06-15T02:57:43.819Z", "id": "", "type": "discord", "description": "to onto ouch shrilly ramp ethical busily archaeology", "selectable": true, "deletable": false, "organization_id": ""}, {"created_at": "2023-02-25T17:28:41.442Z", "modified_at": "2024-12-18T20:11:41.014Z", "id": "", "type": "ads", "description": "except following ick verbally drat pillow", "selectable": false, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/usr/ports", "mime_type": "", "size": 850053, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-01-07T04:08:08.901Z", "version": "", "is_uploaded": true, "created_at": "2025-06-16T08:19:05.026Z", "size_readable": "", "public_url": "https://that-plumber.org"}, {"id": "", "organization_id": "", "name": "", "path": "/rescue", "mime_type": "", "size": 915295, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-05-28T03:27:06.201Z", "version": "", "is_uploaded": false, "created_at": "2025-11-28T05:50:05.391Z", "size_readable": "", "public_url": "https://interesting-baseboard.biz"}, {"id": "", "organization_id": "", "name": "", "path": "/usr/X11R6", "mime_type": "", "size": 113341, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-06-02T17:02:41.566Z", "version": "", "is_uploaded": true, "created_at": "2024-10-06T22:24:47.498Z", "size_readable": "", "public_url": "https://skeletal-commercial.net"}], "organization": {"created_at": "2023-03-22T00:14:34.859Z", "modified_at": "2024-05-17T10:01:40.294Z", "id": "", "name": "", "slug": "", "avatar_url": "https://wry-dividend.name/", "bio": "", "company": "Gerhold - Bergstrom", "blog": "", "location": "", "email": "Ole_Legros@hotmail.com", "twitter_username": "", "pledge_minimum_amount": 747687, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 726474, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": true, "proration_behavior": "invoice"}}}, "price": {"created_at": "2024-05-06T07:16:06.301Z", "modified_at": "2024-07-08T08:27:04.982Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "month"}}, {"created_at": "2025-06-20T20:39:56.038Z", "modified_at": "2025-02-23T13:40:33.504Z", "id": "", "amount": 223595, "currency": "Tugrik", "recurring_interval": "month", "status": "unpaid", "current_period_start": "2023-04-16T22:12:09.039Z", "current_period_end": "2024-01-09T21:57:02.179Z", "cancel_at_period_end": true, "canceled_at": "2025-02-06T05:52:39.668Z", "started_at": "2023-03-10T23:54:55.605Z", "ends_at": "2025-11-07T00:43:09.247Z", "ended_at": "2025-09-16T08:39:57.875Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "too_complex", "customer_cancellation_comment": "", "user_id": "", "product": {"created_at": "2024-12-20T01:52:19.079Z", "modified_at": "2023-07-29T14:46:27.467Z", "id": "", "name": "", "description": "splendid overvalue concerned cruelly explode fantastic like notwithstanding", "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2024-05-21T06:22:17.591Z", "modified_at": "2023-07-03T23:59:32.103Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 634335}], "benefits": [{"created_at": "2023-03-22T05:51:32.253Z", "modified_at": "2023-11-01T12:00:41.076Z", "id": "", "type": "custom", "description": "wing at hm", "selectable": false, "deletable": false, "organization_id": ""}, {"created_at": "2024-06-04T00:15:22.676Z", "modified_at": "2025-09-09T02:23:31.754Z", "id": "", "type": "license_keys", "description": "whenever against finally duh ew yum indeed a bootleg prudent", "selectable": false, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/opt/lib", "mime_type": "", "size": 819205, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-12-31T17:36:44.429Z", "version": "", "is_uploaded": true, "created_at": "2024-10-22T04:17:40.114Z", "size_readable": "", "public_url": "https://ill-fated-godfather.com/"}, {"id": "", "organization_id": "", "name": "", "path": "/usr/X11R6", "mime_type": "", "size": 335065, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-12-13T15:11:14.188Z", "version": "", "is_uploaded": true, "created_at": "2024-04-12T21:18:45.526Z", "size_readable": "", "public_url": "https://remorseful-smog.name/"}, {"id": "", "organization_id": "", "name": "", "path": "/home/user", "mime_type": "", "size": 614763, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-06-11T01:25:26.848Z", "version": "", "is_uploaded": true, "created_at": "2024-02-28T18:10:15.289Z", "size_readable": "", "public_url": "https://better-veto.net/"}], "organization": {"created_at": "2025-05-27T05:40:12.687Z", "modified_at": "2023-09-19T04:18:57.160Z", "id": "", "name": "", "slug": "", "avatar_url": "https://dearest-hydrocarbon.biz/", "bio": "", "company": "Wunsch Inc", "blog": "", "location": "", "email": "Abagail79@gmail.com", "twitter_username": "", "pledge_minimum_amount": 138213, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 40688, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": false, "proration_behavior": "prorate"}}}, "price": {"created_at": "2025-01-24T09:03:28.558Z", "modified_at": "2023-02-25T21:21:59.049Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 334315, "maximum_amount": 487988, "preset_amount": 284604}}], "pagination": {"total_count": 584415, "max_page": 883301}} "422": application/json: {} customer_portal:subscriptions:get: @@ -2695,7 +2878,7 @@ examples: id: "" responses: "200": - application/json: {"created_at": "2024-02-07T13:54:48.821Z", "modified_at": "2023-09-05T11:33:52.011Z", "id": "", "amount": 544221, "currency": "Moroccan Dirham", "recurring_interval": "year", "status": "active", "current_period_start": "2023-05-10T02:28:23.533Z", "current_period_end": "2022-10-16T00:34:27.106Z", "cancel_at_period_end": true, "started_at": "2024-10-24T02:41:21.259Z", "ended_at": "2023-04-26T04:53:50.189Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "user_id": "", "product": {"created_at": "2024-05-28T07:17:57.134Z", "modified_at": "2022-03-28T11:05:23.685Z", "id": "", "name": "", "description": "notwithstanding however willfully toward", "is_recurring": false, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2023-08-20T11:11:04.610Z", "modified_at": "2023-07-26T06:33:15.810Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 458049, "maximum_amount": 450824, "preset_amount": 262795}], "benefits": [{"created_at": "2023-07-12T17:45:11.243Z", "modified_at": "2023-12-21T21:32:22.245Z", "id": "", "type": "github_repository", "description": "harangue once out effector determined backburn weary", "selectable": false, "deletable": false, "organization_id": ""}, {"created_at": "2024-12-01T14:44:00.985Z", "modified_at": "2022-02-04T11:10:26.128Z", "id": "", "type": "discord", "description": "unwilling disk modulo offset pacemaker violently plait trench guilt", "selectable": false, "deletable": true, "organization_id": ""}, {"created_at": "2022-12-12T23:35:27.798Z", "modified_at": "2022-10-07T02:56:50.564Z", "id": "", "type": "discord", "description": "upon triumphantly minus", "selectable": true, "deletable": true, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/root", "mime_type": "", "size": 413854, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-01-20T21:06:21.391Z", "version": "", "is_uploaded": true, "created_at": "2023-04-24T16:38:24.942Z", "size_readable": "", "public_url": "https://square-cash.org/"}, {"id": "", "organization_id": "", "name": "", "path": "/Network", "mime_type": "", "size": 418179, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-06-14T20:06:16.618Z", "version": "", "is_uploaded": true, "created_at": "2024-02-18T20:06:14.861Z", "size_readable": "", "public_url": "https://classic-netsuke.biz/"}, {"id": "", "organization_id": "", "name": "", "path": "/net", "mime_type": "", "size": 213989, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2024-12-17T03:14:33.642Z", "version": "", "is_uploaded": true, "created_at": "2022-06-13T06:21:37.012Z", "size_readable": "", "public_url": "https://strong-allocation.info"}], "organization": {"created_at": "2024-01-28T08:45:49.386Z", "modified_at": "2022-11-06T01:10:18.215Z", "id": "", "name": "", "slug": "", "avatar_url": "https://frilly-league.name", "bio": "", "company": "Lubowitz - Kirlin", "blog": "", "location": "", "email": "Jammie.Mayert79@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 443704, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 292089}}, "price": {"created_at": "2023-04-26T04:53:50.189Z", "modified_at": "2024-05-28T07:17:57.134Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "month"}} + application/json: {"created_at": "2025-02-06T13:54:48.821Z", "modified_at": "2024-09-04T11:33:52.011Z", "id": "", "amount": 544221, "currency": "Moroccan Dirham", "recurring_interval": "year", "status": "active", "current_period_start": "2024-05-09T02:28:23.533Z", "current_period_end": "2023-10-16T00:34:27.106Z", "cancel_at_period_end": true, "canceled_at": "2025-10-24T02:41:21.259Z", "started_at": "2024-04-25T04:53:50.189Z", "ends_at": "2025-05-28T07:17:57.134Z", "ended_at": "2023-03-28T11:05:23.685Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "low_quality", "customer_cancellation_comment": "", "user_id": "", "product": {"created_at": "2023-12-10T13:21:20.945Z", "modified_at": "2023-04-14T16:04:46.468Z", "id": "", "name": "", "description": "fellow scary but embarrassment metabolise last huddle", "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2023-03-21T00:44:28.600Z", "modified_at": "2023-03-31T04:26:02.125Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 649141, "maximum_amount": 666980, "preset_amount": 988917}, {"created_at": "2025-01-24T20:29:18.334Z", "modified_at": "2023-11-17T13:07:10.938Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 286547, "maximum_amount": 237994, "preset_amount": 710636, "recurring_interval": "month"}], "benefits": [{"created_at": "2025-05-08T16:06:38.834Z", "modified_at": "2025-01-01T17:44:05.420Z", "id": "", "type": "ads", "description": "ugh manner minor obediently aw fibre", "selectable": true, "deletable": true, "organization_id": ""}, {"created_at": "2025-05-10T07:09:21.582Z", "modified_at": "2023-06-04T09:34:39.316Z", "id": "", "type": "github_repository", "description": "book knotty er beneath", "selectable": false, "deletable": true, "organization_id": ""}, {"created_at": "2025-04-02T04:37:19.052Z", "modified_at": "2023-01-09T14:26:53.626Z", "id": "", "type": "downloadables", "description": "like claw incidentally nor drat consequently", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/etc/defaults", "mime_type": "", "size": 601522, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2023-10-27T07:41:12.642Z", "version": "", "is_uploaded": true, "created_at": "2023-08-23T12:46:20.079Z", "size_readable": "", "public_url": "https://front-chops.name"}], "organization": {"created_at": "2025-06-06T15:31:06.300Z", "modified_at": "2023-02-06T03:36:19.111Z", "id": "", "name": "", "slug": "", "avatar_url": "https://rotten-earth.name/", "bio": "", "company": "Larson - Lindgren", "blog": "", "location": "", "email": "Kathryn.Kerluke@gmail.com", "twitter_username": "", "pledge_minimum_amount": 95718, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 222075, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": true, "proration_behavior": "invoice"}}}, "price": {"created_at": "2023-12-16T13:24:07.925Z", "modified_at": "2023-05-04T04:21:49.237Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 241816, "maximum_amount": 832295, "preset_amount": 15843}} "404": application/json: {"detail": ""} "422": @@ -2706,10 +2889,12 @@ examples: path: id: "" requestBody: - application/json: {"product_price_id": ""} + application/json: {} responses: "200": - application/json: {"created_at": "2024-07-28T19:04:48.565Z", "modified_at": "2023-10-17T10:52:42.015Z", "id": "", "amount": 344620, "currency": "Zambian Kwacha", "recurring_interval": "year", "status": "active", "current_period_start": "2024-12-14T11:19:45.098Z", "current_period_end": "2022-03-01T06:03:05.915Z", "cancel_at_period_end": false, "started_at": "2023-05-05T18:16:40.936Z", "ended_at": "2022-12-08T09:52:54.805Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "user_id": "", "product": {"created_at": "2022-10-01T09:16:09.932Z", "modified_at": "2022-06-02T23:29:52.263Z", "id": "", "name": "", "description": "about inquisitively ugh recklessly incidentally jubilantly doting boohoo pish", "is_recurring": true, "is_archived": false, "organization_id": "", "prices": [{"created_at": "2023-01-13T16:52:57.274Z", "modified_at": "2024-12-22T15:27:45.882Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "minimum_amount": 488852, "maximum_amount": 984008, "preset_amount": 54062}, {"created_at": "2022-12-08T09:52:54.805Z", "modified_at": "2022-10-01T09:16:09.932Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 789275, "maximum_amount": 889838, "preset_amount": 302461}], "benefits": [{"created_at": "2023-09-03T03:35:45.584Z", "modified_at": "2023-05-23T21:03:36.028Z", "id": "", "type": "discord", "description": "lest represent braid", "selectable": false, "deletable": false, "organization_id": ""}, {"created_at": "2023-07-07T17:41:05.826Z", "modified_at": "2022-04-19T21:35:13.447Z", "id": "", "type": "downloadables", "description": "ouch weary euphonium what", "selectable": false, "deletable": true, "organization_id": ""}, {"created_at": "2023-08-02T03:11:23.164Z", "modified_at": "2022-09-27T08:59:31.628Z", "id": "", "type": "discord", "description": "hm eminent sham excitedly following pro parched gah", "selectable": true, "deletable": true, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/home", "mime_type": "", "size": 780643, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2022-10-01T21:33:23.746Z", "version": "", "is_uploaded": true, "created_at": "2022-12-12T14:26:30.108Z", "size_readable": "", "public_url": "https://illiterate-kiss.com"}], "organization": {"created_at": "2023-09-04T16:16:36.463Z", "modified_at": "2022-06-09T10:57:26.043Z", "id": "", "name": "", "slug": "", "avatar_url": "https://pointed-angle.net/", "bio": "", "company": "Leffler - Heidenreich", "blog": "", "location": "", "email": "Greta94@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 611007, "pledge_badge_show_amount": false, "default_upfront_split_to_contributors": 286835}}, "price": {"created_at": "2024-01-31T02:01:14.461Z", "modified_at": "2023-03-20T01:46:46.018Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "year"}} + application/json: {"created_at": "2024-10-16T10:52:42.015Z", "modified_at": "2024-01-13T16:52:57.274Z", "id": "", "amount": 991464, "currency": "Norwegian Krone", "recurring_interval": "month", "status": "unpaid", "current_period_start": "2023-03-01T06:03:05.915Z", "current_period_end": "2025-09-09T13:32:29.600Z", "cancel_at_period_end": true, "canceled_at": "2023-12-08T09:52:54.805Z", "started_at": "2023-10-01T09:16:09.932Z", "ends_at": "2023-06-02T23:29:52.263Z", "ended_at": "2025-05-15T01:05:20.251Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "other", "customer_cancellation_comment": "", "user_id": "", "product": {"created_at": "2023-11-28T11:56:11.232Z", "modified_at": "2024-05-23T23:10:45.412Z", "id": "", "name": "", "description": "mostly rekindle bleak from that qualified cycle woot abseil", "is_recurring": true, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2025-11-04T16:39:53.460Z", "modified_at": "2024-10-20T22:49:18.353Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "minimum_amount": 407926, "maximum_amount": 301848, "preset_amount": 657278}, {"created_at": "2024-01-03T08:52:11.922Z", "modified_at": "2024-08-06T22:56:22.190Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 556706, "recurring_interval": "month"}], "benefits": [{"created_at": "2023-03-06T08:10:15.601Z", "modified_at": "2025-11-26T02:34:57.845Z", "id": "", "type": "ads", "description": "lightly ultimately in", "selectable": true, "deletable": false, "organization_id": ""}], "medias": [], "organization": {"created_at": "2023-05-31T06:05:34.308Z", "modified_at": "2025-10-28T09:59:31.522Z", "id": "", "name": "", "slug": "", "avatar_url": "https://joyous-supplier.com/", "bio": "", "company": "Cruickshank, Rosenbaum and Rice", "blog": "", "location": "", "email": "Boyd38@yahoo.com", "twitter_username": "", "pledge_minimum_amount": 620905, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 643119, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": false, "proration_behavior": "prorate"}}}, "price": {"created_at": "2023-10-09T00:09:57.051Z", "modified_at": "2025-12-05T01:57:12.137Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 757081, "recurring_interval": "month"}} + "403": + application/json: {"detail": ""} "404": application/json: {"detail": ""} "422": @@ -2721,7 +2906,7 @@ examples: id: "" responses: "200": - application/json: {"created_at": "2022-01-28T04:39:19.513Z", "modified_at": "2024-12-24T10:36:51.473Z", "id": "", "amount": 473916, "currency": "Bulgarian Lev", "recurring_interval": "month", "status": "trialing", "current_period_start": "2022-02-14T08:23:52.236Z", "current_period_end": "2022-06-28T03:41:26.855Z", "cancel_at_period_end": false, "started_at": "2022-06-09T14:11:56.790Z", "ended_at": "2022-08-28T23:20:26.332Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "user_id": "", "product": {"created_at": "2022-08-29T10:04:34.451Z", "modified_at": "2022-03-26T15:01:55.926Z", "id": "", "name": "", "description": "lightly engender westernize for evince voluntarily carefully ah whether", "is_recurring": false, "is_archived": true, "organization_id": "", "prices": [], "benefits": [], "medias": [], "organization": {"created_at": "2024-10-31T13:48:30.383Z", "modified_at": "2023-06-29T22:23:08.521Z", "id": "", "name": "", "slug": "", "avatar_url": "https://steep-mentor.com", "bio": "", "company": "Bernier - Denesik", "blog": "", "location": "", "email": "Alvina_Gleichner@gmail.com", "twitter_username": "", "pledge_minimum_amount": 660092, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 979409}}, "price": {"created_at": "2023-06-04T09:53:22.758Z", "modified_at": "2022-04-04T13:59:58.090Z", "id": "", "is_archived": true, "product_id": "", "recurring_interval": "month"}} + application/json: {"created_at": "2023-01-28T04:39:19.513Z", "modified_at": "2025-12-24T10:36:51.473Z", "id": "", "amount": 473916, "currency": "Bulgarian Lev", "recurring_interval": "month", "status": "trialing", "current_period_start": "2023-02-14T08:23:52.236Z", "current_period_end": "2023-06-28T03:41:26.855Z", "cancel_at_period_end": false, "canceled_at": "2023-06-09T14:11:56.790Z", "started_at": "2023-08-28T23:20:26.332Z", "ends_at": "2023-08-29T10:04:34.451Z", "ended_at": "2023-03-26T15:01:55.926Z", "customer_id": "", "product_id": "", "price_id": "", "discount_id": "", "checkout_id": "", "customer_cancellation_reason": "unused", "customer_cancellation_comment": "", "user_id": "", "product": {"created_at": "2024-04-03T03:17:46.224Z", "modified_at": "2025-08-19T22:51:49.844Z", "id": "", "name": "", "description": "once likewise ecliptic along maintainer premise pfft retrospectivity", "is_recurring": true, "is_archived": true, "organization_id": "", "prices": [{"created_at": "2023-09-05T17:34:18.622Z", "modified_at": "2023-04-08T21:08:29.894Z", "id": "", "is_archived": true, "product_id": ""}, {"created_at": "2024-06-28T22:23:08.521Z", "modified_at": "2025-06-03T03:25:38.902Z", "id": "", "is_archived": false, "product_id": "", "recurring_interval": "year"}, {"created_at": "2023-03-20T10:44:30.244Z", "modified_at": "2023-07-23T19:31:36.159Z", "id": "", "is_archived": true, "product_id": "", "price_currency": "", "price_amount": 45767, "recurring_interval": "month"}], "benefits": [{"created_at": "2025-01-15T21:10:47.290Z", "modified_at": "2025-12-18T18:35:19.693Z", "id": "", "type": "github_repository", "description": "enrich knuckle hence offensively out oh beneath round", "selectable": true, "deletable": true, "organization_id": ""}], "medias": [{"id": "", "organization_id": "", "name": "", "path": "/usr/libdata", "mime_type": "", "size": 693028, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-01-05T23:46:23.807Z", "version": "", "is_uploaded": false, "created_at": "2025-11-07T00:56:10.187Z", "size_readable": "", "public_url": "https://joyful-range.biz"}, {"id": "", "organization_id": "", "name": "", "path": "/etc/mail", "mime_type": "", "size": 9779, "storage_version": "", "checksum_etag": "", "checksum_sha256_base64": "", "checksum_sha256_hex": "", "last_modified_at": "2025-01-20T13:07:16.644Z", "version": "", "is_uploaded": false, "created_at": "2025-12-26T07:00:33.708Z", "size_readable": "", "public_url": "https://spanish-finger.biz"}], "organization": {"created_at": "2025-10-24T05:58:18.319Z", "modified_at": "2023-05-11T19:43:26.919Z", "id": "", "name": "", "slug": "", "avatar_url": "https://great-someplace.biz", "bio": "", "company": "Hammes, Cremin and Moen", "blog": "", "location": "", "email": "Francesca_Wuckert@gmail.com", "twitter_username": "", "pledge_minimum_amount": 890574, "pledge_badge_show_amount": true, "default_upfront_split_to_contributors": 162000, "profile_settings": {}, "feature_settings": {"issue_funding_enabled": false}, "subscription_settings": {"allow_multiple_subscriptions": true, "allow_customer_updates": true, "proration_behavior": "invoice"}}}, "price": {"created_at": "2025-07-18T08:41:11.454Z", "modified_at": "2024-09-12T13:02:28.249Z", "id": "", "is_archived": false, "product_id": "", "price_currency": "", "price_amount": 659165}} "403": application/json: {"detail": ""} "404": @@ -2734,7 +2919,117 @@ examples: application/json: {"customer_id": ""} responses: "201": - application/json: {"created_at": "2023-06-18T07:14:55.338Z", "modified_at": "2023-12-01T17:06:07.804Z", "id": "", "token": "", "expires_at": "2023-04-03T12:48:32.253Z", "customer_id": "", "customer": {"created_at": "2022-05-28T06:20:22.766Z", "modified_at": "2022-03-17T15:39:20.911Z", "id": "", "metadata": {"key": true, "key1": "", "key2": ""}, "email": "Raymundo_Rolfson35@hotmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Cyprus"}, "tax_id": [], "organization_id": "", "avatar_url": "https://glorious-convection.com/"}} + application/json: {"created_at": "2024-06-17T07:14:55.338Z", "modified_at": "2024-11-30T17:06:07.804Z", "id": "", "token": "", "expires_at": "2024-04-02T12:48:32.253Z", "customer_portal_url": "https://black-and-white-secrecy.org/", "customer_id": "", "customer": {"created_at": "2023-01-01T02:16:41.381Z", "modified_at": "2023-07-06T00:30:20.403Z", "id": "", "metadata": {}, "email": "Raymundo_Rolfson35@hotmail.com", "email_verified": true, "name": "", "billing_address": {"country": "Cyprus"}, "tax_id": [], "organization_id": "", "avatar_url": "https://glorious-convection.com/"}} + "422": + application/json: {} + events:list: + speakeasy-default-events:list: + parameters: + query: + page: 1 + limit: 10 + responses: + "200": + application/json: {"items": [{"metadata": {"key": true, "key1": ""}, "id": "", "timestamp": "2023-06-17T12:14:27.999Z", "name": "", "source": "user", "organization_id": "", "customer_id": "", "external_customer_id": ""}, {"metadata": {"key": "", "key1": true}, "id": "", "timestamp": "2023-03-17T01:57:00.187Z", "name": "", "source": "user", "organization_id": "", "customer_id": "", "external_customer_id": ""}, {"metadata": {"key": 7468, "key1": ""}, "id": "", "timestamp": "2024-02-08T01:09:52.088Z", "name": "", "source": "system", "organization_id": "", "customer_id": "", "external_customer_id": ""}], "pagination": {"total_count": 73227, "max_page": 931165}} + "422": + application/json: {} + events:get: + speakeasy-default-events:get: + parameters: + path: + id: "" + responses: + "200": + application/json: {"metadata": {"key": 544221, "key1": 969961}, "id": "", "timestamp": "2024-05-17T00:32:02.244Z", "name": "", "source": "system", "organization_id": "", "customer_id": "", "external_customer_id": ""} + "404": + application/json: {"detail": ""} + "422": + application/json: {} + events:ingest: + speakeasy-default-events:ingest: + requestBody: + application/json: {"events": [{"name": "", "customer_id": ""}, {"name": "", "external_customer_id": ""}]} + responses: + "200": + application/json: {"inserted": 207692} + "422": + application/json: {} + meters:list: + speakeasy-default-meters:list: + parameters: + query: + page: 1 + limit: 10 + responses: + "200": + application/json: {"items": [{"metadata": {"key": true, "key1": ""}, "created_at": "2023-06-17T12:14:27.999Z", "modified_at": "2024-11-27T13:02:27.296Z", "id": "", "name": "", "filter": {"conjunction": "or", "clauses": []}, "aggregation": {"func": "sum", "property": ""}, "organization_id": ""}, {"metadata": {}, "created_at": "2025-01-24T00:05:25.844Z", "modified_at": "2024-07-12T19:57:33.016Z", "id": "", "name": "", "filter": {"conjunction": "or", "clauses": []}, "aggregation": {"func": "max", "property": ""}, "organization_id": ""}, {"metadata": {"key": ""}, "created_at": "2025-10-17T13:20:28.265Z", "modified_at": "2024-09-13T22:04:07.138Z", "id": "", "name": "", "filter": {"conjunction": "or", "clauses": [{"property": "", "operator": "gt", "value": true}]}, "aggregation": {"func": "max", "property": ""}, "organization_id": ""}], "pagination": {"total_count": 913465, "max_page": 173090}} + "422": + application/json: {} + meters:create: + speakeasy-default-meters:create: + requestBody: + application/json: {"name": "", "filter": {"conjunction": "and", "clauses": [{"property": "", "operator": "ne", "value": ""}]}, "aggregation": {"func": "sum", "property": ""}} + responses: + "201": + application/json: {"metadata": {}, "created_at": "2023-04-09T14:25:29.356Z", "modified_at": "2025-05-18T17:03:53.906Z", "id": "", "name": "", "filter": {"conjunction": "or", "clauses": []}, "aggregation": {}, "organization_id": ""} + "422": + application/json: {} + meters:get: + speakeasy-default-meters:get: + parameters: + path: + id: "" + responses: + "200": + application/json: {"metadata": {"key": 544221, "key1": 969961}, "created_at": "2024-05-17T00:32:02.244Z", "modified_at": "2024-05-09T02:28:23.533Z", "id": "", "name": "", "filter": {"conjunction": "and", "clauses": []}, "aggregation": {"func": "max", "property": ""}, "organization_id": ""} + "404": + application/json: {"detail": ""} + "422": + application/json: {} + meters:update: + speakeasy-default-meters:update: + parameters: + path: + id: "" + requestBody: + application/json: {} + responses: + "200": + application/json: {"metadata": {"key": 344620, "key1": false, "key2": 984008}, "created_at": "2023-03-01T06:03:05.915Z", "modified_at": "2025-09-09T13:32:29.600Z", "id": "", "name": "", "filter": {"conjunction": "and", "clauses": [{"property": "", "operator": "ne", "value": false}]}, "aggregation": {}, "organization_id": ""} + "404": + application/json: {"detail": ""} + "422": + application/json: {} + meters:events: + speakeasy-default-meters:events: + parameters: + path: + id: "" + query: + page: 1 + limit: 10 + responses: + "200": + application/json: {"items": [], "pagination": {"total_count": 954664, "max_page": 537484}} + "404": + application/json: {"detail": ""} + "422": + application/json: {} + meters:quantities: + speakeasy-default-meters:quantities: + parameters: + path: + id: "" + query: + start_timestamp: "2023-09-17T00:45:34.608Z" + end_timestamp: "2023-07-21T18:11:39.069Z" + interval: "hour" + responses: + "200": + application/json: {"quantities": [{"timestamp": "2023-10-29T11:55:31.312Z", "quantity": 1435.91}]} + "404": + application/json: {"detail": ""} "422": application/json: {} +examplesVersion: 1.0.0 generatedTests: {} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index f3ab048..dac249e 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -13,7 +13,7 @@ generation: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: true php: - version: 0.0.2 + version: 0.0.3 additionalDependencies: autoload: {} autoload-dev: {} diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 670e8b1..9aaf6a6 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,20 +1,21 @@ -speakeasyVersion: 1.456.1 +speakeasyVersion: 1.484.1 sources: Polar-OAS: sourceNamespace: polar-oas - sourceRevisionDigest: sha256:1e9d93d2659b8cb752ec5172bd0652070c9eb56a8299f0c4bf2de2a5c7a22318 - sourceBlobDigest: sha256:2fcb4a497110dfacf53652f840b4586fd532f15ddfa11dc8329db9987c54371a + sourceRevisionDigest: sha256:881ab0d7efccd2f1e51b03fc139ef122dd8dc75179e8a799c5cc80f182ebc907 + sourceBlobDigest: sha256:9ef96e4866a4eb934a6a2f0b713c6fcda4e57fe1731df1d84bb3fb401828e0bf tags: - latest + - speakeasy-sdk-regen-1738196173 - 0.1.0 targets: polar: source: Polar-OAS sourceNamespace: polar-oas - sourceRevisionDigest: sha256:1e9d93d2659b8cb752ec5172bd0652070c9eb56a8299f0c4bf2de2a5c7a22318 - sourceBlobDigest: sha256:2fcb4a497110dfacf53652f840b4586fd532f15ddfa11dc8329db9987c54371a + sourceRevisionDigest: sha256:881ab0d7efccd2f1e51b03fc139ef122dd8dc75179e8a799c5cc80f182ebc907 + sourceBlobDigest: sha256:9ef96e4866a4eb934a6a2f0b713c6fcda4e57fe1731df1d84bb3fb401828e0bf codeSamplesNamespace: polar-api-php-code-samples - codeSamplesRevisionDigest: sha256:60f7723c2f70363500167accfeb9e53c99c04ed68a7a807f42bce731c7fd5481 + codeSamplesRevisionDigest: sha256:b209c81f768062828f66e567043bcaadcdb91a146ba108a8bd949bbf7e7631c4 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest @@ -33,7 +34,13 @@ workflow: polar: target: php source: Polar-OAS + publish: + packagist: + username: polar + token: $packagist_token codeSamples: registry: location: registry.speakeasyapi.dev/polar/polar/polar-api-php-code-samples + labelOverride: + fixedValue: PHP (SDK) blocking: false diff --git a/.speakeasy/workflow.yaml b/.speakeasy/workflow.yaml index a934f3a..58a868d 100644 --- a/.speakeasy/workflow.yaml +++ b/.speakeasy/workflow.yaml @@ -20,8 +20,8 @@ targets: username: polar token: $packagist_token codeSamples: - labelOverride: - fixedValue: PHP (SDK) registry: location: registry.speakeasyapi.dev/polar/polar/polar-api-php-code-samples + labelOverride: + fixedValue: PHP (SDK) blocking: false diff --git a/README.md b/README.md index f1e7867..b63e560 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Developer-friendly & type-safe Php SDK specifically catered to leverage *polar-s Polar API: Polar HTTP and Webhooks API -Read the docs at https://docs.polar.sh/api +Read the docs at https://docs.polar.sh/api-reference @@ -28,6 +28,7 @@ Read the docs at https://docs.polar.sh/api * [polar-sh/sdk](#polar-shsdk) * [SDK Installation](#sdk-installation) * [SDK Example Usage](#sdk-example-usage) + * [Authentication](#authentication) * [Available Resources and Operations](#available-resources-and-operations) * [Pagination](#pagination) * [Error Handling](#error-handling) @@ -43,26 +44,9 @@ Read the docs at https://docs.polar.sh/api The SDK relies on [Composer](https://getcomposer.org/) to manage its dependencies. -To install the SDK first add the below to your `composer.json` file: - -```json -{ - "repositories": [ - { - "type": "github", - "url": ".git" - } - ], - "require": { - "polar-sh/sdk": "*" - } -} -``` - -Then run the following command: - +To install the SDK and add it as a dependency to an existing `composer.json` file: ```bash -composer update +composer require "polar-sh/sdk" ``` @@ -84,12 +68,13 @@ $sdk = Polar\Polar::builder()->build(); $request = new Components\WebhookCheckoutCreatedPayload( data: new Components\Checkout( - createdAt: Utils\Utils::parseDateTime('2024-11-12T14:26:42.882Z'), + createdAt: Utils\Utils::parseDateTime('2025-11-12T14:26:42.882Z'), id: '', + paymentProcessor: Components\PaymentProcessor::Stripe, status: Components\CheckoutStatus::Confirmed, clientSecret: '', url: 'https://fragrant-freezing.com', - expiresAt: Utils\Utils::parseDateTime('2022-04-01T05:43:33.513Z'), + expiresAt: Utils\Utils::parseDateTime('2023-04-01T05:43:33.513Z'), successUrl: 'https://lined-privilege.biz/', productId: '', productPriceId: '', @@ -99,12 +84,14 @@ $request = new Components\WebhookCheckoutCreatedPayload( isPaymentRequired: false, isPaymentSetupRequired: false, isPaymentFormRequired: false, - paymentProcessorMetadata: new Components\PaymentProcessorMetadata(), + paymentProcessorMetadata: [ + 'key' => '', + ], metadata: [ 'key' => 962818, ], product: new Components\CheckoutProduct( - createdAt: Utils\Utils::parseDateTime('2022-01-08T00:22:16.025Z'), + createdAt: Utils\Utils::parseDateTime('2023-01-08T00:22:16.025Z'), id: '', name: '', isRecurring: false, @@ -112,13 +99,13 @@ $request = new Components\WebhookCheckoutCreatedPayload( organizationId: '', prices: [ new Components\ProductPriceRecurringCustom( - createdAt: Utils\Utils::parseDateTime('2022-08-19T22:18:44.316Z'), + createdAt: Utils\Utils::parseDateTime('2023-08-19T22:18:44.316Z'), id: '', isArchived: false, productId: '', priceCurrency: '', recurringInterval: Components\SubscriptionRecurringInterval::Month, - modifiedAt: Utils\Utils::parseDateTime('2024-04-20T22:18:45.464Z'), + modifiedAt: Utils\Utils::parseDateTime('2025-04-20T22:18:45.464Z'), minimumAmount: 598949, maximumAmount: 500372, presetAmount: 688646, @@ -126,14 +113,14 @@ $request = new Components\WebhookCheckoutCreatedPayload( ], benefits: [ new Components\BenefitBase( - createdAt: Utils\Utils::parseDateTime('2024-07-22T12:18:02.066Z'), + createdAt: Utils\Utils::parseDateTime('2025-07-22T12:18:02.066Z'), id: '', type: Components\BenefitType::Downloadables, description: 'rotten relative for embarrassment untidy long-term near honestly separate', selectable: false, deletable: false, organizationId: '', - modifiedAt: Utils\Utils::parseDateTime('2024-01-10T13:42:03.592Z'), + modifiedAt: Utils\Utils::parseDateTime('2025-01-09T13:42:03.592Z'), ), ], medias: [ @@ -145,33 +132,33 @@ $request = new Components\WebhookCheckoutCreatedPayload( mimeType: '', size: 879649, isUploaded: false, - createdAt: Utils\Utils::parseDateTime('2024-09-12T19:41:14.261Z'), + createdAt: Utils\Utils::parseDateTime('2025-09-12T19:41:14.261Z'), sizeReadable: '', publicUrl: 'https://rectangular-worth.info/', storageVersion: '', checksumEtag: '', checksumSha256Base64: '', checksumSha256Hex: '', - lastModifiedAt: Utils\Utils::parseDateTime('2024-06-29T02:23:28.661Z'), + lastModifiedAt: Utils\Utils::parseDateTime('2025-06-29T02:23:28.661Z'), version: '', ), ], - modifiedAt: Utils\Utils::parseDateTime('2023-05-08T04:30:09.331Z'), + modifiedAt: Utils\Utils::parseDateTime('2024-05-07T04:30:09.331Z'), description: 'provided publicize astride oof mockingly if opposite coagulate pro', ), productPrice: new Components\ProductPriceRecurringFree( - createdAt: Utils\Utils::parseDateTime('2023-12-29T06:38:59.235Z'), + createdAt: Utils\Utils::parseDateTime('2024-12-28T06:38:59.235Z'), id: '', isArchived: false, productId: '', recurringInterval: Components\SubscriptionRecurringInterval::Year, - modifiedAt: Utils\Utils::parseDateTime('2022-03-21T13:22:46.065Z'), + modifiedAt: Utils\Utils::parseDateTime('2023-03-21T13:22:46.065Z'), ), attachedCustomFields: [ new Components\AttachedCustomField( customFieldId: '', customField: new Components\CustomFieldNumber( - createdAt: Utils\Utils::parseDateTime('2024-09-13T23:13:23.872Z'), + createdAt: Utils\Utils::parseDateTime('2025-09-13T23:13:23.872Z'), id: '', metadata: [ 'key' => false, @@ -180,7 +167,7 @@ $request = new Components\WebhookCheckoutCreatedPayload( name: '', organizationId: '', properties: new Components\CustomFieldNumberProperties(), - modifiedAt: Utils\Utils::parseDateTime('2024-03-11T01:07:03.723Z'), + modifiedAt: Utils\Utils::parseDateTime('2025-03-11T01:07:03.723Z'), ), order: 169862, required: false, @@ -189,7 +176,7 @@ $request = new Components\WebhookCheckoutCreatedPayload( customerMetadata: [ 'key' => '', ], - modifiedAt: Utils\Utils::parseDateTime('2022-09-27T02:51:25.666Z'), + modifiedAt: Utils\Utils::parseDateTime('2023-09-27T02:51:25.666Z'), embedOrigin: '', amount: 587344, taxAmount: 753909, @@ -199,17 +186,17 @@ $request = new Components\WebhookCheckoutCreatedPayload( discountId: '', customerId: '', customerName: '', - customerEmail: 'Royce.VonRueden27@gmail.com', + customerEmail: '', customerIpAddress: '', customerBillingAddress: new Components\Address( - country: 'Northern Mariana Islands', + country: 'British Indian Ocean Territory (Chagos Archipelago)', ), customerTaxId: '', discount: new Components\CheckoutDiscountPercentageRepeatDuration( - duration: Components\DiscountDuration::Forever, - durationInMonths: 496211, - type: Components\DiscountType::Percentage, - basisPoints: 741459, + duration: Components\DiscountDuration::Repeating, + durationInMonths: 918364, + type: Components\DiscountType::Fixed, + basisPoints: 271748, id: '', name: '', code: '', @@ -228,6 +215,47 @@ if ($response->any !== null) { ``` + +## Authentication + +### Per-Client Security Schemes + +This SDK supports the following security scheme globally: + +| Name | Type | Scheme | +| ------------- | ---- | ----------- | +| `accessToken` | http | HTTP Bearer | + +To authenticate with the API the `accessToken` parameter must be set when initializing the SDK. For example: +```php +declare(strict_types=1); + +require 'vendor/autoload.php'; + +use Polar; +use Polar\Models\Operations; + +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); + +$request = new Operations\ExternalOrganizationsListRequest(); + +$responses = $sdk->externalOrganizations->list( + request: $request +); + + +foreach ($responses as $response) { + if ($response->statusCode === 200) { + // handle response + } +} +``` + + ## Available Resources and Operations @@ -342,6 +370,12 @@ if ($response->any !== null) { * [list](docs/sdks/discounts/README.md#list) - List Discounts * [update](docs/sdks/discounts/README.md#update) - Update Discount +### [events](docs/sdks/events/README.md) + +* [get](docs/sdks/events/README.md#get) - Get Event +* [ingest](docs/sdks/events/README.md#ingest) - Ingest Events +* [list](docs/sdks/events/README.md#list) - List Events + ### [externalOrganizations](docs/sdks/externalorganizations/README.md) * [list](docs/sdks/externalorganizations/README.md#list) - List External Organizations @@ -361,6 +395,15 @@ if ($response->any !== null) { * [list](docs/sdks/licensekeys/README.md#list) - List License Keys * [update](docs/sdks/licensekeys/README.md#update) - Update License Key +### [meters](docs/sdks/meters/README.md) + +* [create](docs/sdks/meters/README.md#create) - Create Meter +* [events](docs/sdks/meters/README.md#events) - Get Meter Events +* [get](docs/sdks/meters/README.md#get) - Get Meter +* [list](docs/sdks/meters/README.md#list) - List Meters +* [quantities](docs/sdks/meters/README.md#quantities) - Get Meter Quantities +* [update](docs/sdks/meters/README.md#update) - Update Meter + ### [metrics](docs/sdks/metrics/README.md) * [get](docs/sdks/metrics/README.md#get) - Get Metrics @@ -404,6 +447,11 @@ if ($response->any !== null) { * [update](docs/sdks/products/README.md#update) - Update Product * [updateBenefits](docs/sdks/products/README.md#updatebenefits) - Update Product Benefits +### [refunds](docs/sdks/refunds/README.md) + +* [create](docs/sdks/refunds/README.md#create) - Create Refund +* [list](docs/sdks/refunds/README.md#list) - List Refunds + ### [repositories](docs/sdks/repositories/README.md) * [get](docs/sdks/repositories/README.md#get) - Get Repository @@ -413,7 +461,10 @@ if ($response->any !== null) { ### [subscriptions](docs/sdks/subscriptions/README.md) * [export](docs/sdks/subscriptions/README.md#export) - Export Subscriptions +* [get](docs/sdks/subscriptions/README.md#get) - Get Subscription * [list](docs/sdks/subscriptions/README.md#list) - List Subscriptions +* [revoke](docs/sdks/subscriptions/README.md#revoke) - Revoke Subscription +* [update](docs/sdks/subscriptions/README.md#update) - Update Subscription @@ -433,9 +484,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Operations; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Operations\ExternalOrganizationsListRequest(); @@ -483,9 +536,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Operations; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); try { $request = new Operations\ExternalOrganizationsListRequest(); @@ -531,11 +586,12 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Operations; -$security = ''; - $sdk = Polar\Polar::builder() ->setServer("sandbox") - ->setSecurity($security)->build(); + ->setSecurity( + '' + ) + ->build(); $request = new Operations\ExternalOrganizationsListRequest(); @@ -562,11 +618,12 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Operations; -$security = ''; - $sdk = Polar\Polar::builder() ->setServerURL('https://api.polar.sh') - ->setSecurity($security)->build(); + ->setSecurity( + '' + ) + ->build(); $request = new Operations\ExternalOrganizationsListRequest(); diff --git a/RELEASES.md b/RELEASES.md new file mode 100644 index 0000000..343cc9f --- /dev/null +++ b/RELEASES.md @@ -0,0 +1,11 @@ + + +## 2025-02-05 11:40:44 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.484.1 (2.503.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [php v0.0.3] . +### Releases +- [Composer v0.0.3] https://packagist.org/packages/polar-sh/sdk#v0.0.3 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index e5662b9..9e5d728 100644 --- a/USAGE.md +++ b/USAGE.md @@ -7,9 +7,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Operations; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Operations\ExternalOrganizationsListRequest(); diff --git a/composer.json b/composer.json index a5a6e1e..624ba45 100644 --- a/composer.json +++ b/composer.json @@ -18,10 +18,10 @@ }, "require-dev": { "laravel/pint": "^1.18.1", - "phpstan/phpstan": "^1.12", + "phpstan/phpstan": "^2.1.0", "phpunit/phpunit": "^10", - "rector/rector": "^0.19", - "roave/security-advisories": "dev-latest" + "roave/security-advisories": "dev-latest", + "orchestra/testbench": "^9.6" }, "minimum-stability": "stable", "prefer-stable": true, @@ -31,6 +31,13 @@ "sort-packages": true, "process-timeout": 60 }, + "extra": { + "laravel": { + "providers": [ + "Polar\\PackageServiceProvider" + ] + } + }, "scripts": { "test": [ "./vendor/bin/phpunit --testdox --display-warnings --colors=always" diff --git a/config/services.php b/config/services.php new file mode 100644 index 0000000..af6de87 --- /dev/null +++ b/config/services.php @@ -0,0 +1,11 @@ + [ + 'access_token' => env('ACCESS_TOKEN') + ], +]; \ No newline at end of file diff --git a/docs/Models/Components/Aggregation.md b/docs/Models/Components/Aggregation.md new file mode 100644 index 0000000..00499b2 --- /dev/null +++ b/docs/Models/Components/Aggregation.md @@ -0,0 +1,50 @@ +# Aggregation + + +## Supported Types + +### `Components\PropertyAggregation` + +```php +/** +* @var Components\PropertyAggregation +*/ +Components\PropertyAggregation $value = /* values here */ +``` + +### `Components\CountAggregation` + +```php +/** +* @var Components\CountAggregation +*/ +Components\CountAggregation $value = /* values here */ +``` + +### `Components\PropertyAggregation` + +```php +/** +* @var Components\PropertyAggregation +*/ +Components\PropertyAggregation $value = /* values here */ +``` + +### `Components\PropertyAggregation` + +```php +/** +* @var Components\PropertyAggregation +*/ +Components\PropertyAggregation $value = /* values here */ +``` + +### `Components\PropertyAggregation` + +```php +/** +* @var Components\PropertyAggregation +*/ +Components\PropertyAggregation $value = /* values here */ +``` + diff --git a/docs/Models/Components/AmountType.md b/docs/Models/Components/AmountType.md deleted file mode 100644 index 2300fee..0000000 --- a/docs/Models/Components/AmountType.md +++ /dev/null @@ -1,8 +0,0 @@ -# AmountType - - -## Values - -| Name | Value | -| ------- | ------- | -| `Fixed` | fixed | \ No newline at end of file diff --git a/docs/Models/Components/AuthorizeResponseOrganization.md b/docs/Models/Components/AuthorizeResponseOrganization.md index a163f40..389918e 100644 --- a/docs/Models/Components/AuthorizeResponseOrganization.md +++ b/docs/Models/Components/AuthorizeResponseOrganization.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | -| `client` | [Components\OAuth2ClientPublic](../../Models/Components/OAuth2ClientPublic.md) | :heavy_check_mark: | N/A | -| `subType` | [Components\AuthorizeResponseOrganizationSubType](../../Models/Components/AuthorizeResponseOrganizationSubType.md) | :heavy_check_mark: | N/A | -| `scopes` | array<[Components\Scope](../../Models/Components/Scope.md)> | :heavy_check_mark: | N/A | -| `organizations` | array<[Components\AuthorizeOrganization](../../Models/Components/AuthorizeOrganization.md)> | :heavy_check_mark: | N/A | -| `sub` | [Components\AuthorizeOrganization](../../Models/Components/AuthorizeOrganization.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `client` | [Components\OAuth2ClientPublic](../../Models/Components/OAuth2ClientPublic.md) | :heavy_check_mark: | N/A | +| `subType` | *string* | :heavy_check_mark: | N/A | +| `scopes` | array<[Components\Scope](../../Models/Components/Scope.md)> | :heavy_check_mark: | N/A | +| `organizations` | array<[Components\AuthorizeOrganization](../../Models/Components/AuthorizeOrganization.md)> | :heavy_check_mark: | N/A | +| `sub` | [Components\AuthorizeOrganization](../../Models/Components/AuthorizeOrganization.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/AuthorizeResponseOrganizationSubType.md b/docs/Models/Components/AuthorizeResponseOrganizationSubType.md deleted file mode 100644 index ca65ab2..0000000 --- a/docs/Models/Components/AuthorizeResponseOrganizationSubType.md +++ /dev/null @@ -1,8 +0,0 @@ -# AuthorizeResponseOrganizationSubType - - -## Values - -| Name | Value | -| -------------- | -------------- | -| `Organization` | organization | \ No newline at end of file diff --git a/docs/Models/Components/AuthorizeResponseUser.md b/docs/Models/Components/AuthorizeResponseUser.md index 7da58b0..6777fb8 100644 --- a/docs/Models/Components/AuthorizeResponseUser.md +++ b/docs/Models/Components/AuthorizeResponseUser.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `client` | [Components\OAuth2ClientPublic](../../Models/Components/OAuth2ClientPublic.md) | :heavy_check_mark: | N/A | -| `subType` | [Components\AuthorizeResponseUserSubType](../../Models/Components/AuthorizeResponseUserSubType.md) | :heavy_check_mark: | N/A | -| `scopes` | array<[Components\Scope](../../Models/Components/Scope.md)> | :heavy_check_mark: | N/A | -| `sub` | [Components\AuthorizeUser](../../Models/Components/AuthorizeUser.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `client` | [Components\OAuth2ClientPublic](../../Models/Components/OAuth2ClientPublic.md) | :heavy_check_mark: | N/A | +| `subType` | *string* | :heavy_check_mark: | N/A | +| `scopes` | array<[Components\Scope](../../Models/Components/Scope.md)> | :heavy_check_mark: | N/A | +| `sub` | [Components\AuthorizeUser](../../Models/Components/AuthorizeUser.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/AuthorizeResponseUserSubType.md b/docs/Models/Components/AuthorizeResponseUserSubType.md deleted file mode 100644 index 1a7b67f..0000000 --- a/docs/Models/Components/AuthorizeResponseUserSubType.md +++ /dev/null @@ -1,8 +0,0 @@ -# AuthorizeResponseUserSubType - - -## Values - -| Name | Value | -| ------ | ------ | -| `User` | user | \ No newline at end of file diff --git a/docs/Models/Components/BenefitAds.md b/docs/Models/Components/BenefitAds.md index 6403b3e..80f0438 100644 --- a/docs/Models/Components/BenefitAds.md +++ b/docs/Models/Components/BenefitAds.md @@ -11,7 +11,7 @@ Use it so your backers can display ads on your README, website, etc. | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | | `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | | `id` | *string* | :heavy_check_mark: | The ID of the benefit. | -| `type` | [Components\BenefitAdsType](../../Models/Components/BenefitAdsType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `description` | *string* | :heavy_check_mark: | The description of the benefit. | | `selectable` | *bool* | :heavy_check_mark: | Whether the benefit is selectable when creating a product. | | `deletable` | *bool* | :heavy_check_mark: | Whether the benefit is deletable. | diff --git a/docs/Models/Components/BenefitAdsCreate.md b/docs/Models/Components/BenefitAdsCreate.md index 375de32..bd84652 100644 --- a/docs/Models/Components/BenefitAdsCreate.md +++ b/docs/Models/Components/BenefitAdsCreate.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `type` | [Components\BenefitAdsCreateType](../../Models/Components/BenefitAdsCreateType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `description` | *string* | :heavy_check_mark: | The description of the benefit. Will be displayed on products having this benefit. | | `properties` | [Components\BenefitAdsProperties](../../Models/Components/BenefitAdsProperties.md) | :heavy_check_mark: | Properties for a benefit of type `ads`. | | `organizationId` | *?string* | :heavy_minus_sign: | The ID of the organization owning the benefit. **Required unless you use an organization token.** | \ No newline at end of file diff --git a/docs/Models/Components/BenefitAdsCreateType.md b/docs/Models/Components/BenefitAdsCreateType.md deleted file mode 100644 index 4128f70..0000000 --- a/docs/Models/Components/BenefitAdsCreateType.md +++ /dev/null @@ -1,8 +0,0 @@ -# BenefitAdsCreateType - - -## Values - -| Name | Value | -| ----- | ----- | -| `Ads` | ads | \ No newline at end of file diff --git a/docs/Models/Components/BenefitAdsSubscriber.md b/docs/Models/Components/BenefitAdsSubscriber.md index 0c28f87..4cd5045 100644 --- a/docs/Models/Components/BenefitAdsSubscriber.md +++ b/docs/Models/Components/BenefitAdsSubscriber.md @@ -3,15 +3,15 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | -| `id` | *string* | :heavy_check_mark: | The ID of the benefit. | -| `type` | [Components\BenefitAdsSubscriberType](../../Models/Components/BenefitAdsSubscriberType.md) | :heavy_check_mark: | N/A | -| `description` | *string* | :heavy_check_mark: | The description of the benefit. | -| `selectable` | *bool* | :heavy_check_mark: | Whether the benefit is selectable when creating a product. | -| `deletable` | *bool* | :heavy_check_mark: | Whether the benefit is deletable. | -| `organizationId` | *string* | :heavy_check_mark: | The ID of the organization owning the benefit. | -| `organization` | [Components\Organization](../../Models/Components/Organization.md) | :heavy_check_mark: | N/A | -| `properties` | [Components\BenefitAdsProperties](../../Models/Components/BenefitAdsProperties.md) | :heavy_check_mark: | Properties for a benefit of type `ads`. | -| `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | +| `id` | *string* | :heavy_check_mark: | The ID of the benefit. | +| `type` | *string* | :heavy_check_mark: | N/A | +| `description` | *string* | :heavy_check_mark: | The description of the benefit. | +| `selectable` | *bool* | :heavy_check_mark: | Whether the benefit is selectable when creating a product. | +| `deletable` | *bool* | :heavy_check_mark: | Whether the benefit is deletable. | +| `organizationId` | *string* | :heavy_check_mark: | The ID of the organization owning the benefit. | +| `organization` | [Components\Organization](../../Models/Components/Organization.md) | :heavy_check_mark: | N/A | +| `properties` | [Components\BenefitAdsProperties](../../Models/Components/BenefitAdsProperties.md) | :heavy_check_mark: | Properties for a benefit of type `ads`. | +| `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | \ No newline at end of file diff --git a/docs/Models/Components/BenefitAdsSubscriberType.md b/docs/Models/Components/BenefitAdsSubscriberType.md deleted file mode 100644 index 6696a91..0000000 --- a/docs/Models/Components/BenefitAdsSubscriberType.md +++ /dev/null @@ -1,8 +0,0 @@ -# BenefitAdsSubscriberType - - -## Values - -| Name | Value | -| ----- | ----- | -| `Ads` | ads | \ No newline at end of file diff --git a/docs/Models/Components/BenefitAdsType.md b/docs/Models/Components/BenefitAdsType.md deleted file mode 100644 index 478e810..0000000 --- a/docs/Models/Components/BenefitAdsType.md +++ /dev/null @@ -1,8 +0,0 @@ -# BenefitAdsType - - -## Values - -| Name | Value | -| ----- | ----- | -| `Ads` | ads | \ No newline at end of file diff --git a/docs/Models/Components/BenefitAdsUpdate.md b/docs/Models/Components/BenefitAdsUpdate.md index a3d0830..bd0dc7f 100644 --- a/docs/Models/Components/BenefitAdsUpdate.md +++ b/docs/Models/Components/BenefitAdsUpdate.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `type` | [Components\BenefitAdsUpdateType](../../Models/Components/BenefitAdsUpdateType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `description` | *?string* | :heavy_minus_sign: | The description of the benefit. Will be displayed on products having this benefit. | | `properties` | [?Components\BenefitAdsProperties](../../Models/Components/BenefitAdsProperties.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/BenefitAdsUpdateType.md b/docs/Models/Components/BenefitAdsUpdateType.md deleted file mode 100644 index 787fdd3..0000000 --- a/docs/Models/Components/BenefitAdsUpdateType.md +++ /dev/null @@ -1,8 +0,0 @@ -# BenefitAdsUpdateType - - -## Values - -| Name | Value | -| ----- | ----- | -| `Ads` | ads | \ No newline at end of file diff --git a/docs/Models/Components/BenefitCustom.md b/docs/Models/Components/BenefitCustom.md index 9eb81a3..0a12493 100644 --- a/docs/Models/Components/BenefitCustom.md +++ b/docs/Models/Components/BenefitCustom.md @@ -11,7 +11,7 @@ Use it to grant any kind of benefit that doesn't fit in the other types. | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | | `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | | `id` | *string* | :heavy_check_mark: | The ID of the benefit. | -| `type` | [Components\BenefitCustomType](../../Models/Components/BenefitCustomType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `description` | *string* | :heavy_check_mark: | The description of the benefit. | | `selectable` | *bool* | :heavy_check_mark: | Whether the benefit is selectable when creating a product. | | `deletable` | *bool* | :heavy_check_mark: | Whether the benefit is deletable. | diff --git a/docs/Models/Components/BenefitCustomCreate.md b/docs/Models/Components/BenefitCustomCreate.md index 7df0aee..14ff092 100644 --- a/docs/Models/Components/BenefitCustomCreate.md +++ b/docs/Models/Components/BenefitCustomCreate.md @@ -7,7 +7,7 @@ Schema to create a benefit of type `custom`. | Field | Type | Required | Description | | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `type` | [Components\BenefitCustomCreateType](../../Models/Components/BenefitCustomCreateType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `description` | *string* | :heavy_check_mark: | The description of the benefit. Will be displayed on products having this benefit. | | `properties` | [Components\BenefitCustomCreateProperties](../../Models/Components/BenefitCustomCreateProperties.md) | :heavy_check_mark: | Properties for creating a benefit of type `custom`. | | `organizationId` | *?string* | :heavy_minus_sign: | The ID of the organization owning the benefit. **Required unless you use an organization token.** | \ No newline at end of file diff --git a/docs/Models/Components/BenefitCustomSubscriber.md b/docs/Models/Components/BenefitCustomSubscriber.md index d9143ea..d3a2f18 100644 --- a/docs/Models/Components/BenefitCustomSubscriber.md +++ b/docs/Models/Components/BenefitCustomSubscriber.md @@ -7,7 +7,7 @@ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | | `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | | `id` | *string* | :heavy_check_mark: | The ID of the benefit. | -| `type` | [Components\BenefitCustomSubscriberType](../../Models/Components/BenefitCustomSubscriberType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `description` | *string* | :heavy_check_mark: | The description of the benefit. | | `selectable` | *bool* | :heavy_check_mark: | Whether the benefit is selectable when creating a product. | | `deletable` | *bool* | :heavy_check_mark: | Whether the benefit is deletable. | diff --git a/docs/Models/Components/BenefitCustomSubscriberType.md b/docs/Models/Components/BenefitCustomSubscriberType.md deleted file mode 100644 index 138fbaa..0000000 --- a/docs/Models/Components/BenefitCustomSubscriberType.md +++ /dev/null @@ -1,8 +0,0 @@ -# BenefitCustomSubscriberType - - -## Values - -| Name | Value | -| -------- | -------- | -| `Custom` | custom | \ No newline at end of file diff --git a/docs/Models/Components/BenefitCustomType.md b/docs/Models/Components/BenefitCustomType.md deleted file mode 100644 index ad8892e..0000000 --- a/docs/Models/Components/BenefitCustomType.md +++ /dev/null @@ -1,8 +0,0 @@ -# BenefitCustomType - - -## Values - -| Name | Value | -| -------- | -------- | -| `Custom` | custom | \ No newline at end of file diff --git a/docs/Models/Components/BenefitCustomUpdate.md b/docs/Models/Components/BenefitCustomUpdate.md index a5d4711..87f40ed 100644 --- a/docs/Models/Components/BenefitCustomUpdate.md +++ b/docs/Models/Components/BenefitCustomUpdate.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `type` | [Components\BenefitCustomUpdateType](../../Models/Components/BenefitCustomUpdateType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `description` | *?string* | :heavy_minus_sign: | The description of the benefit. Will be displayed on products having this benefit. | | `properties` | [?Components\BenefitCustomProperties](../../Models/Components/BenefitCustomProperties.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/BenefitCustomUpdateType.md b/docs/Models/Components/BenefitCustomUpdateType.md deleted file mode 100644 index 53a8928..0000000 --- a/docs/Models/Components/BenefitCustomUpdateType.md +++ /dev/null @@ -1,8 +0,0 @@ -# BenefitCustomUpdateType - - -## Values - -| Name | Value | -| -------- | -------- | -| `Custom` | custom | \ No newline at end of file diff --git a/docs/Models/Components/BenefitDiscord.md b/docs/Models/Components/BenefitDiscord.md index 30a15c7..8f60985 100644 --- a/docs/Models/Components/BenefitDiscord.md +++ b/docs/Models/Components/BenefitDiscord.md @@ -11,7 +11,7 @@ Use it to automatically invite your backers to a Discord server. | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | | `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | | `id` | *string* | :heavy_check_mark: | The ID of the benefit. | -| `type` | [Components\BenefitDiscordType](../../Models/Components/BenefitDiscordType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `description` | *string* | :heavy_check_mark: | The description of the benefit. | | `selectable` | *bool* | :heavy_check_mark: | Whether the benefit is selectable when creating a product. | | `deletable` | *bool* | :heavy_check_mark: | Whether the benefit is deletable. | diff --git a/docs/Models/Components/BenefitDiscordCreate.md b/docs/Models/Components/BenefitDiscordCreate.md index 90acd79..4732d5d 100644 --- a/docs/Models/Components/BenefitDiscordCreate.md +++ b/docs/Models/Components/BenefitDiscordCreate.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `type` | [Components\BenefitDiscordCreateType](../../Models/Components/BenefitDiscordCreateType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `description` | *string* | :heavy_check_mark: | The description of the benefit. Will be displayed on products having this benefit. | | `properties` | [Components\BenefitDiscordCreateProperties](../../Models/Components/BenefitDiscordCreateProperties.md) | :heavy_check_mark: | Properties to create a benefit of type `discord`. | | `organizationId` | *?string* | :heavy_minus_sign: | The ID of the organization owning the benefit. **Required unless you use an organization token.** | \ No newline at end of file diff --git a/docs/Models/Components/BenefitDiscordCreateType.md b/docs/Models/Components/BenefitDiscordCreateType.md deleted file mode 100644 index dccdad0..0000000 --- a/docs/Models/Components/BenefitDiscordCreateType.md +++ /dev/null @@ -1,8 +0,0 @@ -# BenefitDiscordCreateType - - -## Values - -| Name | Value | -| --------- | --------- | -| `Discord` | discord | \ No newline at end of file diff --git a/docs/Models/Components/BenefitDiscordSubscriber.md b/docs/Models/Components/BenefitDiscordSubscriber.md index 684343b..772a7a5 100644 --- a/docs/Models/Components/BenefitDiscordSubscriber.md +++ b/docs/Models/Components/BenefitDiscordSubscriber.md @@ -7,7 +7,7 @@ | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | | `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | | `id` | *string* | :heavy_check_mark: | The ID of the benefit. | -| `type` | [Components\BenefitDiscordSubscriberType](../../Models/Components/BenefitDiscordSubscriberType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `description` | *string* | :heavy_check_mark: | The description of the benefit. | | `selectable` | *bool* | :heavy_check_mark: | Whether the benefit is selectable when creating a product. | | `deletable` | *bool* | :heavy_check_mark: | Whether the benefit is deletable. | diff --git a/docs/Models/Components/BenefitDiscordSubscriberType.md b/docs/Models/Components/BenefitDiscordSubscriberType.md deleted file mode 100644 index 21d8a21..0000000 --- a/docs/Models/Components/BenefitDiscordSubscriberType.md +++ /dev/null @@ -1,8 +0,0 @@ -# BenefitDiscordSubscriberType - - -## Values - -| Name | Value | -| --------- | --------- | -| `Discord` | discord | \ No newline at end of file diff --git a/docs/Models/Components/BenefitDiscordType.md b/docs/Models/Components/BenefitDiscordType.md deleted file mode 100644 index 0cbdafb..0000000 --- a/docs/Models/Components/BenefitDiscordType.md +++ /dev/null @@ -1,8 +0,0 @@ -# BenefitDiscordType - - -## Values - -| Name | Value | -| --------- | --------- | -| `Discord` | discord | \ No newline at end of file diff --git a/docs/Models/Components/BenefitDiscordUpdate.md b/docs/Models/Components/BenefitDiscordUpdate.md index bfd0c0b..45f1fb0 100644 --- a/docs/Models/Components/BenefitDiscordUpdate.md +++ b/docs/Models/Components/BenefitDiscordUpdate.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `type` | [Components\BenefitDiscordUpdateType](../../Models/Components/BenefitDiscordUpdateType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `description` | *?string* | :heavy_minus_sign: | The description of the benefit. Will be displayed on products having this benefit. | | `properties` | [?Components\BenefitDiscordCreateProperties](../../Models/Components/BenefitDiscordCreateProperties.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/BenefitDiscordUpdateType.md b/docs/Models/Components/BenefitDiscordUpdateType.md deleted file mode 100644 index c7089ab..0000000 --- a/docs/Models/Components/BenefitDiscordUpdateType.md +++ /dev/null @@ -1,8 +0,0 @@ -# BenefitDiscordUpdateType - - -## Values - -| Name | Value | -| --------- | --------- | -| `Discord` | discord | \ No newline at end of file diff --git a/docs/Models/Components/BenefitDownloadables.md b/docs/Models/Components/BenefitDownloadables.md index d649228..5af6246 100644 --- a/docs/Models/Components/BenefitDownloadables.md +++ b/docs/Models/Components/BenefitDownloadables.md @@ -7,7 +7,7 @@ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | | `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | | `id` | *string* | :heavy_check_mark: | The ID of the benefit. | -| `type` | [Components\BenefitDownloadablesType](../../Models/Components/BenefitDownloadablesType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `description` | *string* | :heavy_check_mark: | The description of the benefit. | | `selectable` | *bool* | :heavy_check_mark: | Whether the benefit is selectable when creating a product. | | `deletable` | *bool* | :heavy_check_mark: | Whether the benefit is deletable. | diff --git a/docs/Models/Components/BenefitDownloadablesCreate.md b/docs/Models/Components/BenefitDownloadablesCreate.md index e386bd4..09aea86 100644 --- a/docs/Models/Components/BenefitDownloadablesCreate.md +++ b/docs/Models/Components/BenefitDownloadablesCreate.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | -| `type` | [Components\BenefitDownloadablesCreateType](../../Models/Components/BenefitDownloadablesCreateType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `description` | *string* | :heavy_check_mark: | The description of the benefit. Will be displayed on products having this benefit. | | `properties` | [Components\BenefitDownloadablesCreateProperties](../../Models/Components/BenefitDownloadablesCreateProperties.md) | :heavy_check_mark: | N/A | | `organizationId` | *?string* | :heavy_minus_sign: | The ID of the organization owning the benefit. **Required unless you use an organization token.** | \ No newline at end of file diff --git a/docs/Models/Components/BenefitDownloadablesCreateType.md b/docs/Models/Components/BenefitDownloadablesCreateType.md deleted file mode 100644 index d7ee81a..0000000 --- a/docs/Models/Components/BenefitDownloadablesCreateType.md +++ /dev/null @@ -1,8 +0,0 @@ -# BenefitDownloadablesCreateType - - -## Values - -| Name | Value | -| --------------- | --------------- | -| `Downloadables` | downloadables | \ No newline at end of file diff --git a/docs/Models/Components/BenefitDownloadablesSubscriber.md b/docs/Models/Components/BenefitDownloadablesSubscriber.md index 3668d34..783a3b1 100644 --- a/docs/Models/Components/BenefitDownloadablesSubscriber.md +++ b/docs/Models/Components/BenefitDownloadablesSubscriber.md @@ -7,7 +7,7 @@ | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | | `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | | `id` | *string* | :heavy_check_mark: | The ID of the benefit. | -| `type` | [Components\BenefitDownloadablesSubscriberType](../../Models/Components/BenefitDownloadablesSubscriberType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `description` | *string* | :heavy_check_mark: | The description of the benefit. | | `selectable` | *bool* | :heavy_check_mark: | Whether the benefit is selectable when creating a product. | | `deletable` | *bool* | :heavy_check_mark: | Whether the benefit is deletable. | diff --git a/docs/Models/Components/BenefitDownloadablesSubscriberType.md b/docs/Models/Components/BenefitDownloadablesSubscriberType.md deleted file mode 100644 index 867f550..0000000 --- a/docs/Models/Components/BenefitDownloadablesSubscriberType.md +++ /dev/null @@ -1,8 +0,0 @@ -# BenefitDownloadablesSubscriberType - - -## Values - -| Name | Value | -| --------------- | --------------- | -| `Downloadables` | downloadables | \ No newline at end of file diff --git a/docs/Models/Components/BenefitDownloadablesType.md b/docs/Models/Components/BenefitDownloadablesType.md deleted file mode 100644 index 5f51a51..0000000 --- a/docs/Models/Components/BenefitDownloadablesType.md +++ /dev/null @@ -1,8 +0,0 @@ -# BenefitDownloadablesType - - -## Values - -| Name | Value | -| --------------- | --------------- | -| `Downloadables` | downloadables | \ No newline at end of file diff --git a/docs/Models/Components/BenefitDownloadablesUpdate.md b/docs/Models/Components/BenefitDownloadablesUpdate.md index c30039b..23beb15 100644 --- a/docs/Models/Components/BenefitDownloadablesUpdate.md +++ b/docs/Models/Components/BenefitDownloadablesUpdate.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | -| `type` | [Components\BenefitDownloadablesUpdateType](../../Models/Components/BenefitDownloadablesUpdateType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `description` | *?string* | :heavy_minus_sign: | The description of the benefit. Will be displayed on products having this benefit. | | `properties` | [?Components\BenefitDownloadablesCreateProperties](../../Models/Components/BenefitDownloadablesCreateProperties.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/BenefitDownloadablesUpdateType.md b/docs/Models/Components/BenefitDownloadablesUpdateType.md deleted file mode 100644 index 7468e4b..0000000 --- a/docs/Models/Components/BenefitDownloadablesUpdateType.md +++ /dev/null @@ -1,8 +0,0 @@ -# BenefitDownloadablesUpdateType - - -## Values - -| Name | Value | -| --------------- | --------------- | -| `Downloadables` | downloadables | \ No newline at end of file diff --git a/docs/Models/Components/BenefitGitHubRepository.md b/docs/Models/Components/BenefitGitHubRepository.md index e2a26bf..0b6a240 100644 --- a/docs/Models/Components/BenefitGitHubRepository.md +++ b/docs/Models/Components/BenefitGitHubRepository.md @@ -11,7 +11,7 @@ Use it to automatically invite your backers to a private GitHub repository. | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | | `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | | `id` | *string* | :heavy_check_mark: | The ID of the benefit. | -| `type` | [Components\BenefitGitHubRepositoryType](../../Models/Components/BenefitGitHubRepositoryType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `description` | *string* | :heavy_check_mark: | The description of the benefit. | | `selectable` | *bool* | :heavy_check_mark: | Whether the benefit is selectable when creating a product. | | `deletable` | *bool* | :heavy_check_mark: | Whether the benefit is deletable. | diff --git a/docs/Models/Components/BenefitGitHubRepositoryCreate.md b/docs/Models/Components/BenefitGitHubRepositoryCreate.md index 8467e51..360cbbf 100644 --- a/docs/Models/Components/BenefitGitHubRepositoryCreate.md +++ b/docs/Models/Components/BenefitGitHubRepositoryCreate.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | -| `type` | [Components\BenefitGitHubRepositoryCreateType](../../Models/Components/BenefitGitHubRepositoryCreateType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `description` | *string* | :heavy_check_mark: | The description of the benefit. Will be displayed on products having this benefit. | | `properties` | [Components\BenefitGitHubRepositoryCreateProperties](../../Models/Components/BenefitGitHubRepositoryCreateProperties.md) | :heavy_check_mark: | Properties to create a benefit of type `github_repository`. | | `organizationId` | *?string* | :heavy_minus_sign: | The ID of the organization owning the benefit. **Required unless you use an organization token.** | \ No newline at end of file diff --git a/docs/Models/Components/BenefitGitHubRepositoryCreateType.md b/docs/Models/Components/BenefitGitHubRepositoryCreateType.md deleted file mode 100644 index f8466dc..0000000 --- a/docs/Models/Components/BenefitGitHubRepositoryCreateType.md +++ /dev/null @@ -1,8 +0,0 @@ -# BenefitGitHubRepositoryCreateType - - -## Values - -| Name | Value | -| ------------------ | ------------------ | -| `GithubRepository` | github_repository | \ No newline at end of file diff --git a/docs/Models/Components/BenefitGitHubRepositorySubscriber.md b/docs/Models/Components/BenefitGitHubRepositorySubscriber.md index 4f9933a..6d78891 100644 --- a/docs/Models/Components/BenefitGitHubRepositorySubscriber.md +++ b/docs/Models/Components/BenefitGitHubRepositorySubscriber.md @@ -7,7 +7,7 @@ | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | | `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | | `id` | *string* | :heavy_check_mark: | The ID of the benefit. | -| `type` | [Components\BenefitGitHubRepositorySubscriberType](../../Models/Components/BenefitGitHubRepositorySubscriberType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `description` | *string* | :heavy_check_mark: | The description of the benefit. | | `selectable` | *bool* | :heavy_check_mark: | Whether the benefit is selectable when creating a product. | | `deletable` | *bool* | :heavy_check_mark: | Whether the benefit is deletable. | diff --git a/docs/Models/Components/BenefitGitHubRepositorySubscriberType.md b/docs/Models/Components/BenefitGitHubRepositorySubscriberType.md deleted file mode 100644 index 7e9273a..0000000 --- a/docs/Models/Components/BenefitGitHubRepositorySubscriberType.md +++ /dev/null @@ -1,8 +0,0 @@ -# BenefitGitHubRepositorySubscriberType - - -## Values - -| Name | Value | -| ------------------ | ------------------ | -| `GithubRepository` | github_repository | \ No newline at end of file diff --git a/docs/Models/Components/BenefitGitHubRepositoryType.md b/docs/Models/Components/BenefitGitHubRepositoryType.md deleted file mode 100644 index 327f0ce..0000000 --- a/docs/Models/Components/BenefitGitHubRepositoryType.md +++ /dev/null @@ -1,8 +0,0 @@ -# BenefitGitHubRepositoryType - - -## Values - -| Name | Value | -| ------------------ | ------------------ | -| `GithubRepository` | github_repository | \ No newline at end of file diff --git a/docs/Models/Components/BenefitGitHubRepositoryUpdate.md b/docs/Models/Components/BenefitGitHubRepositoryUpdate.md index e6a22eb..0e00125 100644 --- a/docs/Models/Components/BenefitGitHubRepositoryUpdate.md +++ b/docs/Models/Components/BenefitGitHubRepositoryUpdate.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| `type` | [Components\BenefitGitHubRepositoryUpdateType](../../Models/Components/BenefitGitHubRepositoryUpdateType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `description` | *?string* | :heavy_minus_sign: | The description of the benefit. Will be displayed on products having this benefit. | | `properties` | [?Components\BenefitGitHubRepositoryCreateProperties](../../Models/Components/BenefitGitHubRepositoryCreateProperties.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/BenefitGitHubRepositoryUpdateType.md b/docs/Models/Components/BenefitGitHubRepositoryUpdateType.md deleted file mode 100644 index eb85815..0000000 --- a/docs/Models/Components/BenefitGitHubRepositoryUpdateType.md +++ /dev/null @@ -1,8 +0,0 @@ -# BenefitGitHubRepositoryUpdateType - - -## Values - -| Name | Value | -| ------------------ | ------------------ | -| `GithubRepository` | github_repository | \ No newline at end of file diff --git a/docs/Models/Components/BenefitGrant.md b/docs/Models/Components/BenefitGrant.md index 1c8dcf1..a8b3992 100644 --- a/docs/Models/Components/BenefitGrant.md +++ b/docs/Models/Components/BenefitGrant.md @@ -12,6 +12,7 @@ | `customerId` | *string* | :heavy_check_mark: | The ID of the customer concerned by this grant. | | ~~`userId`~~ | *string* | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | `benefitId` | *string* | :heavy_check_mark: | The ID of the benefit concerned by this grant. | +| `customer` | [Components\Customer](../../Models/Components/Customer.md) | :heavy_check_mark: | A customer in an organization. | | `properties` | [Components\BenefitGrantDiscordProperties\|Components\BenefitGrantGitHubRepositoryProperties\|Components\BenefitGrantDownloadablesProperties\|Components\BenefitGrantLicenseKeysProperties\|Components\BenefitGrantAdsProperties\|Components\BenefitGrantCustomProperties](../../Models/Components/Properties.md) | :heavy_check_mark: | N/A | | `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | | `subscriptionId` | *string* | :heavy_check_mark: | The ID of the subscription that granted this benefit. | diff --git a/docs/Models/Components/BenefitGrantWebhook.md b/docs/Models/Components/BenefitGrantWebhook.md index b292e2a..004c4e7 100644 --- a/docs/Models/Components/BenefitGrantWebhook.md +++ b/docs/Models/Components/BenefitGrantWebhook.md @@ -12,6 +12,7 @@ | `customerId` | *string* | :heavy_check_mark: | The ID of the customer concerned by this grant. | | ~~`userId`~~ | *string* | :heavy_check_mark: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | `benefitId` | *string* | :heavy_check_mark: | The ID of the benefit concerned by this grant. | +| `customer` | [Components\Customer](../../Models/Components/Customer.md) | :heavy_check_mark: | A customer in an organization. | | `properties` | [Components\BenefitGrantDiscordProperties\|Components\BenefitGrantGitHubRepositoryProperties\|Components\BenefitGrantDownloadablesProperties\|Components\BenefitGrantLicenseKeysProperties\|Components\BenefitGrantAdsProperties\|Components\BenefitGrantCustomProperties](../../Models/Components/BenefitGrantWebhookProperties.md) | :heavy_check_mark: | N/A | | `benefit` | [Components\BenefitAds\|Components\BenefitCustom\|Components\BenefitDiscord\|Components\BenefitGitHubRepository\|Components\BenefitDownloadables\|Components\BenefitLicenseKeys](../../Models/Components/Benefit.md) | :heavy_check_mark: | N/A | | `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | diff --git a/docs/Models/Components/BenefitLicenseKeys.md b/docs/Models/Components/BenefitLicenseKeys.md index e4b96a2..55e333c 100644 --- a/docs/Models/Components/BenefitLicenseKeys.md +++ b/docs/Models/Components/BenefitLicenseKeys.md @@ -7,7 +7,7 @@ | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | | `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | | `id` | *string* | :heavy_check_mark: | The ID of the benefit. | -| `type` | [Components\BenefitLicenseKeysType](../../Models/Components/BenefitLicenseKeysType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `description` | *string* | :heavy_check_mark: | The description of the benefit. | | `selectable` | *bool* | :heavy_check_mark: | Whether the benefit is selectable when creating a product. | | `deletable` | *bool* | :heavy_check_mark: | Whether the benefit is deletable. | diff --git a/docs/Models/Components/BenefitLicenseKeysCreate.md b/docs/Models/Components/BenefitLicenseKeysCreate.md index 384ca7a..e00a16b 100644 --- a/docs/Models/Components/BenefitLicenseKeysCreate.md +++ b/docs/Models/Components/BenefitLicenseKeysCreate.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `type` | [Components\BenefitLicenseKeysCreateType](../../Models/Components/BenefitLicenseKeysCreateType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `description` | *string* | :heavy_check_mark: | The description of the benefit. Will be displayed on products having this benefit. | | `properties` | [Components\BenefitLicenseKeysCreateProperties](../../Models/Components/BenefitLicenseKeysCreateProperties.md) | :heavy_check_mark: | N/A | | `organizationId` | *?string* | :heavy_minus_sign: | The ID of the organization owning the benefit. **Required unless you use an organization token.** | \ No newline at end of file diff --git a/docs/Models/Components/BenefitLicenseKeysCreateType.md b/docs/Models/Components/BenefitLicenseKeysCreateType.md deleted file mode 100644 index 49cc9d2..0000000 --- a/docs/Models/Components/BenefitLicenseKeysCreateType.md +++ /dev/null @@ -1,8 +0,0 @@ -# BenefitLicenseKeysCreateType - - -## Values - -| Name | Value | -| ------------- | ------------- | -| `LicenseKeys` | license_keys | \ No newline at end of file diff --git a/docs/Models/Components/BenefitLicenseKeysSubscriber.md b/docs/Models/Components/BenefitLicenseKeysSubscriber.md index 80e4a79..ff33d4f 100644 --- a/docs/Models/Components/BenefitLicenseKeysSubscriber.md +++ b/docs/Models/Components/BenefitLicenseKeysSubscriber.md @@ -7,7 +7,7 @@ | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | | `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | | `id` | *string* | :heavy_check_mark: | The ID of the benefit. | -| `type` | [Components\BenefitLicenseKeysSubscriberType](../../Models/Components/BenefitLicenseKeysSubscriberType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `description` | *string* | :heavy_check_mark: | The description of the benefit. | | `selectable` | *bool* | :heavy_check_mark: | Whether the benefit is selectable when creating a product. | | `deletable` | *bool* | :heavy_check_mark: | Whether the benefit is deletable. | diff --git a/docs/Models/Components/BenefitLicenseKeysSubscriberType.md b/docs/Models/Components/BenefitLicenseKeysSubscriberType.md deleted file mode 100644 index 0b11de9..0000000 --- a/docs/Models/Components/BenefitLicenseKeysSubscriberType.md +++ /dev/null @@ -1,8 +0,0 @@ -# BenefitLicenseKeysSubscriberType - - -## Values - -| Name | Value | -| ------------- | ------------- | -| `LicenseKeys` | license_keys | \ No newline at end of file diff --git a/docs/Models/Components/BenefitLicenseKeysType.md b/docs/Models/Components/BenefitLicenseKeysType.md deleted file mode 100644 index caefb1d..0000000 --- a/docs/Models/Components/BenefitLicenseKeysType.md +++ /dev/null @@ -1,8 +0,0 @@ -# BenefitLicenseKeysType - - -## Values - -| Name | Value | -| ------------- | ------------- | -| `LicenseKeys` | license_keys | \ No newline at end of file diff --git a/docs/Models/Components/BenefitLicenseKeysUpdate.md b/docs/Models/Components/BenefitLicenseKeysUpdate.md index eee32e6..523d354 100644 --- a/docs/Models/Components/BenefitLicenseKeysUpdate.md +++ b/docs/Models/Components/BenefitLicenseKeysUpdate.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `type` | [Components\BenefitLicenseKeysUpdateType](../../Models/Components/BenefitLicenseKeysUpdateType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `description` | *?string* | :heavy_minus_sign: | The description of the benefit. Will be displayed on products having this benefit. | | `properties` | [?Components\BenefitLicenseKeysCreateProperties](../../Models/Components/BenefitLicenseKeysCreateProperties.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/BenefitLicenseKeysUpdateType.md b/docs/Models/Components/BenefitLicenseKeysUpdateType.md deleted file mode 100644 index 31080c1..0000000 --- a/docs/Models/Components/BenefitLicenseKeysUpdateType.md +++ /dev/null @@ -1,8 +0,0 @@ -# BenefitLicenseKeysUpdateType - - -## Values - -| Name | Value | -| ------------- | ------------- | -| `LicenseKeys` | license_keys | \ No newline at end of file diff --git a/docs/Models/Components/Checkout.md b/docs/Models/Components/Checkout.md index a76afd1..42c8fb6 100644 --- a/docs/Models/Components/Checkout.md +++ b/docs/Models/Components/Checkout.md @@ -23,14 +23,14 @@ Checkout session data retrieved using an access token. | `isPaymentRequired` | *bool* | :heavy_check_mark: | Whether the checkout requires payment, e.g. in case of free products or discounts that cover the total amount. | | `isPaymentSetupRequired` | *bool* | :heavy_check_mark: | Whether the checkout requires setting up a payment method, regardless of the amount, e.g. subscriptions that have first free cycles. | | `isPaymentFormRequired` | *bool* | :heavy_check_mark: | Whether the checkout requires a payment form, whether because of a payment or payment method setup. | -| `paymentProcessorMetadata` | [Components\PaymentProcessorMetadata](../../Models/Components/PaymentProcessorMetadata.md) | :heavy_check_mark: | N/A | +| `paymentProcessorMetadata` | array | :heavy_check_mark: | N/A | | `metadata` | array | :heavy_check_mark: | N/A | | `product` | [Components\CheckoutProduct](../../Models/Components/CheckoutProduct.md) | :heavy_check_mark: | Product data for a checkout session. | | `productPrice` | [Components\ProductPriceRecurringFixed\|Components\ProductPriceRecurringCustom\|Components\ProductPriceRecurringFree\|Components\ProductPriceOneTimeFixed\|Components\ProductPriceOneTimeCustom\|Components\ProductPriceOneTimeFree](../../Models/Components/ProductPrice.md) | :heavy_check_mark: | N/A | | `attachedCustomFields` | array<[Components\AttachedCustomField](../../Models/Components/AttachedCustomField.md)> | :heavy_check_mark: | N/A | | `customerMetadata` | array | :heavy_check_mark: | N/A | | `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | -| `customFieldData` | [?Components\CheckoutCustomFieldData](../../Models/Components/CheckoutCustomFieldData.md) | :heavy_minus_sign: | Key-value object storing custom field values. | +| `customFieldData` | array | :heavy_minus_sign: | Key-value object storing custom field values. | | `embedOrigin` | *string* | :heavy_check_mark: | When checkout is embedded, represents the Origin of the page embedding the checkout. Used as a security measure to send messages only to the embedding page. | | `amount` | *int* | :heavy_check_mark: | N/A | | `taxAmount` | *int* | :heavy_check_mark: | Computed tax amount to pay in cents. | @@ -39,8 +39,8 @@ Checkout session data retrieved using an access token. | `totalAmount` | *int* | :heavy_check_mark: | Total amount to pay in cents, including discounts and after tax. | | `discountId` | *string* | :heavy_check_mark: | ID of the discount applied to the checkout. | | `customerId` | *string* | :heavy_check_mark: | N/A | -| `customerName` | *string* | :heavy_check_mark: | N/A | -| `customerEmail` | *string* | :heavy_check_mark: | N/A | +| `customerName` | *string* | :heavy_check_mark: | Name of the customer. | +| `customerEmail` | *string* | :heavy_check_mark: | Email address of the customer. | | `customerIpAddress` | *string* | :heavy_check_mark: | N/A | | `customerBillingAddress` | [Components\Address](../../Models/Components/Address.md) | :heavy_check_mark: | N/A | | `customerTaxId` | *string* | :heavy_check_mark: | N/A | diff --git a/docs/Models/Components/CheckoutConfirmStripe.md b/docs/Models/Components/CheckoutConfirmStripe.md index d87728c..c578159 100644 --- a/docs/Models/Components/CheckoutConfirmStripe.md +++ b/docs/Models/Components/CheckoutConfirmStripe.md @@ -5,14 +5,14 @@ Confirm a checkout session using a Stripe confirmation token. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | -| `customFieldData` | [?Components\CheckoutConfirmStripeCustomFieldData](../../Models/Components/CheckoutConfirmStripeCustomFieldData.md) | :heavy_minus_sign: | Key-value object storing custom field values. | -| `productPriceId` | *?string* | :heavy_minus_sign: | ID of the product price to checkout. Must correspond to a price linked to the same product. | -| `amount` | *?int* | :heavy_minus_sign: | N/A | -| `customerName` | *?string* | :heavy_minus_sign: | N/A | -| `customerEmail` | *?string* | :heavy_minus_sign: | N/A | -| `customerBillingAddress` | [?Components\Address](../../Models/Components/Address.md) | :heavy_minus_sign: | N/A | -| `customerTaxId` | *?string* | :heavy_minus_sign: | N/A | -| `discountCode` | *?string* | :heavy_minus_sign: | Discount code to apply to the checkout. | -| `confirmationTokenId` | *?string* | :heavy_minus_sign: | ID of the Stripe confirmation token. Required for fixed prices and custom prices. | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `customFieldData` | array | :heavy_minus_sign: | Key-value object storing custom field values. | +| `productPriceId` | *?string* | :heavy_minus_sign: | ID of the product price to checkout. Must correspond to a price linked to the same product. | +| `amount` | *?int* | :heavy_minus_sign: | N/A | +| `customerName` | *?string* | :heavy_minus_sign: | N/A | +| `customerEmail` | *?string* | :heavy_minus_sign: | N/A | +| `customerBillingAddress` | [?Components\Address](../../Models/Components/Address.md) | :heavy_minus_sign: | N/A | +| `customerTaxId` | *?string* | :heavy_minus_sign: | N/A | +| `discountCode` | *?string* | :heavy_minus_sign: | Discount code to apply to the checkout. | +| `confirmationTokenId` | *?string* | :heavy_minus_sign: | ID of the Stripe confirmation token. Required for fixed prices and custom prices. | \ No newline at end of file diff --git a/docs/Models/Components/CheckoutConfirmStripeCustomFieldData.md b/docs/Models/Components/CheckoutConfirmStripeCustomFieldData.md index 126166a..3c9de6c 100644 --- a/docs/Models/Components/CheckoutConfirmStripeCustomFieldData.md +++ b/docs/Models/Components/CheckoutConfirmStripeCustomFieldData.md @@ -1,7 +1,41 @@ # CheckoutConfirmStripeCustomFieldData -## Fields +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `int` + +```php +/** +* @var int +*/ +int $value = /* values here */ +``` + +### `bool` + +```php +/** +* @var bool +*/ +bool $value = /* values here */ +``` + +### `\DateTime` + +```php +/** +* @var \DateTime +*/ +\DateTime $value = /* values here */ +``` -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/CheckoutCustomFieldData.md b/docs/Models/Components/CheckoutCustomFieldData.md index 744d49f..6b41708 100644 --- a/docs/Models/Components/CheckoutCustomFieldData.md +++ b/docs/Models/Components/CheckoutCustomFieldData.md @@ -1,9 +1,41 @@ # CheckoutCustomFieldData -Key-value object storing custom field values. +## Supported Types -## Fields +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `int` + +```php +/** +* @var int +*/ +int $value = /* values here */ +``` + +### `bool` + +```php +/** +* @var bool +*/ +bool $value = /* values here */ +``` + +### `\DateTime` + +```php +/** +* @var \DateTime +*/ +\DateTime $value = /* values here */ +``` -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/CheckoutLinkPriceCreate.md b/docs/Models/Components/CheckoutLinkPriceCreate.md index fffeb73..35e1d08 100644 --- a/docs/Models/Components/CheckoutLinkPriceCreate.md +++ b/docs/Models/Components/CheckoutLinkPriceCreate.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `paymentProcessor` | [Components\CheckoutLinkPriceCreatePaymentProcessor](../../Models/Components/CheckoutLinkPriceCreatePaymentProcessor.md) | :heavy_check_mark: | Payment processor to use. Currently only Stripe is supported. | +| `paymentProcessor` | *string* | :heavy_check_mark: | Payment processor to use. Currently only Stripe is supported. | | `productPriceId` | *string* | :heavy_check_mark: | ID of the product price to checkout. | | `metadata` | array | :heavy_minus_sign: | Key-value object allowing you to store additional information.

The key must be a string with a maximum length of **40 characters**.
The value must be either:

* A string with a maximum length of **500 characters**
* An integer
* A boolean

You can store up to **50 key-value pairs**. | | `allowDiscountCodes` | *?bool* | :heavy_minus_sign: | Whether to allow the customer to apply discount codes. If you apply a discount through `discount_id`, it'll still be applied, but the customer won't be able to change it. | diff --git a/docs/Models/Components/CheckoutLinkPriceCreatePaymentProcessor.md b/docs/Models/Components/CheckoutLinkPriceCreatePaymentProcessor.md deleted file mode 100644 index f99c81d..0000000 --- a/docs/Models/Components/CheckoutLinkPriceCreatePaymentProcessor.md +++ /dev/null @@ -1,10 +0,0 @@ -# CheckoutLinkPriceCreatePaymentProcessor - -Payment processor to use. Currently only Stripe is supported. - - -## Values - -| Name | Value | -| -------- | -------- | -| `Stripe` | stripe | \ No newline at end of file diff --git a/docs/Models/Components/CheckoutLinkProductCreate.md b/docs/Models/Components/CheckoutLinkProductCreate.md index 0f953c2..4d207a9 100644 --- a/docs/Models/Components/CheckoutLinkProductCreate.md +++ b/docs/Models/Components/CheckoutLinkProductCreate.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `paymentProcessor` | [Components\CheckoutLinkProductCreatePaymentProcessor](../../Models/Components/CheckoutLinkProductCreatePaymentProcessor.md) | :heavy_check_mark: | Payment processor to use. Currently only Stripe is supported. | +| `paymentProcessor` | *string* | :heavy_check_mark: | Payment processor to use. Currently only Stripe is supported. | | `productId` | *string* | :heavy_check_mark: | ID of the product to checkout. First available price will be selected. | | `metadata` | array | :heavy_minus_sign: | Key-value object allowing you to store additional information.

The key must be a string with a maximum length of **40 characters**.
The value must be either:

* A string with a maximum length of **500 characters**
* An integer
* A boolean

You can store up to **50 key-value pairs**. | | `allowDiscountCodes` | *?bool* | :heavy_minus_sign: | Whether to allow the customer to apply discount codes. If you apply a discount through `discount_id`, it'll still be applied, but the customer won't be able to change it. | diff --git a/docs/Models/Components/CheckoutLinkProductCreatePaymentProcessor.md b/docs/Models/Components/CheckoutLinkProductCreatePaymentProcessor.md deleted file mode 100644 index a4a4621..0000000 --- a/docs/Models/Components/CheckoutLinkProductCreatePaymentProcessor.md +++ /dev/null @@ -1,10 +0,0 @@ -# CheckoutLinkProductCreatePaymentProcessor - -Payment processor to use. Currently only Stripe is supported. - - -## Values - -| Name | Value | -| -------- | -------- | -| `Stripe` | stripe | \ No newline at end of file diff --git a/docs/Models/Components/CheckoutPriceCreate.md b/docs/Models/Components/CheckoutPriceCreate.md index 5c281bd..4868fba 100644 --- a/docs/Models/Components/CheckoutPriceCreate.md +++ b/docs/Models/Components/CheckoutPriceCreate.md @@ -10,10 +10,9 @@ to the resulting order and/or subscription. | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `paymentProcessor` | [Components\CheckoutPriceCreatePaymentProcessor](../../Models/Components/CheckoutPriceCreatePaymentProcessor.md) | :heavy_check_mark: | Payment processor to use. Currently only Stripe is supported. | | `productPriceId` | *string* | :heavy_check_mark: | ID of the product price to checkout. | | `metadata` | array | :heavy_minus_sign: | Key-value object allowing you to store additional information.

The key must be a string with a maximum length of **40 characters**.
The value must be either:

* A string with a maximum length of **500 characters**
* An integer
* A boolean

You can store up to **50 key-value pairs**. | -| `customFieldData` | [?Components\CheckoutPriceCreateCustomFieldData](../../Models/Components/CheckoutPriceCreateCustomFieldData.md) | :heavy_minus_sign: | Key-value object storing custom field values. | +| `customFieldData` | array | :heavy_minus_sign: | Key-value object storing custom field values. | | `allowDiscountCodes` | *?bool* | :heavy_minus_sign: | Whether to allow the customer to apply discount codes. If you apply a discount through `discount_id`, it'll still be applied, but the customer won't be able to change it. | | `customerMetadata` | array | :heavy_minus_sign: | Key-value object allowing you to store additional information that'll be copied to the created customer.

The key must be a string with a maximum length of **40 characters**.
The value must be either:

* A string with a maximum length of **500 characters**
* An integer
* A boolean

You can store up to **50 key-value pairs**. | | `discountId` | *?string* | :heavy_minus_sign: | ID of the discount to apply to the checkout. | diff --git a/docs/Models/Components/CheckoutPriceCreateCustomFieldData.md b/docs/Models/Components/CheckoutPriceCreateCustomFieldData.md index 5ba93b0..ebee527 100644 --- a/docs/Models/Components/CheckoutPriceCreateCustomFieldData.md +++ b/docs/Models/Components/CheckoutPriceCreateCustomFieldData.md @@ -1,9 +1,41 @@ # CheckoutPriceCreateCustomFieldData -Key-value object storing custom field values. +## Supported Types -## Fields +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `int` + +```php +/** +* @var int +*/ +int $value = /* values here */ +``` + +### `bool` + +```php +/** +* @var bool +*/ +bool $value = /* values here */ +``` + +### `\DateTime` + +```php +/** +* @var \DateTime +*/ +\DateTime $value = /* values here */ +``` -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/CheckoutPriceCreatePaymentProcessor.md b/docs/Models/Components/CheckoutPriceCreatePaymentProcessor.md deleted file mode 100644 index 4f91b94..0000000 --- a/docs/Models/Components/CheckoutPriceCreatePaymentProcessor.md +++ /dev/null @@ -1,10 +0,0 @@ -# CheckoutPriceCreatePaymentProcessor - -Payment processor to use. Currently only Stripe is supported. - - -## Values - -| Name | Value | -| -------- | -------- | -| `Stripe` | stripe | \ No newline at end of file diff --git a/docs/Models/Components/CheckoutProductCreate.md b/docs/Models/Components/CheckoutProductCreate.md index 100abd7..8845317 100644 --- a/docs/Models/Components/CheckoutProductCreate.md +++ b/docs/Models/Components/CheckoutProductCreate.md @@ -10,10 +10,9 @@ to the resulting order and/or subscription. | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `paymentProcessor` | [Components\CheckoutProductCreatePaymentProcessor](../../Models/Components/CheckoutProductCreatePaymentProcessor.md) | :heavy_check_mark: | Payment processor to use. Currently only Stripe is supported. | | `productId` | *string* | :heavy_check_mark: | ID of the product to checkout. First available price will be selected. | | `metadata` | array | :heavy_minus_sign: | Key-value object allowing you to store additional information.

The key must be a string with a maximum length of **40 characters**.
The value must be either:

* A string with a maximum length of **500 characters**
* An integer
* A boolean

You can store up to **50 key-value pairs**. | -| `customFieldData` | [?Components\CheckoutProductCreateCustomFieldData](../../Models/Components/CheckoutProductCreateCustomFieldData.md) | :heavy_minus_sign: | Key-value object storing custom field values. | +| `customFieldData` | array | :heavy_minus_sign: | Key-value object storing custom field values. | | `allowDiscountCodes` | *?bool* | :heavy_minus_sign: | Whether to allow the customer to apply discount codes. If you apply a discount through `discount_id`, it'll still be applied, but the customer won't be able to change it. | | `customerMetadata` | array | :heavy_minus_sign: | Key-value object allowing you to store additional information that'll be copied to the created customer.

The key must be a string with a maximum length of **40 characters**.
The value must be either:

* A string with a maximum length of **500 characters**
* An integer
* A boolean

You can store up to **50 key-value pairs**. | | `discountId` | *?string* | :heavy_minus_sign: | ID of the discount to apply to the checkout. | diff --git a/docs/Models/Components/CheckoutProductCreateCustomFieldData.md b/docs/Models/Components/CheckoutProductCreateCustomFieldData.md index 14348ab..16f235a 100644 --- a/docs/Models/Components/CheckoutProductCreateCustomFieldData.md +++ b/docs/Models/Components/CheckoutProductCreateCustomFieldData.md @@ -1,9 +1,41 @@ # CheckoutProductCreateCustomFieldData -Key-value object storing custom field values. +## Supported Types -## Fields +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `int` + +```php +/** +* @var int +*/ +int $value = /* values here */ +``` + +### `bool` + +```php +/** +* @var bool +*/ +bool $value = /* values here */ +``` + +### `\DateTime` + +```php +/** +* @var \DateTime +*/ +\DateTime $value = /* values here */ +``` -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/CheckoutProductCreatePaymentProcessor.md b/docs/Models/Components/CheckoutProductCreatePaymentProcessor.md deleted file mode 100644 index ef9957c..0000000 --- a/docs/Models/Components/CheckoutProductCreatePaymentProcessor.md +++ /dev/null @@ -1,10 +0,0 @@ -# CheckoutProductCreatePaymentProcessor - -Payment processor to use. Currently only Stripe is supported. - - -## Values - -| Name | Value | -| -------- | -------- | -| `Stripe` | stripe | \ No newline at end of file diff --git a/docs/Models/Components/CheckoutPublic.md b/docs/Models/Components/CheckoutPublic.md index c1d71f8..ddce8d8 100644 --- a/docs/Models/Components/CheckoutPublic.md +++ b/docs/Models/Components/CheckoutPublic.md @@ -23,13 +23,13 @@ Checkout session data retrieved using the client secret. | `isPaymentRequired` | *bool* | :heavy_check_mark: | Whether the checkout requires payment, e.g. in case of free products or discounts that cover the total amount. | | `isPaymentSetupRequired` | *bool* | :heavy_check_mark: | Whether the checkout requires setting up a payment method, regardless of the amount, e.g. subscriptions that have first free cycles. | | `isPaymentFormRequired` | *bool* | :heavy_check_mark: | Whether the checkout requires a payment form, whether because of a payment or payment method setup. | -| `paymentProcessorMetadata` | [Components\CheckoutPublicPaymentProcessorMetadata](../../Models/Components/CheckoutPublicPaymentProcessorMetadata.md) | :heavy_check_mark: | N/A | +| `paymentProcessorMetadata` | array | :heavy_check_mark: | N/A | | `product` | [Components\CheckoutProduct](../../Models/Components/CheckoutProduct.md) | :heavy_check_mark: | Product data for a checkout session. | | `productPrice` | [Components\ProductPriceRecurringFixed\|Components\ProductPriceRecurringCustom\|Components\ProductPriceRecurringFree\|Components\ProductPriceOneTimeFixed\|Components\ProductPriceOneTimeCustom\|Components\ProductPriceOneTimeFree](../../Models/Components/ProductPrice.md) | :heavy_check_mark: | N/A | | `organization` | [Components\Organization](../../Models/Components/Organization.md) | :heavy_check_mark: | N/A | | `attachedCustomFields` | array<[Components\AttachedCustomField](../../Models/Components/AttachedCustomField.md)> | :heavy_check_mark: | N/A | | `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | -| `customFieldData` | [?Components\CheckoutPublicCustomFieldData](../../Models/Components/CheckoutPublicCustomFieldData.md) | :heavy_minus_sign: | Key-value object storing custom field values. | +| `customFieldData` | array | :heavy_minus_sign: | Key-value object storing custom field values. | | `embedOrigin` | *string* | :heavy_check_mark: | When checkout is embedded, represents the Origin of the page embedding the checkout. Used as a security measure to send messages only to the embedding page. | | `amount` | *int* | :heavy_check_mark: | N/A | | `taxAmount` | *int* | :heavy_check_mark: | Computed tax amount to pay in cents. | @@ -38,8 +38,8 @@ Checkout session data retrieved using the client secret. | `totalAmount` | *int* | :heavy_check_mark: | Total amount to pay in cents, including discounts and after tax. | | `discountId` | *string* | :heavy_check_mark: | ID of the discount applied to the checkout. | | `customerId` | *string* | :heavy_check_mark: | N/A | -| `customerName` | *string* | :heavy_check_mark: | N/A | -| `customerEmail` | *string* | :heavy_check_mark: | N/A | +| `customerName` | *string* | :heavy_check_mark: | Name of the customer. | +| `customerEmail` | *string* | :heavy_check_mark: | Email address of the customer. | | `customerIpAddress` | *string* | :heavy_check_mark: | N/A | | `customerBillingAddress` | [Components\Address](../../Models/Components/Address.md) | :heavy_check_mark: | N/A | | `customerTaxId` | *string* | :heavy_check_mark: | N/A | diff --git a/docs/Models/Components/CheckoutPublicConfirmed.md b/docs/Models/Components/CheckoutPublicConfirmed.md index 5e9ad22..45d9a87 100644 --- a/docs/Models/Components/CheckoutPublicConfirmed.md +++ b/docs/Models/Components/CheckoutPublicConfirmed.md @@ -13,7 +13,7 @@ right after the checkout. | `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | | `id` | *string* | :heavy_check_mark: | The ID of the object. | | `paymentProcessor` | [Components\PaymentProcessor](../../Models/Components/PaymentProcessor.md) | :heavy_check_mark: | N/A | -| `status` | [Components\Status](../../Models/Components/Status.md) | :heavy_check_mark: | N/A | +| `status` | *string* | :heavy_check_mark: | N/A | | `clientSecret` | *string* | :heavy_check_mark: | Client secret used to update and complete the checkout session from the client. | | `url` | *string* | :heavy_check_mark: | URL where the customer can access the checkout session. | | `expiresAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Expiration date and time of the checkout session. | @@ -26,14 +26,14 @@ right after the checkout. | `isPaymentRequired` | *bool* | :heavy_check_mark: | Whether the checkout requires payment, e.g. in case of free products or discounts that cover the total amount. | | `isPaymentSetupRequired` | *bool* | :heavy_check_mark: | Whether the checkout requires setting up a payment method, regardless of the amount, e.g. subscriptions that have first free cycles. | | `isPaymentFormRequired` | *bool* | :heavy_check_mark: | Whether the checkout requires a payment form, whether because of a payment or payment method setup. | -| `paymentProcessorMetadata` | [Components\CheckoutPublicConfirmedPaymentProcessorMetadata](../../Models/Components/CheckoutPublicConfirmedPaymentProcessorMetadata.md) | :heavy_check_mark: | N/A | +| `paymentProcessorMetadata` | array | :heavy_check_mark: | N/A | | `product` | [Components\CheckoutProduct](../../Models/Components/CheckoutProduct.md) | :heavy_check_mark: | Product data for a checkout session. | | `productPrice` | [Components\ProductPriceRecurringFixed\|Components\ProductPriceRecurringCustom\|Components\ProductPriceRecurringFree\|Components\ProductPriceOneTimeFixed\|Components\ProductPriceOneTimeCustom\|Components\ProductPriceOneTimeFree](../../Models/Components/ProductPrice.md) | :heavy_check_mark: | N/A | | `organization` | [Components\Organization](../../Models/Components/Organization.md) | :heavy_check_mark: | N/A | | `attachedCustomFields` | array<[Components\AttachedCustomField](../../Models/Components/AttachedCustomField.md)> | :heavy_check_mark: | N/A | | `customerSessionToken` | *string* | :heavy_check_mark: | N/A | | `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | -| `customFieldData` | [?Components\CheckoutPublicConfirmedCustomFieldData](../../Models/Components/CheckoutPublicConfirmedCustomFieldData.md) | :heavy_minus_sign: | Key-value object storing custom field values. | +| `customFieldData` | array | :heavy_minus_sign: | Key-value object storing custom field values. | | `embedOrigin` | *string* | :heavy_check_mark: | When checkout is embedded, represents the Origin of the page embedding the checkout. Used as a security measure to send messages only to the embedding page. | | `amount` | *int* | :heavy_check_mark: | N/A | | `taxAmount` | *int* | :heavy_check_mark: | Computed tax amount to pay in cents. | @@ -42,8 +42,8 @@ right after the checkout. | `totalAmount` | *int* | :heavy_check_mark: | Total amount to pay in cents, including discounts and after tax. | | `discountId` | *string* | :heavy_check_mark: | ID of the discount applied to the checkout. | | `customerId` | *string* | :heavy_check_mark: | N/A | -| `customerName` | *string* | :heavy_check_mark: | N/A | -| `customerEmail` | *string* | :heavy_check_mark: | N/A | +| `customerName` | *string* | :heavy_check_mark: | Name of the customer. | +| `customerEmail` | *string* | :heavy_check_mark: | Email address of the customer. | | `customerIpAddress` | *string* | :heavy_check_mark: | N/A | | `customerBillingAddress` | [Components\Address](../../Models/Components/Address.md) | :heavy_check_mark: | N/A | | `customerTaxId` | *string* | :heavy_check_mark: | N/A | diff --git a/docs/Models/Components/CheckoutPublicConfirmedCustomFieldData.md b/docs/Models/Components/CheckoutPublicConfirmedCustomFieldData.md index 65a6523..bda3099 100644 --- a/docs/Models/Components/CheckoutPublicConfirmedCustomFieldData.md +++ b/docs/Models/Components/CheckoutPublicConfirmedCustomFieldData.md @@ -1,9 +1,41 @@ # CheckoutPublicConfirmedCustomFieldData -Key-value object storing custom field values. +## Supported Types -## Fields +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `int` + +```php +/** +* @var int +*/ +int $value = /* values here */ +``` + +### `bool` + +```php +/** +* @var bool +*/ +bool $value = /* values here */ +``` + +### `\DateTime` + +```php +/** +* @var \DateTime +*/ +\DateTime $value = /* values here */ +``` -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/CheckoutPublicConfirmedPaymentProcessorMetadata.md b/docs/Models/Components/CheckoutPublicConfirmedPaymentProcessorMetadata.md deleted file mode 100644 index e58338a..0000000 --- a/docs/Models/Components/CheckoutPublicConfirmedPaymentProcessorMetadata.md +++ /dev/null @@ -1,7 +0,0 @@ -# CheckoutPublicConfirmedPaymentProcessorMetadata - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/CheckoutPublicCustomFieldData.md b/docs/Models/Components/CheckoutPublicCustomFieldData.md index 84b61ac..88cdc15 100644 --- a/docs/Models/Components/CheckoutPublicCustomFieldData.md +++ b/docs/Models/Components/CheckoutPublicCustomFieldData.md @@ -1,9 +1,41 @@ # CheckoutPublicCustomFieldData -Key-value object storing custom field values. +## Supported Types -## Fields +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `int` + +```php +/** +* @var int +*/ +int $value = /* values here */ +``` + +### `bool` + +```php +/** +* @var bool +*/ +bool $value = /* values here */ +``` + +### `\DateTime` + +```php +/** +* @var \DateTime +*/ +\DateTime $value = /* values here */ +``` -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/CheckoutPublicPaymentProcessorMetadata.md b/docs/Models/Components/CheckoutPublicPaymentProcessorMetadata.md deleted file mode 100644 index 001595a..0000000 --- a/docs/Models/Components/CheckoutPublicPaymentProcessorMetadata.md +++ /dev/null @@ -1,7 +0,0 @@ -# CheckoutPublicPaymentProcessorMetadata - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/CheckoutUpdate.md b/docs/Models/Components/CheckoutUpdate.md index 7c52e26..9a7a2c5 100644 --- a/docs/Models/Components/CheckoutUpdate.md +++ b/docs/Models/Components/CheckoutUpdate.md @@ -7,7 +7,7 @@ Update an existing checkout session using an access token. | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `customFieldData` | [?Components\CustomFieldData](../../Models/Components/CustomFieldData.md) | :heavy_minus_sign: | Key-value object storing custom field values. | +| `customFieldData` | array | :heavy_minus_sign: | Key-value object storing custom field values. | | `productPriceId` | *?string* | :heavy_minus_sign: | ID of the product price to checkout. Must correspond to a price linked to the same product. | | `amount` | *?int* | :heavy_minus_sign: | N/A | | `customerName` | *?string* | :heavy_minus_sign: | N/A | diff --git a/docs/Models/Components/CheckoutUpdateCustomFieldData.md b/docs/Models/Components/CheckoutUpdateCustomFieldData.md new file mode 100644 index 0000000..923e35c --- /dev/null +++ b/docs/Models/Components/CheckoutUpdateCustomFieldData.md @@ -0,0 +1,41 @@ +# CheckoutUpdateCustomFieldData + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `int` + +```php +/** +* @var int +*/ +int $value = /* values here */ +``` + +### `bool` + +```php +/** +* @var bool +*/ +bool $value = /* values here */ +``` + +### `\DateTime` + +```php +/** +* @var \DateTime +*/ +\DateTime $value = /* values here */ +``` + diff --git a/docs/Models/Components/CheckoutUpdatePublic.md b/docs/Models/Components/CheckoutUpdatePublic.md index 59e4c17..c9599ff 100644 --- a/docs/Models/Components/CheckoutUpdatePublic.md +++ b/docs/Models/Components/CheckoutUpdatePublic.md @@ -5,13 +5,13 @@ Update an existing checkout session using the client secret. ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| `customFieldData` | [?Components\CheckoutUpdatePublicCustomFieldData](../../Models/Components/CheckoutUpdatePublicCustomFieldData.md) | :heavy_minus_sign: | Key-value object storing custom field values. | -| `productPriceId` | *?string* | :heavy_minus_sign: | ID of the product price to checkout. Must correspond to a price linked to the same product. | -| `amount` | *?int* | :heavy_minus_sign: | N/A | -| `customerName` | *?string* | :heavy_minus_sign: | N/A | -| `customerEmail` | *?string* | :heavy_minus_sign: | N/A | -| `customerBillingAddress` | [?Components\Address](../../Models/Components/Address.md) | :heavy_minus_sign: | N/A | -| `customerTaxId` | *?string* | :heavy_minus_sign: | N/A | -| `discountCode` | *?string* | :heavy_minus_sign: | Discount code to apply to the checkout. | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `customFieldData` | array | :heavy_minus_sign: | Key-value object storing custom field values. | +| `productPriceId` | *?string* | :heavy_minus_sign: | ID of the product price to checkout. Must correspond to a price linked to the same product. | +| `amount` | *?int* | :heavy_minus_sign: | N/A | +| `customerName` | *?string* | :heavy_minus_sign: | N/A | +| `customerEmail` | *?string* | :heavy_minus_sign: | N/A | +| `customerBillingAddress` | [?Components\Address](../../Models/Components/Address.md) | :heavy_minus_sign: | N/A | +| `customerTaxId` | *?string* | :heavy_minus_sign: | N/A | +| `discountCode` | *?string* | :heavy_minus_sign: | Discount code to apply to the checkout. | \ No newline at end of file diff --git a/docs/Models/Components/CheckoutUpdatePublicCustomFieldData.md b/docs/Models/Components/CheckoutUpdatePublicCustomFieldData.md index 3bbacc6..f672b13 100644 --- a/docs/Models/Components/CheckoutUpdatePublicCustomFieldData.md +++ b/docs/Models/Components/CheckoutUpdatePublicCustomFieldData.md @@ -1,7 +1,41 @@ # CheckoutUpdatePublicCustomFieldData -## Fields +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `int` + +```php +/** +* @var int +*/ +int $value = /* values here */ +``` + +### `bool` + +```php +/** +* @var bool +*/ +bool $value = /* values here */ +``` + +### `\DateTime` + +```php +/** +* @var \DateTime +*/ +\DateTime $value = /* values here */ +``` -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/Clauses.md b/docs/Models/Components/Clauses.md new file mode 100644 index 0000000..c271db1 --- /dev/null +++ b/docs/Models/Components/Clauses.md @@ -0,0 +1,23 @@ +# Clauses + + +## Supported Types + +### `Components\FilterClause` + +```php +/** +* @var Components\FilterClause +*/ +Components\FilterClause $value = /* values here */ +``` + +### `Components\Filter` + +```php +/** +* @var Components\Filter +*/ +Components\Filter $value = /* values here */ +``` + diff --git a/docs/Models/Components/CountAggregation.md b/docs/Models/Components/CountAggregation.md new file mode 100644 index 0000000..da44bff --- /dev/null +++ b/docs/Models/Components/CountAggregation.md @@ -0,0 +1,8 @@ +# CountAggregation + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `func` | *?string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/CustomFieldCheckbox.md b/docs/Models/Components/CustomFieldCheckbox.md index 8d35f9e..474365b 100644 --- a/docs/Models/Components/CustomFieldCheckbox.md +++ b/docs/Models/Components/CustomFieldCheckbox.md @@ -10,7 +10,7 @@ Schema for a custom field of type checkbox. | `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | | `id` | *string* | :heavy_check_mark: | The ID of the object. | | `metadata` | array | :heavy_check_mark: | N/A | -| `type` | [Components\CustomFieldCheckboxType](../../Models/Components/CustomFieldCheckboxType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `slug` | *string* | :heavy_check_mark: | Identifier of the custom field. It'll be used as key when storing the value. | | `name` | *string* | :heavy_check_mark: | Name of the custom field. | | `organizationId` | *string* | :heavy_check_mark: | The ID of the organization owning the custom field. | diff --git a/docs/Models/Components/CustomFieldCheckboxType.md b/docs/Models/Components/CustomFieldCheckboxType.md deleted file mode 100644 index 8e5ff7b..0000000 --- a/docs/Models/Components/CustomFieldCheckboxType.md +++ /dev/null @@ -1,8 +0,0 @@ -# CustomFieldCheckboxType - - -## Values - -| Name | Value | -| ---------- | ---------- | -| `Checkbox` | checkbox | \ No newline at end of file diff --git a/docs/Models/Components/CustomFieldCreateCheckbox.md b/docs/Models/Components/CustomFieldCreateCheckbox.md index f312b28..4498777 100644 --- a/docs/Models/Components/CustomFieldCreateCheckbox.md +++ b/docs/Models/Components/CustomFieldCreateCheckbox.md @@ -7,7 +7,7 @@ Schema to create a custom field of type checkbox. | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `type` | [Components\CustomFieldCreateCheckboxType](../../Models/Components/CustomFieldCreateCheckboxType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `slug` | *string* | :heavy_check_mark: | Identifier of the custom field. It'll be used as key when storing the value. Must be unique across the organization.It can only contain ASCII letters, numbers and hyphens. | | `name` | *string* | :heavy_check_mark: | Name of the custom field. | | `properties` | [Components\CustomFieldCheckboxProperties](../../Models/Components/CustomFieldCheckboxProperties.md) | :heavy_check_mark: | N/A | diff --git a/docs/Models/Components/CustomFieldCreateCheckboxType.md b/docs/Models/Components/CustomFieldCreateCheckboxType.md deleted file mode 100644 index 433f9c5..0000000 --- a/docs/Models/Components/CustomFieldCreateCheckboxType.md +++ /dev/null @@ -1,8 +0,0 @@ -# CustomFieldCreateCheckboxType - - -## Values - -| Name | Value | -| ---------- | ---------- | -| `Checkbox` | checkbox | \ No newline at end of file diff --git a/docs/Models/Components/CustomFieldCreateDate.md b/docs/Models/Components/CustomFieldCreateDate.md index 727fd8f..a20de78 100644 --- a/docs/Models/Components/CustomFieldCreateDate.md +++ b/docs/Models/Components/CustomFieldCreateDate.md @@ -7,7 +7,7 @@ Schema to create a custom field of type date. | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `type` | [Components\CustomFieldCreateDateType](../../Models/Components/CustomFieldCreateDateType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `slug` | *string* | :heavy_check_mark: | Identifier of the custom field. It'll be used as key when storing the value. Must be unique across the organization.It can only contain ASCII letters, numbers and hyphens. | | `name` | *string* | :heavy_check_mark: | Name of the custom field. | | `properties` | [Components\CustomFieldDateProperties](../../Models/Components/CustomFieldDateProperties.md) | :heavy_check_mark: | N/A | diff --git a/docs/Models/Components/CustomFieldCreateDateType.md b/docs/Models/Components/CustomFieldCreateDateType.md deleted file mode 100644 index fbda594..0000000 --- a/docs/Models/Components/CustomFieldCreateDateType.md +++ /dev/null @@ -1,8 +0,0 @@ -# CustomFieldCreateDateType - - -## Values - -| Name | Value | -| ------ | ------ | -| `Date` | date | \ No newline at end of file diff --git a/docs/Models/Components/CustomFieldCreateNumber.md b/docs/Models/Components/CustomFieldCreateNumber.md index df02204..65f29b4 100644 --- a/docs/Models/Components/CustomFieldCreateNumber.md +++ b/docs/Models/Components/CustomFieldCreateNumber.md @@ -7,7 +7,7 @@ Schema to create a custom field of type number. | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `type` | [Components\CustomFieldCreateNumberType](../../Models/Components/CustomFieldCreateNumberType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `slug` | *string* | :heavy_check_mark: | Identifier of the custom field. It'll be used as key when storing the value. Must be unique across the organization.It can only contain ASCII letters, numbers and hyphens. | | `name` | *string* | :heavy_check_mark: | Name of the custom field. | | `properties` | [Components\CustomFieldNumberProperties](../../Models/Components/CustomFieldNumberProperties.md) | :heavy_check_mark: | N/A | diff --git a/docs/Models/Components/CustomFieldCreateNumberType.md b/docs/Models/Components/CustomFieldCreateNumberType.md deleted file mode 100644 index d8ee11f..0000000 --- a/docs/Models/Components/CustomFieldCreateNumberType.md +++ /dev/null @@ -1,8 +0,0 @@ -# CustomFieldCreateNumberType - - -## Values - -| Name | Value | -| -------- | -------- | -| `Number` | number | \ No newline at end of file diff --git a/docs/Models/Components/CustomFieldCreateSelect.md b/docs/Models/Components/CustomFieldCreateSelect.md index 79a5266..5e353b7 100644 --- a/docs/Models/Components/CustomFieldCreateSelect.md +++ b/docs/Models/Components/CustomFieldCreateSelect.md @@ -7,7 +7,7 @@ Schema to create a custom field of type select. | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `type` | [Components\CustomFieldCreateSelectType](../../Models/Components/CustomFieldCreateSelectType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `slug` | *string* | :heavy_check_mark: | Identifier of the custom field. It'll be used as key when storing the value. Must be unique across the organization.It can only contain ASCII letters, numbers and hyphens. | | `name` | *string* | :heavy_check_mark: | Name of the custom field. | | `properties` | [Components\CustomFieldSelectProperties](../../Models/Components/CustomFieldSelectProperties.md) | :heavy_check_mark: | N/A | diff --git a/docs/Models/Components/CustomFieldCreateSelectType.md b/docs/Models/Components/CustomFieldCreateSelectType.md deleted file mode 100644 index a0ee824..0000000 --- a/docs/Models/Components/CustomFieldCreateSelectType.md +++ /dev/null @@ -1,8 +0,0 @@ -# CustomFieldCreateSelectType - - -## Values - -| Name | Value | -| -------- | -------- | -| `Select` | select | \ No newline at end of file diff --git a/docs/Models/Components/CustomFieldCreateText.md b/docs/Models/Components/CustomFieldCreateText.md index 555450c..a85937e 100644 --- a/docs/Models/Components/CustomFieldCreateText.md +++ b/docs/Models/Components/CustomFieldCreateText.md @@ -7,7 +7,7 @@ Schema to create a custom field of type text. | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `type` | [Components\CustomFieldCreateTextType](../../Models/Components/CustomFieldCreateTextType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `slug` | *string* | :heavy_check_mark: | Identifier of the custom field. It'll be used as key when storing the value. Must be unique across the organization.It can only contain ASCII letters, numbers and hyphens. | | `name` | *string* | :heavy_check_mark: | Name of the custom field. | | `properties` | [Components\CustomFieldTextProperties](../../Models/Components/CustomFieldTextProperties.md) | :heavy_check_mark: | N/A | diff --git a/docs/Models/Components/CustomFieldCreateTextType.md b/docs/Models/Components/CustomFieldCreateTextType.md deleted file mode 100644 index 8cffea8..0000000 --- a/docs/Models/Components/CustomFieldCreateTextType.md +++ /dev/null @@ -1,8 +0,0 @@ -# CustomFieldCreateTextType - - -## Values - -| Name | Value | -| ------ | ------ | -| `Text` | text | \ No newline at end of file diff --git a/docs/Models/Components/CustomFieldData.md b/docs/Models/Components/CustomFieldData.md index 8bf0994..32c39f7 100644 --- a/docs/Models/Components/CustomFieldData.md +++ b/docs/Models/Components/CustomFieldData.md @@ -1,7 +1,41 @@ # CustomFieldData -## Fields +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `int` + +```php +/** +* @var int +*/ +int $value = /* values here */ +``` + +### `bool` + +```php +/** +* @var bool +*/ +bool $value = /* values here */ +``` + +### `\DateTime` + +```php +/** +* @var \DateTime +*/ +\DateTime $value = /* values here */ +``` -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/CustomFieldDate.md b/docs/Models/Components/CustomFieldDate.md index 06768d0..a8267df 100644 --- a/docs/Models/Components/CustomFieldDate.md +++ b/docs/Models/Components/CustomFieldDate.md @@ -10,7 +10,7 @@ Schema for a custom field of type date. | `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | | `id` | *string* | :heavy_check_mark: | The ID of the object. | | `metadata` | array | :heavy_check_mark: | N/A | -| `type` | [Components\CustomFieldDateType](../../Models/Components/CustomFieldDateType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `slug` | *string* | :heavy_check_mark: | Identifier of the custom field. It'll be used as key when storing the value. | | `name` | *string* | :heavy_check_mark: | Name of the custom field. | | `organizationId` | *string* | :heavy_check_mark: | The ID of the organization owning the custom field. | diff --git a/docs/Models/Components/CustomFieldDateType.md b/docs/Models/Components/CustomFieldDateType.md deleted file mode 100644 index d00298f..0000000 --- a/docs/Models/Components/CustomFieldDateType.md +++ /dev/null @@ -1,8 +0,0 @@ -# CustomFieldDateType - - -## Values - -| Name | Value | -| ------ | ------ | -| `Date` | date | \ No newline at end of file diff --git a/docs/Models/Components/CustomFieldNumber.md b/docs/Models/Components/CustomFieldNumber.md index d613726..5129060 100644 --- a/docs/Models/Components/CustomFieldNumber.md +++ b/docs/Models/Components/CustomFieldNumber.md @@ -10,7 +10,7 @@ Schema for a custom field of type number. | `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | | `id` | *string* | :heavy_check_mark: | The ID of the object. | | `metadata` | array | :heavy_check_mark: | N/A | -| `type` | [Components\CustomFieldNumberType](../../Models/Components/CustomFieldNumberType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `slug` | *string* | :heavy_check_mark: | Identifier of the custom field. It'll be used as key when storing the value. | | `name` | *string* | :heavy_check_mark: | Name of the custom field. | | `organizationId` | *string* | :heavy_check_mark: | The ID of the organization owning the custom field. | diff --git a/docs/Models/Components/CustomFieldNumberType.md b/docs/Models/Components/CustomFieldNumberType.md deleted file mode 100644 index 4e318c0..0000000 --- a/docs/Models/Components/CustomFieldNumberType.md +++ /dev/null @@ -1,8 +0,0 @@ -# CustomFieldNumberType - - -## Values - -| Name | Value | -| -------- | -------- | -| `Number` | number | \ No newline at end of file diff --git a/docs/Models/Components/CustomFieldSelect.md b/docs/Models/Components/CustomFieldSelect.md index 419be83..1c82d22 100644 --- a/docs/Models/Components/CustomFieldSelect.md +++ b/docs/Models/Components/CustomFieldSelect.md @@ -10,7 +10,7 @@ Schema for a custom field of type select. | `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | | `id` | *string* | :heavy_check_mark: | The ID of the object. | | `metadata` | array | :heavy_check_mark: | N/A | -| `type` | [Components\CustomFieldSelectType](../../Models/Components/CustomFieldSelectType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `slug` | *string* | :heavy_check_mark: | Identifier of the custom field. It'll be used as key when storing the value. | | `name` | *string* | :heavy_check_mark: | Name of the custom field. | | `organizationId` | *string* | :heavy_check_mark: | The ID of the organization owning the custom field. | diff --git a/docs/Models/Components/CustomFieldSelectType.md b/docs/Models/Components/CustomFieldSelectType.md deleted file mode 100644 index f0e2b77..0000000 --- a/docs/Models/Components/CustomFieldSelectType.md +++ /dev/null @@ -1,8 +0,0 @@ -# CustomFieldSelectType - - -## Values - -| Name | Value | -| -------- | -------- | -| `Select` | select | \ No newline at end of file diff --git a/docs/Models/Components/CustomFieldText.md b/docs/Models/Components/CustomFieldText.md index 6fc7227..86aa7f7 100644 --- a/docs/Models/Components/CustomFieldText.md +++ b/docs/Models/Components/CustomFieldText.md @@ -10,7 +10,7 @@ Schema for a custom field of type text. | `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | | `id` | *string* | :heavy_check_mark: | The ID of the object. | | `metadata` | array | :heavy_check_mark: | N/A | -| `type` | [Components\CustomFieldTextType](../../Models/Components/CustomFieldTextType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `slug` | *string* | :heavy_check_mark: | Identifier of the custom field. It'll be used as key when storing the value. | | `name` | *string* | :heavy_check_mark: | Name of the custom field. | | `organizationId` | *string* | :heavy_check_mark: | The ID of the organization owning the custom field. | diff --git a/docs/Models/Components/CustomFieldTextType.md b/docs/Models/Components/CustomFieldTextType.md deleted file mode 100644 index deb03e0..0000000 --- a/docs/Models/Components/CustomFieldTextType.md +++ /dev/null @@ -1,8 +0,0 @@ -# CustomFieldTextType - - -## Values - -| Name | Value | -| ------ | ------ | -| `Text` | text | \ No newline at end of file diff --git a/docs/Models/Components/CustomFieldUpdateCheckbox.md b/docs/Models/Components/CustomFieldUpdateCheckbox.md index cf9fb87..9758e97 100644 --- a/docs/Models/Components/CustomFieldUpdateCheckbox.md +++ b/docs/Models/Components/CustomFieldUpdateCheckbox.md @@ -7,7 +7,7 @@ Schema to update a custom field of type checkbox. | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `type` | [Components\CustomFieldUpdateCheckboxType](../../Models/Components/CustomFieldUpdateCheckboxType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `metadata` | array | :heavy_minus_sign: | N/A | | `name` | *?string* | :heavy_minus_sign: | N/A | | `slug` | *?string* | :heavy_minus_sign: | N/A | diff --git a/docs/Models/Components/CustomFieldUpdateCheckboxType.md b/docs/Models/Components/CustomFieldUpdateCheckboxType.md deleted file mode 100644 index 25a65c8..0000000 --- a/docs/Models/Components/CustomFieldUpdateCheckboxType.md +++ /dev/null @@ -1,8 +0,0 @@ -# CustomFieldUpdateCheckboxType - - -## Values - -| Name | Value | -| ---------- | ---------- | -| `Checkbox` | checkbox | \ No newline at end of file diff --git a/docs/Models/Components/CustomFieldUpdateDate.md b/docs/Models/Components/CustomFieldUpdateDate.md index b13f2ab..bc8a66e 100644 --- a/docs/Models/Components/CustomFieldUpdateDate.md +++ b/docs/Models/Components/CustomFieldUpdateDate.md @@ -7,7 +7,7 @@ Schema to update a custom field of type date. | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `type` | [Components\CustomFieldUpdateDateType](../../Models/Components/CustomFieldUpdateDateType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `metadata` | array | :heavy_minus_sign: | N/A | | `name` | *?string* | :heavy_minus_sign: | N/A | | `slug` | *?string* | :heavy_minus_sign: | N/A | diff --git a/docs/Models/Components/CustomFieldUpdateDateType.md b/docs/Models/Components/CustomFieldUpdateDateType.md deleted file mode 100644 index a3fe2b3..0000000 --- a/docs/Models/Components/CustomFieldUpdateDateType.md +++ /dev/null @@ -1,8 +0,0 @@ -# CustomFieldUpdateDateType - - -## Values - -| Name | Value | -| ------ | ------ | -| `Date` | date | \ No newline at end of file diff --git a/docs/Models/Components/CustomFieldUpdateNumber.md b/docs/Models/Components/CustomFieldUpdateNumber.md index 452088d..b90fd33 100644 --- a/docs/Models/Components/CustomFieldUpdateNumber.md +++ b/docs/Models/Components/CustomFieldUpdateNumber.md @@ -7,7 +7,7 @@ Schema to update a custom field of type number. | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `type` | [Components\CustomFieldUpdateNumberType](../../Models/Components/CustomFieldUpdateNumberType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `metadata` | array | :heavy_minus_sign: | N/A | | `name` | *?string* | :heavy_minus_sign: | N/A | | `slug` | *?string* | :heavy_minus_sign: | N/A | diff --git a/docs/Models/Components/CustomFieldUpdateNumberType.md b/docs/Models/Components/CustomFieldUpdateNumberType.md deleted file mode 100644 index 8726dbc..0000000 --- a/docs/Models/Components/CustomFieldUpdateNumberType.md +++ /dev/null @@ -1,8 +0,0 @@ -# CustomFieldUpdateNumberType - - -## Values - -| Name | Value | -| -------- | -------- | -| `Number` | number | \ No newline at end of file diff --git a/docs/Models/Components/CustomFieldUpdateSelect.md b/docs/Models/Components/CustomFieldUpdateSelect.md index 6b7c1bc..2e8a417 100644 --- a/docs/Models/Components/CustomFieldUpdateSelect.md +++ b/docs/Models/Components/CustomFieldUpdateSelect.md @@ -7,7 +7,7 @@ Schema to update a custom field of type select. | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `type` | [Components\CustomFieldUpdateSelectType](../../Models/Components/CustomFieldUpdateSelectType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `metadata` | array | :heavy_minus_sign: | N/A | | `name` | *?string* | :heavy_minus_sign: | N/A | | `slug` | *?string* | :heavy_minus_sign: | N/A | diff --git a/docs/Models/Components/CustomFieldUpdateSelectType.md b/docs/Models/Components/CustomFieldUpdateSelectType.md deleted file mode 100644 index 207f365..0000000 --- a/docs/Models/Components/CustomFieldUpdateSelectType.md +++ /dev/null @@ -1,8 +0,0 @@ -# CustomFieldUpdateSelectType - - -## Values - -| Name | Value | -| -------- | -------- | -| `Select` | select | \ No newline at end of file diff --git a/docs/Models/Components/CustomFieldUpdateText.md b/docs/Models/Components/CustomFieldUpdateText.md index dec9e1a..3ca2d23 100644 --- a/docs/Models/Components/CustomFieldUpdateText.md +++ b/docs/Models/Components/CustomFieldUpdateText.md @@ -7,7 +7,7 @@ Schema to update a custom field of type text. | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `type` | [Components\CustomFieldUpdateTextType](../../Models/Components/CustomFieldUpdateTextType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `metadata` | array | :heavy_minus_sign: | N/A | | `name` | *?string* | :heavy_minus_sign: | N/A | | `slug` | *?string* | :heavy_minus_sign: | N/A | diff --git a/docs/Models/Components/CustomFieldUpdateTextType.md b/docs/Models/Components/CustomFieldUpdateTextType.md deleted file mode 100644 index f7eadc6..0000000 --- a/docs/Models/Components/CustomFieldUpdateTextType.md +++ /dev/null @@ -1,8 +0,0 @@ -# CustomFieldUpdateTextType - - -## Values - -| Name | Value | -| ------ | ------ | -| `Text` | text | \ No newline at end of file diff --git a/docs/Models/Components/CustomerBenefitGrantAds.md b/docs/Models/Components/CustomerBenefitGrantAds.md index 1cd66a9..2608825 100644 --- a/docs/Models/Components/CustomerBenefitGrantAds.md +++ b/docs/Models/Components/CustomerBenefitGrantAds.md @@ -11,6 +11,7 @@ | `benefitId` | *string* | :heavy_check_mark: | N/A | | `isGranted` | *bool* | :heavy_check_mark: | N/A | | `isRevoked` | *bool* | :heavy_check_mark: | N/A | +| `customer` | [Components\CustomerPortalCustomer](../../Models/Components/CustomerPortalCustomer.md) | :heavy_check_mark: | N/A | | `benefit` | [Components\BenefitAdsSubscriber](../../Models/Components/BenefitAdsSubscriber.md) | :heavy_check_mark: | N/A | | `properties` | [Components\BenefitGrantAdsProperties](../../Models/Components/BenefitGrantAdsProperties.md) | :heavy_check_mark: | N/A | | `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | diff --git a/docs/Models/Components/CustomerBenefitGrantAdsUpdate.md b/docs/Models/Components/CustomerBenefitGrantAdsUpdate.md index 1b4ab56..a27dbee 100644 --- a/docs/Models/Components/CustomerBenefitGrantAdsUpdate.md +++ b/docs/Models/Components/CustomerBenefitGrantAdsUpdate.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `benefitType` | [Components\CustomerBenefitGrantAdsUpdateBenefitType](../../Models/Components/CustomerBenefitGrantAdsUpdateBenefitType.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `benefitType` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/CustomerBenefitGrantAdsUpdateBenefitType.md b/docs/Models/Components/CustomerBenefitGrantAdsUpdateBenefitType.md deleted file mode 100644 index aba4137..0000000 --- a/docs/Models/Components/CustomerBenefitGrantAdsUpdateBenefitType.md +++ /dev/null @@ -1,8 +0,0 @@ -# CustomerBenefitGrantAdsUpdateBenefitType - - -## Values - -| Name | Value | -| ----- | ----- | -| `Ads` | ads | \ No newline at end of file diff --git a/docs/Models/Components/CustomerBenefitGrantCustom.md b/docs/Models/Components/CustomerBenefitGrantCustom.md index f483f3b..2169125 100644 --- a/docs/Models/Components/CustomerBenefitGrantCustom.md +++ b/docs/Models/Components/CustomerBenefitGrantCustom.md @@ -11,6 +11,7 @@ | `benefitId` | *string* | :heavy_check_mark: | N/A | | `isGranted` | *bool* | :heavy_check_mark: | N/A | | `isRevoked` | *bool* | :heavy_check_mark: | N/A | +| `customer` | [Components\CustomerPortalCustomer](../../Models/Components/CustomerPortalCustomer.md) | :heavy_check_mark: | N/A | | `benefit` | [Components\BenefitCustomSubscriber](../../Models/Components/BenefitCustomSubscriber.md) | :heavy_check_mark: | N/A | | `properties` | [Components\BenefitGrantCustomProperties](../../Models/Components/BenefitGrantCustomProperties.md) | :heavy_check_mark: | N/A | | `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | diff --git a/docs/Models/Components/CustomerBenefitGrantCustomUpdate.md b/docs/Models/Components/CustomerBenefitGrantCustomUpdate.md index 1a81628..c171f6e 100644 --- a/docs/Models/Components/CustomerBenefitGrantCustomUpdate.md +++ b/docs/Models/Components/CustomerBenefitGrantCustomUpdate.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -| `benefitType` | [Components\CustomerBenefitGrantCustomUpdateBenefitType](../../Models/Components/CustomerBenefitGrantCustomUpdateBenefitType.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `benefitType` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/CustomerBenefitGrantCustomUpdateBenefitType.md b/docs/Models/Components/CustomerBenefitGrantCustomUpdateBenefitType.md deleted file mode 100644 index c530273..0000000 --- a/docs/Models/Components/CustomerBenefitGrantCustomUpdateBenefitType.md +++ /dev/null @@ -1,8 +0,0 @@ -# CustomerBenefitGrantCustomUpdateBenefitType - - -## Values - -| Name | Value | -| -------- | -------- | -| `Custom` | custom | \ No newline at end of file diff --git a/docs/Models/Components/CustomerBenefitGrantDiscord.md b/docs/Models/Components/CustomerBenefitGrantDiscord.md index 23111f8..01376ca 100644 --- a/docs/Models/Components/CustomerBenefitGrantDiscord.md +++ b/docs/Models/Components/CustomerBenefitGrantDiscord.md @@ -11,6 +11,7 @@ | `benefitId` | *string* | :heavy_check_mark: | N/A | | `isGranted` | *bool* | :heavy_check_mark: | N/A | | `isRevoked` | *bool* | :heavy_check_mark: | N/A | +| `customer` | [Components\CustomerPortalCustomer](../../Models/Components/CustomerPortalCustomer.md) | :heavy_check_mark: | N/A | | `benefit` | [Components\BenefitDiscordSubscriber](../../Models/Components/BenefitDiscordSubscriber.md) | :heavy_check_mark: | N/A | | `properties` | [Components\BenefitGrantDiscordProperties](../../Models/Components/BenefitGrantDiscordProperties.md) | :heavy_check_mark: | N/A | | `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | diff --git a/docs/Models/Components/CustomerBenefitGrantDiscordUpdate.md b/docs/Models/Components/CustomerBenefitGrantDiscordUpdate.md index 63d7bda..159b618 100644 --- a/docs/Models/Components/CustomerBenefitGrantDiscordUpdate.md +++ b/docs/Models/Components/CustomerBenefitGrantDiscordUpdate.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | -| `benefitType` | [Components\CustomerBenefitGrantDiscordUpdateBenefitType](../../Models/Components/CustomerBenefitGrantDiscordUpdateBenefitType.md) | :heavy_check_mark: | N/A | -| `properties` | [Components\CustomerBenefitGrantDiscordPropertiesUpdate](../../Models/Components/CustomerBenefitGrantDiscordPropertiesUpdate.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `benefitType` | *string* | :heavy_check_mark: | N/A | +| `properties` | [Components\CustomerBenefitGrantDiscordPropertiesUpdate](../../Models/Components/CustomerBenefitGrantDiscordPropertiesUpdate.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/CustomerBenefitGrantDiscordUpdateBenefitType.md b/docs/Models/Components/CustomerBenefitGrantDiscordUpdateBenefitType.md deleted file mode 100644 index f8a919a..0000000 --- a/docs/Models/Components/CustomerBenefitGrantDiscordUpdateBenefitType.md +++ /dev/null @@ -1,8 +0,0 @@ -# CustomerBenefitGrantDiscordUpdateBenefitType - - -## Values - -| Name | Value | -| --------- | --------- | -| `Discord` | discord | \ No newline at end of file diff --git a/docs/Models/Components/CustomerBenefitGrantDownloadables.md b/docs/Models/Components/CustomerBenefitGrantDownloadables.md index 8bb2f8d..7d12eaa 100644 --- a/docs/Models/Components/CustomerBenefitGrantDownloadables.md +++ b/docs/Models/Components/CustomerBenefitGrantDownloadables.md @@ -11,6 +11,7 @@ | `benefitId` | *string* | :heavy_check_mark: | N/A | | `isGranted` | *bool* | :heavy_check_mark: | N/A | | `isRevoked` | *bool* | :heavy_check_mark: | N/A | +| `customer` | [Components\CustomerPortalCustomer](../../Models/Components/CustomerPortalCustomer.md) | :heavy_check_mark: | N/A | | `benefit` | [Components\BenefitDownloadablesSubscriber](../../Models/Components/BenefitDownloadablesSubscriber.md) | :heavy_check_mark: | N/A | | `properties` | [Components\BenefitGrantDownloadablesProperties](../../Models/Components/BenefitGrantDownloadablesProperties.md) | :heavy_check_mark: | N/A | | `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | diff --git a/docs/Models/Components/CustomerBenefitGrantDownloadablesUpdate.md b/docs/Models/Components/CustomerBenefitGrantDownloadablesUpdate.md index 1f69476..89aee24 100644 --- a/docs/Models/Components/CustomerBenefitGrantDownloadablesUpdate.md +++ b/docs/Models/Components/CustomerBenefitGrantDownloadablesUpdate.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -| `benefitType` | [Components\CustomerBenefitGrantDownloadablesUpdateBenefitType](../../Models/Components/CustomerBenefitGrantDownloadablesUpdateBenefitType.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `benefitType` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/CustomerBenefitGrantDownloadablesUpdateBenefitType.md b/docs/Models/Components/CustomerBenefitGrantDownloadablesUpdateBenefitType.md deleted file mode 100644 index d3395c7..0000000 --- a/docs/Models/Components/CustomerBenefitGrantDownloadablesUpdateBenefitType.md +++ /dev/null @@ -1,8 +0,0 @@ -# CustomerBenefitGrantDownloadablesUpdateBenefitType - - -## Values - -| Name | Value | -| --------------- | --------------- | -| `Downloadables` | downloadables | \ No newline at end of file diff --git a/docs/Models/Components/CustomerBenefitGrantGitHubRepository.md b/docs/Models/Components/CustomerBenefitGrantGitHubRepository.md index 96743cd..647958d 100644 --- a/docs/Models/Components/CustomerBenefitGrantGitHubRepository.md +++ b/docs/Models/Components/CustomerBenefitGrantGitHubRepository.md @@ -11,6 +11,7 @@ | `benefitId` | *string* | :heavy_check_mark: | N/A | | `isGranted` | *bool* | :heavy_check_mark: | N/A | | `isRevoked` | *bool* | :heavy_check_mark: | N/A | +| `customer` | [Components\CustomerPortalCustomer](../../Models/Components/CustomerPortalCustomer.md) | :heavy_check_mark: | N/A | | `benefit` | [Components\BenefitGitHubRepositorySubscriber](../../Models/Components/BenefitGitHubRepositorySubscriber.md) | :heavy_check_mark: | N/A | | `properties` | [Components\BenefitGrantGitHubRepositoryProperties](../../Models/Components/BenefitGrantGitHubRepositoryProperties.md) | :heavy_check_mark: | N/A | | `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | diff --git a/docs/Models/Components/CustomerBenefitGrantGitHubRepositoryUpdate.md b/docs/Models/Components/CustomerBenefitGrantGitHubRepositoryUpdate.md index cfa2960..4359087 100644 --- a/docs/Models/Components/CustomerBenefitGrantGitHubRepositoryUpdate.md +++ b/docs/Models/Components/CustomerBenefitGrantGitHubRepositoryUpdate.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | -| `benefitType` | [Components\CustomerBenefitGrantGitHubRepositoryUpdateBenefitType](../../Models/Components/CustomerBenefitGrantGitHubRepositoryUpdateBenefitType.md) | :heavy_check_mark: | N/A | -| `properties` | [Components\CustomerBenefitGrantGitHubRepositoryPropertiesUpdate](../../Models/Components/CustomerBenefitGrantGitHubRepositoryPropertiesUpdate.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | +| `benefitType` | *string* | :heavy_check_mark: | N/A | +| `properties` | [Components\CustomerBenefitGrantGitHubRepositoryPropertiesUpdate](../../Models/Components/CustomerBenefitGrantGitHubRepositoryPropertiesUpdate.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/CustomerBenefitGrantGitHubRepositoryUpdateBenefitType.md b/docs/Models/Components/CustomerBenefitGrantGitHubRepositoryUpdateBenefitType.md deleted file mode 100644 index ea48d71..0000000 --- a/docs/Models/Components/CustomerBenefitGrantGitHubRepositoryUpdateBenefitType.md +++ /dev/null @@ -1,8 +0,0 @@ -# CustomerBenefitGrantGitHubRepositoryUpdateBenefitType - - -## Values - -| Name | Value | -| ------------------ | ------------------ | -| `GithubRepository` | github_repository | \ No newline at end of file diff --git a/docs/Models/Components/CustomerBenefitGrantLicenseKeys.md b/docs/Models/Components/CustomerBenefitGrantLicenseKeys.md index 95daf85..5dd2bd3 100644 --- a/docs/Models/Components/CustomerBenefitGrantLicenseKeys.md +++ b/docs/Models/Components/CustomerBenefitGrantLicenseKeys.md @@ -11,6 +11,7 @@ | `benefitId` | *string* | :heavy_check_mark: | N/A | | `isGranted` | *bool* | :heavy_check_mark: | N/A | | `isRevoked` | *bool* | :heavy_check_mark: | N/A | +| `customer` | [Components\CustomerPortalCustomer](../../Models/Components/CustomerPortalCustomer.md) | :heavy_check_mark: | N/A | | `benefit` | [Components\BenefitLicenseKeysSubscriber](../../Models/Components/BenefitLicenseKeysSubscriber.md) | :heavy_check_mark: | N/A | | `properties` | [Components\BenefitGrantLicenseKeysProperties](../../Models/Components/BenefitGrantLicenseKeysProperties.md) | :heavy_check_mark: | N/A | | `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | diff --git a/docs/Models/Components/CustomerBenefitGrantLicenseKeysUpdate.md b/docs/Models/Components/CustomerBenefitGrantLicenseKeysUpdate.md index de782b9..e701def 100644 --- a/docs/Models/Components/CustomerBenefitGrantLicenseKeysUpdate.md +++ b/docs/Models/Components/CustomerBenefitGrantLicenseKeysUpdate.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | -| `benefitType` | [Components\CustomerBenefitGrantLicenseKeysUpdateBenefitType](../../Models/Components/CustomerBenefitGrantLicenseKeysUpdateBenefitType.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `benefitType` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/CustomerBenefitGrantLicenseKeysUpdateBenefitType.md b/docs/Models/Components/CustomerBenefitGrantLicenseKeysUpdateBenefitType.md deleted file mode 100644 index ffc3b0e..0000000 --- a/docs/Models/Components/CustomerBenefitGrantLicenseKeysUpdateBenefitType.md +++ /dev/null @@ -1,8 +0,0 @@ -# CustomerBenefitGrantLicenseKeysUpdateBenefitType - - -## Values - -| Name | Value | -| ------------- | ------------- | -| `LicenseKeys` | license_keys | \ No newline at end of file diff --git a/docs/Models/Components/CustomerCancellationReason.md b/docs/Models/Components/CustomerCancellationReason.md new file mode 100644 index 0000000..5590bbe --- /dev/null +++ b/docs/Models/Components/CustomerCancellationReason.md @@ -0,0 +1,15 @@ +# CustomerCancellationReason + + +## Values + +| Name | Value | +| ----------------- | ----------------- | +| `CustomerService` | customer_service | +| `LowQuality` | low_quality | +| `MissingFeatures` | missing_features | +| `SwitchedService` | switched_service | +| `TooComplex` | too_complex | +| `TooExpensive` | too_expensive | +| `Unused` | unused | +| `Other` | other | \ No newline at end of file diff --git a/docs/Models/Components/CustomerCreate.md b/docs/Models/Components/CustomerCreate.md index bb85fe4..9615533 100644 --- a/docs/Models/Components/CustomerCreate.md +++ b/docs/Models/Components/CustomerCreate.md @@ -3,10 +3,11 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `email` | *string* | :heavy_check_mark: | N/A | -| `name` | *?string* | :heavy_minus_sign: | N/A | -| `billingAddress` | [?Components\Address](../../Models/Components/Address.md) | :heavy_minus_sign: | N/A | -| `taxId` | array<[string\|Components\TaxIDFormat](../../Models/Components/CustomerCreateTaxId.md)> | :heavy_minus_sign: | N/A | -| `organizationId` | *?string* | :heavy_minus_sign: | The ID of the organization owning the customer. **Required unless you use an organization token.** | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `email` | *string* | :heavy_check_mark: | N/A | +| `metadata` | array | :heavy_minus_sign: | Key-value object allowing you to store additional information.

The key must be a string with a maximum length of **40 characters**.
The value must be either:

* A string with a maximum length of **500 characters**
* An integer
* A boolean

You can store up to **50 key-value pairs**. | +| `name` | *?string* | :heavy_minus_sign: | N/A | +| `billingAddress` | [?Components\Address](../../Models/Components/Address.md) | :heavy_minus_sign: | N/A | +| `taxId` | array<[string\|Components\TaxIDFormat](../../Models/Components/CustomerCreateTaxId.md)> | :heavy_minus_sign: | N/A | +| `organizationId` | *?string* | :heavy_minus_sign: | The ID of the organization owning the customer. **Required unless you use an organization token.** | \ No newline at end of file diff --git a/docs/Models/Components/CustomerCreateMetadata.md b/docs/Models/Components/CustomerCreateMetadata.md new file mode 100644 index 0000000..244ac2f --- /dev/null +++ b/docs/Models/Components/CustomerCreateMetadata.md @@ -0,0 +1,32 @@ +# CustomerCreateMetadata + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `int` + +```php +/** +* @var int +*/ +int $value = /* values here */ +``` + +### `bool` + +```php +/** +* @var bool +*/ +bool $value = /* values here */ +``` + diff --git a/docs/Models/Components/CustomerOrderSubscription.md b/docs/Models/Components/CustomerOrderSubscription.md index d3fb7e4..e5064ed 100644 --- a/docs/Models/Components/CustomerOrderSubscription.md +++ b/docs/Models/Components/CustomerOrderSubscription.md @@ -18,7 +18,11 @@ | `amount` | *int* | :heavy_check_mark: | N/A | | `currency` | *string* | :heavy_check_mark: | N/A | | `currentPeriodEnd` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | +| `canceledAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | | `startedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | +| `endsAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | | `endedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | | `discountId` | *string* | :heavy_check_mark: | N/A | -| `checkoutId` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| `checkoutId` | *string* | :heavy_check_mark: | N/A | +| `customerCancellationReason` | [Components\CustomerCancellationReason](../../Models/Components/CustomerCancellationReason.md) | :heavy_check_mark: | N/A | +| `customerCancellationComment` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/CustomerSession.md b/docs/Models/Components/CustomerSession.md index f423ded..ff64295 100644 --- a/docs/Models/Components/CustomerSession.md +++ b/docs/Models/Components/CustomerSession.md @@ -11,6 +11,7 @@ A customer session that can be used to authenticate as a customer. | `id` | *string* | :heavy_check_mark: | The ID of the object. | | `token` | *string* | :heavy_check_mark: | N/A | | `expiresAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | +| `customerPortalUrl` | *string* | :heavy_check_mark: | N/A | | `customerId` | *string* | :heavy_check_mark: | N/A | | `customer` | [Components\Customer](../../Models/Components/Customer.md) | :heavy_check_mark: | A customer in an organization. | | `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | \ No newline at end of file diff --git a/docs/Models/Components/CustomerSubscription.md b/docs/Models/Components/CustomerSubscription.md index 38c5587..d7ad25c 100644 --- a/docs/Models/Components/CustomerSubscription.md +++ b/docs/Models/Components/CustomerSubscription.md @@ -21,7 +21,11 @@ | `amount` | *int* | :heavy_check_mark: | N/A | | `currency` | *string* | :heavy_check_mark: | N/A | | `currentPeriodEnd` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | +| `canceledAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | | `startedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | +| `endsAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | | `endedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | | `discountId` | *string* | :heavy_check_mark: | N/A | -| `checkoutId` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| `checkoutId` | *string* | :heavy_check_mark: | N/A | +| `customerCancellationReason` | [Components\CustomerCancellationReason](../../Models/Components/CustomerCancellationReason.md) | :heavy_check_mark: | N/A | +| `customerCancellationComment` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/CustomerSubscriptionCancel.md b/docs/Models/Components/CustomerSubscriptionCancel.md new file mode 100644 index 0000000..f6cf6c3 --- /dev/null +++ b/docs/Models/Components/CustomerSubscriptionCancel.md @@ -0,0 +1,10 @@ +# CustomerSubscriptionCancel + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `cancelAtPeriodEnd` | *?bool* | :heavy_minus_sign: | Cancel an active subscription once the current period ends.

Or uncancel a subscription currently set to be revoked at period end. | +| `cancellationReason` | [?Components\CustomerCancellationReason](../../Models/Components/CustomerCancellationReason.md) | :heavy_minus_sign: | Customers reason for cancellation.

* `too_expensive`: Too expensive for the customer.
* `missing_features`: Customer is missing certain features.
* `switched_service`: Customer switched to another service.
* `unused`: Customer is not using it enough.
* `customer_service`: Customer is not satisfied with the customer service.
* `low_quality`: Customer is unhappy with the quality.
* `too_complex`: Customer considers the service too complicated.
* `other`: Other reason(s). | +| `cancellationComment` | *?string* | :heavy_minus_sign: | Customer feedback and why they decided to cancel. | \ No newline at end of file diff --git a/docs/Models/Components/CustomerSubscriptionUpdate.md b/docs/Models/Components/CustomerSubscriptionUpdate.md index ab2c4aa..ce0e755 100644 --- a/docs/Models/Components/CustomerSubscriptionUpdate.md +++ b/docs/Models/Components/CustomerSubscriptionUpdate.md @@ -1,8 +1,23 @@ # CustomerSubscriptionUpdate -## Fields +## Supported Types + +### `Components\CustomerSubscriptionUpdatePrice` + +```php +/** +* @var Components\CustomerSubscriptionUpdatePrice +*/ +Components\CustomerSubscriptionUpdatePrice $value = /* values here */ +``` + +### `Components\CustomerSubscriptionCancel` + +```php +/** +* @var Components\CustomerSubscriptionCancel +*/ +Components\CustomerSubscriptionCancel $value = /* values here */ +``` -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `productPriceId` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/CustomerSubscriptionUpdatePrice.md b/docs/Models/Components/CustomerSubscriptionUpdatePrice.md new file mode 100644 index 0000000..da70b67 --- /dev/null +++ b/docs/Models/Components/CustomerSubscriptionUpdatePrice.md @@ -0,0 +1,8 @@ +# CustomerSubscriptionUpdatePrice + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `productPriceId` | *string* | :heavy_check_mark: | Update subscription to another price. | \ No newline at end of file diff --git a/docs/Models/Components/CustomerUpdate.md b/docs/Models/Components/CustomerUpdate.md index af18d9a..4441ace 100644 --- a/docs/Models/Components/CustomerUpdate.md +++ b/docs/Models/Components/CustomerUpdate.md @@ -5,6 +5,7 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `metadata` | array | :heavy_minus_sign: | N/A | | `email` | *?string* | :heavy_minus_sign: | N/A | | `name` | *?string* | :heavy_minus_sign: | N/A | | `billingAddress` | [?Components\Address](../../Models/Components/Address.md) | :heavy_minus_sign: | N/A | diff --git a/docs/Models/Components/CustomerUpdateMetadata.md b/docs/Models/Components/CustomerUpdateMetadata.md new file mode 100644 index 0000000..73767dd --- /dev/null +++ b/docs/Models/Components/CustomerUpdateMetadata.md @@ -0,0 +1,32 @@ +# CustomerUpdateMetadata + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `int` + +```php +/** +* @var int +*/ +int $value = /* values here */ +``` + +### `bool` + +```php +/** +* @var bool +*/ +bool $value = /* values here */ +``` + diff --git a/docs/Models/Components/DownloadableFileCreate.md b/docs/Models/Components/DownloadableFileCreate.md index 70b7cfc..75dcb4c 100644 --- a/docs/Models/Components/DownloadableFileCreate.md +++ b/docs/Models/Components/DownloadableFileCreate.md @@ -5,13 +5,13 @@ Schema to create a file to be associated with the downloadables benefit. ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `name` | *string* | :heavy_check_mark: | N/A | -| `mimeType` | *string* | :heavy_check_mark: | N/A | -| `size` | *int* | :heavy_check_mark: | N/A | -| `upload` | [Components\S3FileCreateMultipart](../../Models/Components/S3FileCreateMultipart.md) | :heavy_check_mark: | N/A | -| `service` | [Components\DownloadableFileCreateService](../../Models/Components/DownloadableFileCreateService.md) | :heavy_check_mark: | N/A | -| `organizationId` | *?string* | :heavy_minus_sign: | N/A | -| `checksumSha256Base64` | *?string* | :heavy_minus_sign: | N/A | -| `version` | *?string* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `name` | *string* | :heavy_check_mark: | N/A | +| `mimeType` | *string* | :heavy_check_mark: | N/A | +| `size` | *int* | :heavy_check_mark: | N/A | +| `upload` | [Components\S3FileCreateMultipart](../../Models/Components/S3FileCreateMultipart.md) | :heavy_check_mark: | N/A | +| `service` | *string* | :heavy_check_mark: | N/A | +| `organizationId` | *?string* | :heavy_minus_sign: | N/A | +| `checksumSha256Base64` | *?string* | :heavy_minus_sign: | N/A | +| `version` | *?string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/DownloadableFileCreateService.md b/docs/Models/Components/DownloadableFileCreateService.md deleted file mode 100644 index e71a60f..0000000 --- a/docs/Models/Components/DownloadableFileCreateService.md +++ /dev/null @@ -1,8 +0,0 @@ -# DownloadableFileCreateService - - -## Values - -| Name | Value | -| -------------- | -------------- | -| `Downloadable` | downloadable | \ No newline at end of file diff --git a/docs/Models/Components/DownloadableFileRead.md b/docs/Models/Components/DownloadableFileRead.md index 7a3d530..53f7d88 100644 --- a/docs/Models/Components/DownloadableFileRead.md +++ b/docs/Models/Components/DownloadableFileRead.md @@ -5,21 +5,21 @@ File to be associated with the downloadables benefit. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `id` | *string* | :heavy_check_mark: | The ID of the object. | -| `organizationId` | *string* | :heavy_check_mark: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | -| `path` | *string* | :heavy_check_mark: | N/A | -| `mimeType` | *string* | :heavy_check_mark: | N/A | -| `size` | *int* | :heavy_check_mark: | N/A | -| `service` | [Components\DownloadableFileReadService](../../Models/Components/DownloadableFileReadService.md) | :heavy_check_mark: | N/A | -| `isUploaded` | *bool* | :heavy_check_mark: | N/A | -| `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | -| `sizeReadable` | *string* | :heavy_check_mark: | N/A | -| `storageVersion` | *string* | :heavy_check_mark: | N/A | -| `checksumEtag` | *string* | :heavy_check_mark: | N/A | -| `checksumSha256Base64` | *string* | :heavy_check_mark: | N/A | -| `checksumSha256Hex` | *string* | :heavy_check_mark: | N/A | -| `lastModifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | -| `version` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The ID of the object. | +| `organizationId` | *string* | :heavy_check_mark: | N/A | +| `name` | *string* | :heavy_check_mark: | N/A | +| `path` | *string* | :heavy_check_mark: | N/A | +| `mimeType` | *string* | :heavy_check_mark: | N/A | +| `size` | *int* | :heavy_check_mark: | N/A | +| `service` | *string* | :heavy_check_mark: | N/A | +| `isUploaded` | *bool* | :heavy_check_mark: | N/A | +| `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | +| `sizeReadable` | *string* | :heavy_check_mark: | N/A | +| `storageVersion` | *string* | :heavy_check_mark: | N/A | +| `checksumEtag` | *string* | :heavy_check_mark: | N/A | +| `checksumSha256Base64` | *string* | :heavy_check_mark: | N/A | +| `checksumSha256Hex` | *string* | :heavy_check_mark: | N/A | +| `lastModifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | +| `version` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/DownloadableFileReadService.md b/docs/Models/Components/DownloadableFileReadService.md deleted file mode 100644 index 315d34a..0000000 --- a/docs/Models/Components/DownloadableFileReadService.md +++ /dev/null @@ -1,8 +0,0 @@ -# DownloadableFileReadService - - -## Values - -| Name | Value | -| -------------- | -------------- | -| `Downloadable` | downloadable | \ No newline at end of file diff --git a/docs/Models/Components/Event.md b/docs/Models/Components/Event.md new file mode 100644 index 0000000..b0eadd2 --- /dev/null +++ b/docs/Models/Components/Event.md @@ -0,0 +1,15 @@ +# Event + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `metadata` | array | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_check_mark: | The ID of the object. | +| `timestamp` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | The timestamp of the event. | +| `name` | *string* | :heavy_check_mark: | The name of the event. | +| `source` | [Components\EventSource](../../Models/Components/EventSource.md) | :heavy_check_mark: | N/A | +| `organizationId` | *string* | :heavy_check_mark: | The ID of the organization owning the event. | +| `customerId` | *string* | :heavy_check_mark: | ID of the customer in your Polar organization associated with the event. | +| `externalCustomerId` | *string* | :heavy_check_mark: | ID of the customer in your system associated with the event. | \ No newline at end of file diff --git a/docs/Models/Components/EventCreateCustomer.md b/docs/Models/Components/EventCreateCustomer.md new file mode 100644 index 0000000..160024b --- /dev/null +++ b/docs/Models/Components/EventCreateCustomer.md @@ -0,0 +1,12 @@ +# EventCreateCustomer + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_check_mark: | The name of the event. | +| `customerId` | *string* | :heavy_check_mark: | ID of the customer in your Polar organization associated with the event. | +| `metadata` | array | :heavy_minus_sign: | Key-value object allowing you to store additional information.

The key must be a string with a maximum length of **40 characters**.
The value must be either:

* A string with a maximum length of **500 characters**
* An integer
* A boolean

You can store up to **50 key-value pairs**. | +| `timestamp` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | The timestamp of the event. | +| `organizationId` | *?string* | :heavy_minus_sign: | The ID of the organization owning the event. **Required unless you use an organization token.** | \ No newline at end of file diff --git a/docs/Models/Components/EventCreateCustomerMetadata.md b/docs/Models/Components/EventCreateCustomerMetadata.md new file mode 100644 index 0000000..e2d9092 --- /dev/null +++ b/docs/Models/Components/EventCreateCustomerMetadata.md @@ -0,0 +1,32 @@ +# EventCreateCustomerMetadata + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `int` + +```php +/** +* @var int +*/ +int $value = /* values here */ +``` + +### `bool` + +```php +/** +* @var bool +*/ +bool $value = /* values here */ +``` + diff --git a/docs/Models/Components/EventCreateExternalCustomer.md b/docs/Models/Components/EventCreateExternalCustomer.md new file mode 100644 index 0000000..9068c99 --- /dev/null +++ b/docs/Models/Components/EventCreateExternalCustomer.md @@ -0,0 +1,12 @@ +# EventCreateExternalCustomer + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_check_mark: | The name of the event. | +| `externalCustomerId` | *string* | :heavy_check_mark: | ID of the customer in your system associated with the event. | +| `metadata` | array | :heavy_minus_sign: | Key-value object allowing you to store additional information.

The key must be a string with a maximum length of **40 characters**.
The value must be either:

* A string with a maximum length of **500 characters**
* An integer
* A boolean

You can store up to **50 key-value pairs**. | +| `timestamp` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | The timestamp of the event. | +| `organizationId` | *?string* | :heavy_minus_sign: | The ID of the organization owning the event. **Required unless you use an organization token.** | \ No newline at end of file diff --git a/docs/Models/Components/EventCreateExternalCustomerMetadata.md b/docs/Models/Components/EventCreateExternalCustomerMetadata.md new file mode 100644 index 0000000..8dfb803 --- /dev/null +++ b/docs/Models/Components/EventCreateExternalCustomerMetadata.md @@ -0,0 +1,32 @@ +# EventCreateExternalCustomerMetadata + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `int` + +```php +/** +* @var int +*/ +int $value = /* values here */ +``` + +### `bool` + +```php +/** +* @var bool +*/ +bool $value = /* values here */ +``` + diff --git a/docs/Models/Components/EventMetadata.md b/docs/Models/Components/EventMetadata.md new file mode 100644 index 0000000..4f6e92f --- /dev/null +++ b/docs/Models/Components/EventMetadata.md @@ -0,0 +1,32 @@ +# EventMetadata + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `int` + +```php +/** +* @var int +*/ +int $value = /* values here */ +``` + +### `bool` + +```php +/** +* @var bool +*/ +bool $value = /* values here */ +``` + diff --git a/docs/Models/Components/EventSortProperty.md b/docs/Models/Components/EventSortProperty.md new file mode 100644 index 0000000..eb1dc8c --- /dev/null +++ b/docs/Models/Components/EventSortProperty.md @@ -0,0 +1,9 @@ +# EventSortProperty + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `Timestamp` | timestamp | +| `MinusTimestamp` | -timestamp | \ No newline at end of file diff --git a/docs/Models/Components/BenefitCustomCreateType.md b/docs/Models/Components/EventSource.md similarity index 50% rename from docs/Models/Components/BenefitCustomCreateType.md rename to docs/Models/Components/EventSource.md index b9ec803..94d08ff 100644 --- a/docs/Models/Components/BenefitCustomCreateType.md +++ b/docs/Models/Components/EventSource.md @@ -1,8 +1,9 @@ -# BenefitCustomCreateType +# EventSource ## Values | Name | Value | | -------- | -------- | -| `Custom` | custom | \ No newline at end of file +| `System` | system | +| `User` | user | \ No newline at end of file diff --git a/docs/Models/Components/Events.md b/docs/Models/Components/Events.md new file mode 100644 index 0000000..0d29892 --- /dev/null +++ b/docs/Models/Components/Events.md @@ -0,0 +1,23 @@ +# Events + + +## Supported Types + +### `Components\EventCreateCustomer` + +```php +/** +* @var Components\EventCreateCustomer +*/ +Components\EventCreateCustomer $value = /* values here */ +``` + +### `Components\EventCreateExternalCustomer` + +```php +/** +* @var Components\EventCreateExternalCustomer +*/ +Components\EventCreateExternalCustomer $value = /* values here */ +``` + diff --git a/docs/Models/Components/EventsIngest.md b/docs/Models/Components/EventsIngest.md new file mode 100644 index 0000000..abff0b9 --- /dev/null +++ b/docs/Models/Components/EventsIngest.md @@ -0,0 +1,8 @@ +# EventsIngest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `events` | array<[Components\EventCreateCustomer\|Components\EventCreateExternalCustomer](../../Models/Components/Events.md)> | :heavy_check_mark: | List of events to ingest. | \ No newline at end of file diff --git a/docs/Models/Components/EventsIngestResponse.md b/docs/Models/Components/EventsIngestResponse.md new file mode 100644 index 0000000..fe22bf8 --- /dev/null +++ b/docs/Models/Components/EventsIngestResponse.md @@ -0,0 +1,8 @@ +# EventsIngestResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `inserted` | *int* | :heavy_check_mark: | Number of events inserted. | \ No newline at end of file diff --git a/docs/Models/Components/Filter.md b/docs/Models/Components/Filter.md new file mode 100644 index 0000000..242b644 --- /dev/null +++ b/docs/Models/Components/Filter.md @@ -0,0 +1,9 @@ +# Filter + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `conjunction` | [Components\FilterConjunction](../../Models/Components/FilterConjunction.md) | :heavy_check_mark: | N/A | +| `clauses` | array<[Components\FilterClause\|Components\Filter](../../Models/Components/Clauses.md)> | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/FilterClause.md b/docs/Models/Components/FilterClause.md new file mode 100644 index 0000000..7e1ad62 --- /dev/null +++ b/docs/Models/Components/FilterClause.md @@ -0,0 +1,10 @@ +# FilterClause + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `property` | *string* | :heavy_check_mark: | N/A | +| `operator` | [Components\FilterOperator](../../Models/Components/FilterOperator.md) | :heavy_check_mark: | N/A | +| `value` | [string\|int\|bool](../../Models/Components/Value.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/FilterConjunction.md b/docs/Models/Components/FilterConjunction.md new file mode 100644 index 0000000..ddd90b8 --- /dev/null +++ b/docs/Models/Components/FilterConjunction.md @@ -0,0 +1,9 @@ +# FilterConjunction + + +## Values + +| Name | Value | +| ----- | ----- | +| `And` | and | +| `Or` | or | \ No newline at end of file diff --git a/docs/Models/Components/FilterOperator.md b/docs/Models/Components/FilterOperator.md new file mode 100644 index 0000000..1552219 --- /dev/null +++ b/docs/Models/Components/FilterOperator.md @@ -0,0 +1,15 @@ +# FilterOperator + + +## Values + +| Name | Value | +| --------- | --------- | +| `Eq` | eq | +| `Ne` | ne | +| `Gt` | gt | +| `Gte` | gte | +| `Lt` | lt | +| `Lte` | lte | +| `Like` | like | +| `NotLike` | not_like | \ No newline at end of file diff --git a/docs/Models/Components/Func.md b/docs/Models/Components/Func.md new file mode 100644 index 0000000..4f9c3f9 --- /dev/null +++ b/docs/Models/Components/Func.md @@ -0,0 +1,11 @@ +# Func + + +## Values + +| Name | Value | +| ----- | ----- | +| `Sum` | sum | +| `Max` | max | +| `Min` | min | +| `Avg` | avg | \ No newline at end of file diff --git a/docs/Models/Components/GrantType.md b/docs/Models/Components/GrantType.md deleted file mode 100644 index ad00d9b..0000000 --- a/docs/Models/Components/GrantType.md +++ /dev/null @@ -1,8 +0,0 @@ -# GrantType - - -## Values - -| Name | Value | -| ------------------- | ------------------- | -| `AuthorizationCode` | authorization_code | \ No newline at end of file diff --git a/docs/Models/Components/IntrospectTokenResponse.md b/docs/Models/Components/IntrospectTokenResponse.md index 4ac60fb..0f5dfab 100644 --- a/docs/Models/Components/IntrospectTokenResponse.md +++ b/docs/Models/Components/IntrospectTokenResponse.md @@ -3,15 +3,15 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `active` | *bool* | :heavy_check_mark: | N/A | -| `clientId` | *string* | :heavy_check_mark: | N/A | -| `tokenType` | [Components\IntrospectTokenResponseTokenType](../../Models/Components/IntrospectTokenResponseTokenType.md) | :heavy_check_mark: | N/A | -| `scope` | *string* | :heavy_check_mark: | N/A | -| `subType` | [Components\SubType](../../Models/Components/SubType.md) | :heavy_check_mark: | N/A | -| `sub` | *string* | :heavy_check_mark: | N/A | -| `aud` | *string* | :heavy_check_mark: | N/A | -| `iss` | *string* | :heavy_check_mark: | N/A | -| `exp` | *int* | :heavy_check_mark: | N/A | -| `iat` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `active` | *bool* | :heavy_check_mark: | N/A | +| `clientId` | *string* | :heavy_check_mark: | N/A | +| `tokenType` | [Components\TokenType](../../Models/Components/TokenType.md) | :heavy_check_mark: | N/A | +| `scope` | *string* | :heavy_check_mark: | N/A | +| `subType` | [Components\SubType](../../Models/Components/SubType.md) | :heavy_check_mark: | N/A | +| `sub` | *string* | :heavy_check_mark: | N/A | +| `aud` | *string* | :heavy_check_mark: | N/A | +| `iss` | *string* | :heavy_check_mark: | N/A | +| `exp` | *int* | :heavy_check_mark: | N/A | +| `iat` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/IntrospectTokenResponseTokenType.md b/docs/Models/Components/IntrospectTokenResponseTokenType.md deleted file mode 100644 index a8a7de4..0000000 --- a/docs/Models/Components/IntrospectTokenResponseTokenType.md +++ /dev/null @@ -1,9 +0,0 @@ -# IntrospectTokenResponseTokenType - - -## Values - -| Name | Value | -| -------------- | -------------- | -| `AccessToken` | access_token | -| `RefreshToken` | refresh_token | \ No newline at end of file diff --git a/docs/Models/Components/ListResourceEvent.md b/docs/Models/Components/ListResourceEvent.md new file mode 100644 index 0000000..3a729b5 --- /dev/null +++ b/docs/Models/Components/ListResourceEvent.md @@ -0,0 +1,9 @@ +# ListResourceEvent + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `items` | array<[Components\Event](../../Models/Components/Event.md)> | :heavy_check_mark: | N/A | +| `pagination` | [Components\Pagination](../../Models/Components/Pagination.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/ListResourceMeter.md b/docs/Models/Components/ListResourceMeter.md new file mode 100644 index 0000000..a5923fa --- /dev/null +++ b/docs/Models/Components/ListResourceMeter.md @@ -0,0 +1,9 @@ +# ListResourceMeter + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `items` | array<[Components\Meter](../../Models/Components/Meter.md)> | :heavy_check_mark: | N/A | +| `pagination` | [Components\Pagination](../../Models/Components/Pagination.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/ListResourceRefund.md b/docs/Models/Components/ListResourceRefund.md new file mode 100644 index 0000000..1017534 --- /dev/null +++ b/docs/Models/Components/ListResourceRefund.md @@ -0,0 +1,9 @@ +# ListResourceRefund + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `items` | array<[Components\Refund](../../Models/Components/Refund.md)> | :heavy_check_mark: | N/A | +| `pagination` | [Components\Pagination](../../Models/Components/Pagination.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/MetadataQuery.md b/docs/Models/Components/MetadataQuery.md new file mode 100644 index 0000000..410be7a --- /dev/null +++ b/docs/Models/Components/MetadataQuery.md @@ -0,0 +1,59 @@ +# MetadataQuery + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `int` + +```php +/** +* @var int +*/ +int $value = /* values here */ +``` + +### `bool` + +```php +/** +* @var bool +*/ +bool $value = /* values here */ +``` + +### `array` + +```php +/** +* @var array +*/ +array $value = /* values here */ +``` + +### `array` + +```php +/** +* @var array +*/ +array $value = /* values here */ +``` + +### `array` + +```php +/** +* @var array +*/ +array $value = /* values here */ +``` + diff --git a/docs/Models/Components/Meter.md b/docs/Models/Components/Meter.md new file mode 100644 index 0000000..bc23275 --- /dev/null +++ b/docs/Models/Components/Meter.md @@ -0,0 +1,15 @@ +# Meter + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `metadata` | array | :heavy_check_mark: | N/A | +| `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | +| `id` | *string* | :heavy_check_mark: | The ID of the object. | +| `name` | *string* | :heavy_check_mark: | The name of the meter. Will be shown on customer's invoices and usage. | +| `filter` | [Components\Filter](../../Models/Components/Filter.md) | :heavy_check_mark: | N/A | +| `aggregation` | [Components\CountAggregation\|Components\PropertyAggregation](../../Models/Components/MeterAggregation.md) | :heavy_check_mark: | The aggregation to apply on the filtered events to calculate the meter. | +| `organizationId` | *string* | :heavy_check_mark: | The ID of the organization owning the meter. | +| `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | \ No newline at end of file diff --git a/docs/Models/Components/MeterAggregation.md b/docs/Models/Components/MeterAggregation.md new file mode 100644 index 0000000..43a705a --- /dev/null +++ b/docs/Models/Components/MeterAggregation.md @@ -0,0 +1,52 @@ +# MeterAggregation + +The aggregation to apply on the filtered events to calculate the meter. + + +## Supported Types + +### `Components\PropertyAggregation` + +```php +/** +* @var Components\PropertyAggregation +*/ +Components\PropertyAggregation $value = /* values here */ +``` + +### `Components\CountAggregation` + +```php +/** +* @var Components\CountAggregation +*/ +Components\CountAggregation $value = /* values here */ +``` + +### `Components\PropertyAggregation` + +```php +/** +* @var Components\PropertyAggregation +*/ +Components\PropertyAggregation $value = /* values here */ +``` + +### `Components\PropertyAggregation` + +```php +/** +* @var Components\PropertyAggregation +*/ +Components\PropertyAggregation $value = /* values here */ +``` + +### `Components\PropertyAggregation` + +```php +/** +* @var Components\PropertyAggregation +*/ +Components\PropertyAggregation $value = /* values here */ +``` + diff --git a/docs/Models/Components/MeterCreate.md b/docs/Models/Components/MeterCreate.md new file mode 100644 index 0000000..503b656 --- /dev/null +++ b/docs/Models/Components/MeterCreate.md @@ -0,0 +1,12 @@ +# MeterCreate + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_check_mark: | The name of the meter. Will be shown on customer's invoices and usage. | +| `filter` | [Components\Filter](../../Models/Components/Filter.md) | :heavy_check_mark: | N/A | +| `aggregation` | [Components\CountAggregation\|Components\PropertyAggregation](../../Models/Components/MeterCreateAggregation.md) | :heavy_check_mark: | The aggregation to apply on the filtered events to calculate the meter. | +| `metadata` | array | :heavy_minus_sign: | Key-value object allowing you to store additional information.

The key must be a string with a maximum length of **40 characters**.
The value must be either:

* A string with a maximum length of **500 characters**
* An integer
* A boolean

You can store up to **50 key-value pairs**. | +| `organizationId` | *?string* | :heavy_minus_sign: | The ID of the organization owning the meter. **Required unless you use an organization token.** | \ No newline at end of file diff --git a/docs/Models/Components/MeterCreateAggregation.md b/docs/Models/Components/MeterCreateAggregation.md new file mode 100644 index 0000000..8f7f36f --- /dev/null +++ b/docs/Models/Components/MeterCreateAggregation.md @@ -0,0 +1,52 @@ +# MeterCreateAggregation + +The aggregation to apply on the filtered events to calculate the meter. + + +## Supported Types + +### `Components\PropertyAggregation` + +```php +/** +* @var Components\PropertyAggregation +*/ +Components\PropertyAggregation $value = /* values here */ +``` + +### `Components\CountAggregation` + +```php +/** +* @var Components\CountAggregation +*/ +Components\CountAggregation $value = /* values here */ +``` + +### `Components\PropertyAggregation` + +```php +/** +* @var Components\PropertyAggregation +*/ +Components\PropertyAggregation $value = /* values here */ +``` + +### `Components\PropertyAggregation` + +```php +/** +* @var Components\PropertyAggregation +*/ +Components\PropertyAggregation $value = /* values here */ +``` + +### `Components\PropertyAggregation` + +```php +/** +* @var Components\PropertyAggregation +*/ +Components\PropertyAggregation $value = /* values here */ +``` + diff --git a/docs/Models/Components/MeterCreateMetadata.md b/docs/Models/Components/MeterCreateMetadata.md new file mode 100644 index 0000000..93cf2fe --- /dev/null +++ b/docs/Models/Components/MeterCreateMetadata.md @@ -0,0 +1,32 @@ +# MeterCreateMetadata + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `int` + +```php +/** +* @var int +*/ +int $value = /* values here */ +``` + +### `bool` + +```php +/** +* @var bool +*/ +bool $value = /* values here */ +``` + diff --git a/docs/Models/Components/MeterMetadata.md b/docs/Models/Components/MeterMetadata.md new file mode 100644 index 0000000..a72d608 --- /dev/null +++ b/docs/Models/Components/MeterMetadata.md @@ -0,0 +1,32 @@ +# MeterMetadata + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `int` + +```php +/** +* @var int +*/ +int $value = /* values here */ +``` + +### `bool` + +```php +/** +* @var bool +*/ +bool $value = /* values here */ +``` + diff --git a/docs/Models/Components/MeterQuantities.md b/docs/Models/Components/MeterQuantities.md new file mode 100644 index 0000000..a87d475 --- /dev/null +++ b/docs/Models/Components/MeterQuantities.md @@ -0,0 +1,8 @@ +# MeterQuantities + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `quantities` | array<[Components\MeterQuantity](../../Models/Components/MeterQuantity.md)> | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/MeterQuantity.md b/docs/Models/Components/MeterQuantity.md new file mode 100644 index 0000000..03a3b43 --- /dev/null +++ b/docs/Models/Components/MeterQuantity.md @@ -0,0 +1,9 @@ +# MeterQuantity + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `timestamp` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | The timestamp for the current period. | +| `quantity` | *float* | :heavy_check_mark: | The quantity for the current period. | \ No newline at end of file diff --git a/docs/Models/Components/MeterSortProperty.md b/docs/Models/Components/MeterSortProperty.md new file mode 100644 index 0000000..01592d5 --- /dev/null +++ b/docs/Models/Components/MeterSortProperty.md @@ -0,0 +1,11 @@ +# MeterSortProperty + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `CreatedAt` | created_at | +| `MinusCreatedAt` | -created_at | +| `Name` | name | +| `MinusName` | -name | \ No newline at end of file diff --git a/docs/Models/Components/MeterUpdate.md b/docs/Models/Components/MeterUpdate.md new file mode 100644 index 0000000..7f18df5 --- /dev/null +++ b/docs/Models/Components/MeterUpdate.md @@ -0,0 +1,11 @@ +# MeterUpdate + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `metadata` | array | :heavy_minus_sign: | N/A | +| `name` | *?string* | :heavy_minus_sign: | The name of the meter. Will be shown on customer's invoices and usage. | +| `filter` | [?Components\Filter](../../Models/Components/Filter.md) | :heavy_minus_sign: | The filter to apply on events that'll be used to calculate the meter. | +| `aggregation` | [Components\CountAggregation\|Components\PropertyAggregation\|null](../../Models/Components/Aggregation.md) | :heavy_minus_sign: | The aggregation to apply on the filtered events to calculate the meter. | \ No newline at end of file diff --git a/docs/Models/Components/MeterUpdateMetadata.md b/docs/Models/Components/MeterUpdateMetadata.md new file mode 100644 index 0000000..36916a2 --- /dev/null +++ b/docs/Models/Components/MeterUpdateMetadata.md @@ -0,0 +1,32 @@ +# MeterUpdateMetadata + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `int` + +```php +/** +* @var int +*/ +int $value = /* values here */ +``` + +### `bool` + +```php +/** +* @var bool +*/ +bool $value = /* values here */ +``` + diff --git a/docs/Models/Components/MetricPeriod.md b/docs/Models/Components/MetricPeriod.md index c80cf4e..9e47b42 100644 --- a/docs/Models/Components/MetricPeriod.md +++ b/docs/Models/Components/MetricPeriod.md @@ -8,6 +8,7 @@ | `timestamp` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Timestamp of this period data. | | `orders` | *int* | :heavy_check_mark: | N/A | | `revenue` | *int* | :heavy_check_mark: | N/A | +| `cumulativeRevenue` | *int* | :heavy_check_mark: | N/A | | `averageOrderValue` | *int* | :heavy_check_mark: | N/A | | `oneTimeProducts` | *int* | :heavy_check_mark: | N/A | | `oneTimeProductsRevenue` | *int* | :heavy_check_mark: | N/A | diff --git a/docs/Models/Components/Metrics.md b/docs/Models/Components/Metrics.md index 37a883b..8498877 100644 --- a/docs/Models/Components/Metrics.md +++ b/docs/Models/Components/Metrics.md @@ -7,6 +7,7 @@ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | | `orders` | [Components\Metric](../../Models/Components/Metric.md) | :heavy_check_mark: | Information about a metric. | | `revenue` | [Components\Metric](../../Models/Components/Metric.md) | :heavy_check_mark: | Information about a metric. | +| `cumulativeRevenue` | [Components\Metric](../../Models/Components/Metric.md) | :heavy_check_mark: | Information about a metric. | | `averageOrderValue` | [Components\Metric](../../Models/Components/Metric.md) | :heavy_check_mark: | Information about a metric. | | `oneTimeProducts` | [Components\Metric](../../Models/Components/Metric.md) | :heavy_check_mark: | Information about a metric. | | `oneTimeProductsRevenue` | [Components\Metric](../../Models/Components/Metric.md) | :heavy_check_mark: | Information about a metric. | diff --git a/docs/Models/Components/OAuth2Client.md b/docs/Models/Components/OAuth2Client.md index 2400be4..40919c8 100644 --- a/docs/Models/Components/OAuth2Client.md +++ b/docs/Models/Components/OAuth2Client.md @@ -14,7 +14,7 @@ | `clientSecretExpiresAt` | *int* | :heavy_check_mark: | N/A | | `tokenEndpointAuthMethod` | [?Components\TokenEndpointAuthMethod](../../Models/Components/TokenEndpointAuthMethod.md) | :heavy_minus_sign: | N/A | | `grantTypes` | array<[Components\GrantTypes](../../Models/Components/GrantTypes.md)> | :heavy_minus_sign: | N/A | -| `responseTypes` | array<[Components\ResponseTypes](../../Models/Components/ResponseTypes.md)> | :heavy_minus_sign: | N/A | +| `responseTypes` | array<*string*> | :heavy_minus_sign: | N/A | | `scope` | *?string* | :heavy_minus_sign: | N/A | | `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | | `clientUri` | *?string* | :heavy_minus_sign: | N/A | diff --git a/docs/Models/Components/OAuth2ClientConfiguration.md b/docs/Models/Components/OAuth2ClientConfiguration.md index afced3a..687256e 100644 --- a/docs/Models/Components/OAuth2ClientConfiguration.md +++ b/docs/Models/Components/OAuth2ClientConfiguration.md @@ -9,7 +9,7 @@ | `clientName` | *string* | :heavy_check_mark: | N/A | | `tokenEndpointAuthMethod` | [?Components\OAuth2ClientConfigurationTokenEndpointAuthMethod](../../Models/Components/OAuth2ClientConfigurationTokenEndpointAuthMethod.md) | :heavy_minus_sign: | N/A | | `grantTypes` | array<[Components\OAuth2ClientConfigurationGrantTypes](../../Models/Components/OAuth2ClientConfigurationGrantTypes.md)> | :heavy_minus_sign: | N/A | -| `responseTypes` | array<[Components\OAuth2ClientConfigurationResponseTypes](../../Models/Components/OAuth2ClientConfigurationResponseTypes.md)> | :heavy_minus_sign: | N/A | +| `responseTypes` | array<*string*> | :heavy_minus_sign: | N/A | | `scope` | *?string* | :heavy_minus_sign: | N/A | | `clientUri` | *?string* | :heavy_minus_sign: | N/A | | `logoUri` | *?string* | :heavy_minus_sign: | N/A | diff --git a/docs/Models/Components/OAuth2ClientConfigurationResponseTypes.md b/docs/Models/Components/OAuth2ClientConfigurationResponseTypes.md deleted file mode 100644 index 38c511f..0000000 --- a/docs/Models/Components/OAuth2ClientConfigurationResponseTypes.md +++ /dev/null @@ -1,8 +0,0 @@ -# OAuth2ClientConfigurationResponseTypes - - -## Values - -| Name | Value | -| ------ | ------ | -| `Code` | code | \ No newline at end of file diff --git a/docs/Models/Components/OAuth2ClientConfigurationUpdate.md b/docs/Models/Components/OAuth2ClientConfigurationUpdate.md index 9111ac2..6f602b6 100644 --- a/docs/Models/Components/OAuth2ClientConfigurationUpdate.md +++ b/docs/Models/Components/OAuth2ClientConfigurationUpdate.md @@ -10,7 +10,7 @@ | `clientId` | *string* | :heavy_check_mark: | N/A | | `tokenEndpointAuthMethod` | [?Components\OAuth2ClientConfigurationUpdateTokenEndpointAuthMethod](../../Models/Components/OAuth2ClientConfigurationUpdateTokenEndpointAuthMethod.md) | :heavy_minus_sign: | N/A | | `grantTypes` | array<[Components\OAuth2ClientConfigurationUpdateGrantTypes](../../Models/Components/OAuth2ClientConfigurationUpdateGrantTypes.md)> | :heavy_minus_sign: | N/A | -| `responseTypes` | array<[Components\OAuth2ClientConfigurationUpdateResponseTypes](../../Models/Components/OAuth2ClientConfigurationUpdateResponseTypes.md)> | :heavy_minus_sign: | N/A | +| `responseTypes` | array<*string*> | :heavy_minus_sign: | N/A | | `scope` | *?string* | :heavy_minus_sign: | N/A | | `clientUri` | *?string* | :heavy_minus_sign: | N/A | | `logoUri` | *?string* | :heavy_minus_sign: | N/A | diff --git a/docs/Models/Components/OAuth2ClientConfigurationUpdateResponseTypes.md b/docs/Models/Components/OAuth2ClientConfigurationUpdateResponseTypes.md deleted file mode 100644 index 8b48a81..0000000 --- a/docs/Models/Components/OAuth2ClientConfigurationUpdateResponseTypes.md +++ /dev/null @@ -1,8 +0,0 @@ -# OAuth2ClientConfigurationUpdateResponseTypes - - -## Values - -| Name | Value | -| ------ | ------ | -| `Code` | code | \ No newline at end of file diff --git a/docs/Models/Components/Onev11oauth21tokenPostXComponentsAuthorizationCodeTokenRequest.md b/docs/Models/Components/Onev11oauth21tokenPostXComponentsAuthorizationCodeTokenRequest.md index 1549fb5..914a416 100644 --- a/docs/Models/Components/Onev11oauth21tokenPostXComponentsAuthorizationCodeTokenRequest.md +++ b/docs/Models/Components/Onev11oauth21tokenPostXComponentsAuthorizationCodeTokenRequest.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `grantType` | [Components\GrantType](../../Models/Components/GrantType.md) | :heavy_check_mark: | N/A | -| `clientId` | *string* | :heavy_check_mark: | N/A | -| `clientSecret` | *string* | :heavy_check_mark: | N/A | -| `code` | *string* | :heavy_check_mark: | N/A | -| `redirectUri` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `grantType` | *string* | :heavy_check_mark: | N/A | +| `clientId` | *string* | :heavy_check_mark: | N/A | +| `clientSecret` | *string* | :heavy_check_mark: | N/A | +| `code` | *string* | :heavy_check_mark: | N/A | +| `redirectUri` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/Onev11oauth21tokenPostXComponentsRefreshTokenRequest.md b/docs/Models/Components/Onev11oauth21tokenPostXComponentsRefreshTokenRequest.md index 3ff7225..9b84d4e 100644 --- a/docs/Models/Components/Onev11oauth21tokenPostXComponentsRefreshTokenRequest.md +++ b/docs/Models/Components/Onev11oauth21tokenPostXComponentsRefreshTokenRequest.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `grantType` | [Components\Onev11oauth21tokenPostXComponentsRefreshTokenRequestGrantType](../../Models/Components/Onev11oauth21tokenPostXComponentsRefreshTokenRequestGrantType.md) | :heavy_check_mark: | N/A | -| `clientId` | *string* | :heavy_check_mark: | N/A | -| `clientSecret` | *string* | :heavy_check_mark: | N/A | -| `refreshToken` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `grantType` | *string* | :heavy_check_mark: | N/A | +| `clientId` | *string* | :heavy_check_mark: | N/A | +| `clientSecret` | *string* | :heavy_check_mark: | N/A | +| `refreshToken` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/Onev11oauth21tokenPostXComponentsRefreshTokenRequestGrantType.md b/docs/Models/Components/Onev11oauth21tokenPostXComponentsRefreshTokenRequestGrantType.md deleted file mode 100644 index 132a2e4..0000000 --- a/docs/Models/Components/Onev11oauth21tokenPostXComponentsRefreshTokenRequestGrantType.md +++ /dev/null @@ -1,8 +0,0 @@ -# Onev11oauth21tokenPostXComponentsRefreshTokenRequestGrantType - - -## Values - -| Name | Value | -| -------------- | -------------- | -| `RefreshToken` | refresh_token | \ No newline at end of file diff --git a/docs/Models/Components/Order.md b/docs/Models/Components/Order.md index 1847600..3ed0e69 100644 --- a/docs/Models/Components/Order.md +++ b/docs/Models/Components/Order.md @@ -8,8 +8,11 @@ | `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | | `id` | *string* | :heavy_check_mark: | The ID of the object. | | `metadata` | array | :heavy_check_mark: | N/A | +| `status` | *string* | :heavy_check_mark: | N/A | | `amount` | *int* | :heavy_check_mark: | N/A | | `taxAmount` | *int* | :heavy_check_mark: | N/A | +| `refundedAmount` | *int* | :heavy_check_mark: | Amount refunded | +| `refundedTaxAmount` | *int* | :heavy_check_mark: | Sales tax refunded | | `currency` | *string* | :heavy_check_mark: | N/A | | `billingReason` | [Components\OrderBillingReason](../../Models/Components/OrderBillingReason.md) | :heavy_check_mark: | N/A | | `customerId` | *string* | :heavy_check_mark: | N/A | @@ -21,7 +24,7 @@ | `product` | [Components\OrderProduct](../../Models/Components/OrderProduct.md) | :heavy_check_mark: | N/A | | `productPrice` | [Components\ProductPriceRecurringFixed\|Components\ProductPriceRecurringCustom\|Components\ProductPriceRecurringFree\|Components\ProductPriceOneTimeFixed\|Components\ProductPriceOneTimeCustom\|Components\ProductPriceOneTimeFree](../../Models/Components/ProductPrice.md) | :heavy_check_mark: | N/A | | `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | -| `customFieldData` | [?Components\OrderCustomFieldData](../../Models/Components/OrderCustomFieldData.md) | :heavy_minus_sign: | Key-value object storing custom field values. | +| `customFieldData` | array | :heavy_minus_sign: | Key-value object storing custom field values. | | `billingAddress` | [Components\Address](../../Models/Components/Address.md) | :heavy_check_mark: | N/A | | `discountId` | *string* | :heavy_check_mark: | N/A | | `subscriptionId` | *string* | :heavy_check_mark: | N/A | diff --git a/docs/Models/Components/OrderCustomFieldData.md b/docs/Models/Components/OrderCustomFieldData.md index 8d371a0..22ac1de 100644 --- a/docs/Models/Components/OrderCustomFieldData.md +++ b/docs/Models/Components/OrderCustomFieldData.md @@ -1,9 +1,41 @@ # OrderCustomFieldData -Key-value object storing custom field values. +## Supported Types -## Fields +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `int` + +```php +/** +* @var int +*/ +int $value = /* values here */ +``` + +### `bool` + +```php +/** +* @var bool +*/ +bool $value = /* values here */ +``` + +### `\DateTime` + +```php +/** +* @var \DateTime +*/ +\DateTime $value = /* values here */ +``` -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/OrderSubscription.md b/docs/Models/Components/OrderSubscription.md index 6d68cb5..a47b422 100644 --- a/docs/Models/Components/OrderSubscription.md +++ b/docs/Models/Components/OrderSubscription.md @@ -20,7 +20,11 @@ | `amount` | *int* | :heavy_check_mark: | N/A | | `currency` | *string* | :heavy_check_mark: | N/A | | `currentPeriodEnd` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | +| `canceledAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | | `startedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | +| `endsAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | | `endedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | | `discountId` | *string* | :heavy_check_mark: | N/A | -| `checkoutId` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| `checkoutId` | *string* | :heavy_check_mark: | N/A | +| `customerCancellationReason` | [Components\CustomerCancellationReason](../../Models/Components/CustomerCancellationReason.md) | :heavy_check_mark: | N/A | +| `customerCancellationComment` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/Organization.md b/docs/Models/Components/Organization.md index 0162130..08bced5 100644 --- a/docs/Models/Components/Organization.md +++ b/docs/Models/Components/Organization.md @@ -3,22 +3,23 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | -| `id` | *string* | :heavy_check_mark: | The organization ID. | -| `name` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `pledgeMinimumAmount` | *int* | :heavy_check_mark: | N/A | -| `pledgeBadgeShowAmount` | *bool* | :heavy_check_mark: | N/A | -| `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | -| `avatarUrl` | *string* | :heavy_check_mark: | N/A | -| `bio` | *string* | :heavy_check_mark: | N/A | -| `company` | *string* | :heavy_check_mark: | N/A | -| `blog` | *string* | :heavy_check_mark: | N/A | -| `location` | *string* | :heavy_check_mark: | N/A | -| `email` | *string* | :heavy_check_mark: | N/A | -| `twitterUsername` | *string* | :heavy_check_mark: | N/A | -| `defaultUpfrontSplitToContributors` | *int* | :heavy_check_mark: | N/A | -| `profileSettings` | [Components\OrganizationProfileSettings](../../Models/Components/OrganizationProfileSettings.md) | :heavy_check_mark: | Settings for the organization profile | -| `featureSettings` | [Components\OrganizationFeatureSettings](../../Models/Components/OrganizationFeatureSettings.md) | :heavy_check_mark: | Settings for the organization features | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | +| `id` | *string* | :heavy_check_mark: | The organization ID. | +| `name` | *string* | :heavy_check_mark: | N/A | +| `slug` | *string* | :heavy_check_mark: | N/A | +| `pledgeMinimumAmount` | *int* | :heavy_check_mark: | N/A | +| `pledgeBadgeShowAmount` | *bool* | :heavy_check_mark: | N/A | +| `subscriptionSettings` | [Components\OrganizationSubscriptionSettings](../../Models/Components/OrganizationSubscriptionSettings.md) | :heavy_check_mark: | N/A | +| `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | +| `avatarUrl` | *string* | :heavy_check_mark: | N/A | +| `bio` | *string* | :heavy_check_mark: | N/A | +| `company` | *string* | :heavy_check_mark: | N/A | +| `blog` | *string* | :heavy_check_mark: | N/A | +| `location` | *string* | :heavy_check_mark: | N/A | +| `email` | *string* | :heavy_check_mark: | N/A | +| `twitterUsername` | *string* | :heavy_check_mark: | N/A | +| `defaultUpfrontSplitToContributors` | *int* | :heavy_check_mark: | N/A | +| `profileSettings` | [Components\OrganizationProfileSettings](../../Models/Components/OrganizationProfileSettings.md) | :heavy_check_mark: | Settings for the organization profile | +| `featureSettings` | [Components\OrganizationFeatureSettings](../../Models/Components/OrganizationFeatureSettings.md) | :heavy_check_mark: | Settings for the organization features | \ No newline at end of file diff --git a/docs/Models/Components/OrganizationAvatarFileCreate.md b/docs/Models/Components/OrganizationAvatarFileCreate.md index 04516fc..47a78d8 100644 --- a/docs/Models/Components/OrganizationAvatarFileCreate.md +++ b/docs/Models/Components/OrganizationAvatarFileCreate.md @@ -5,13 +5,13 @@ Schema to create a file to be used as an organization avatar. ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -| `name` | *string* | :heavy_check_mark: | N/A | -| `mimeType` | *string* | :heavy_check_mark: | MIME type of the file. Only images are supported for this type of file. | -| `size` | *int* | :heavy_check_mark: | Size of the file. A maximum of 1 MB is allowed for this type of file. | -| `upload` | [Components\S3FileCreateMultipart](../../Models/Components/S3FileCreateMultipart.md) | :heavy_check_mark: | N/A | -| `service` | [Components\OrganizationAvatarFileCreateService](../../Models/Components/OrganizationAvatarFileCreateService.md) | :heavy_check_mark: | N/A | -| `organizationId` | *?string* | :heavy_minus_sign: | N/A | -| `checksumSha256Base64` | *?string* | :heavy_minus_sign: | N/A | -| `version` | *?string* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `name` | *string* | :heavy_check_mark: | N/A | +| `mimeType` | *string* | :heavy_check_mark: | MIME type of the file. Only images are supported for this type of file. | +| `size` | *int* | :heavy_check_mark: | Size of the file. A maximum of 1 MB is allowed for this type of file. | +| `upload` | [Components\S3FileCreateMultipart](../../Models/Components/S3FileCreateMultipart.md) | :heavy_check_mark: | N/A | +| `service` | *string* | :heavy_check_mark: | N/A | +| `organizationId` | *?string* | :heavy_minus_sign: | N/A | +| `checksumSha256Base64` | *?string* | :heavy_minus_sign: | N/A | +| `version` | *?string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/OrganizationAvatarFileCreateService.md b/docs/Models/Components/OrganizationAvatarFileCreateService.md deleted file mode 100644 index cc77fba..0000000 --- a/docs/Models/Components/OrganizationAvatarFileCreateService.md +++ /dev/null @@ -1,8 +0,0 @@ -# OrganizationAvatarFileCreateService - - -## Values - -| Name | Value | -| -------------------- | -------------------- | -| `OrganizationAvatar` | organization_avatar | \ No newline at end of file diff --git a/docs/Models/Components/OrganizationAvatarFileRead.md b/docs/Models/Components/OrganizationAvatarFileRead.md index 5e13c3e..790594b 100644 --- a/docs/Models/Components/OrganizationAvatarFileRead.md +++ b/docs/Models/Components/OrganizationAvatarFileRead.md @@ -5,22 +5,22 @@ File to be used as an organization avatar. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `id` | *string* | :heavy_check_mark: | The ID of the object. | -| `organizationId` | *string* | :heavy_check_mark: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | -| `path` | *string* | :heavy_check_mark: | N/A | -| `mimeType` | *string* | :heavy_check_mark: | N/A | -| `size` | *int* | :heavy_check_mark: | N/A | -| `service` | [Components\OrganizationAvatarFileReadService](../../Models/Components/OrganizationAvatarFileReadService.md) | :heavy_check_mark: | N/A | -| `isUploaded` | *bool* | :heavy_check_mark: | N/A | -| `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | -| `sizeReadable` | *string* | :heavy_check_mark: | N/A | -| `publicUrl` | *string* | :heavy_check_mark: | N/A | -| `storageVersion` | *string* | :heavy_check_mark: | N/A | -| `checksumEtag` | *string* | :heavy_check_mark: | N/A | -| `checksumSha256Base64` | *string* | :heavy_check_mark: | N/A | -| `checksumSha256Hex` | *string* | :heavy_check_mark: | N/A | -| `lastModifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | -| `version` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The ID of the object. | +| `organizationId` | *string* | :heavy_check_mark: | N/A | +| `name` | *string* | :heavy_check_mark: | N/A | +| `path` | *string* | :heavy_check_mark: | N/A | +| `mimeType` | *string* | :heavy_check_mark: | N/A | +| `size` | *int* | :heavy_check_mark: | N/A | +| `service` | *string* | :heavy_check_mark: | N/A | +| `isUploaded` | *bool* | :heavy_check_mark: | N/A | +| `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | +| `sizeReadable` | *string* | :heavy_check_mark: | N/A | +| `publicUrl` | *string* | :heavy_check_mark: | N/A | +| `storageVersion` | *string* | :heavy_check_mark: | N/A | +| `checksumEtag` | *string* | :heavy_check_mark: | N/A | +| `checksumSha256Base64` | *string* | :heavy_check_mark: | N/A | +| `checksumSha256Hex` | *string* | :heavy_check_mark: | N/A | +| `lastModifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | +| `version` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/OrganizationAvatarFileReadService.md b/docs/Models/Components/OrganizationAvatarFileReadService.md deleted file mode 100644 index 2dd150e..0000000 --- a/docs/Models/Components/OrganizationAvatarFileReadService.md +++ /dev/null @@ -1,8 +0,0 @@ -# OrganizationAvatarFileReadService - - -## Values - -| Name | Value | -| -------------------- | -------------------- | -| `OrganizationAvatar` | organization_avatar | \ No newline at end of file diff --git a/docs/Models/Components/OrganizationCreate.md b/docs/Models/Components/OrganizationCreate.md index 861a2ce..f8beba2 100644 --- a/docs/Models/Components/OrganizationCreate.md +++ b/docs/Models/Components/OrganizationCreate.md @@ -3,9 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `name` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `avatarUrl` | *?string* | :heavy_minus_sign: | N/A | -| `featureSettings` | [?Components\OrganizationFeatureSettings](../../Models/Components/OrganizationFeatureSettings.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_check_mark: | N/A | +| `slug` | *string* | :heavy_check_mark: | N/A | +| `avatarUrl` | *?string* | :heavy_minus_sign: | N/A | +| `featureSettings` | [?Components\OrganizationFeatureSettings](../../Models/Components/OrganizationFeatureSettings.md) | :heavy_minus_sign: | N/A | +| `subscriptionSettings` | [?Components\OrganizationSubscriptionSettings](../../Models/Components/OrganizationSubscriptionSettings.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/OrganizationSubscriptionSettings.md b/docs/Models/Components/OrganizationSubscriptionSettings.md new file mode 100644 index 0000000..178cbd6 --- /dev/null +++ b/docs/Models/Components/OrganizationSubscriptionSettings.md @@ -0,0 +1,10 @@ +# OrganizationSubscriptionSettings + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `allowMultipleSubscriptions` | *bool* | :heavy_check_mark: | N/A | +| `allowCustomerUpdates` | *bool* | :heavy_check_mark: | N/A | +| `prorationBehavior` | [Components\SubscriptionProrationBehavior](../../Models/Components/SubscriptionProrationBehavior.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/OrganizationUpdate.md b/docs/Models/Components/OrganizationUpdate.md index 5f72063..5a9c940 100644 --- a/docs/Models/Components/OrganizationUpdate.md +++ b/docs/Models/Components/OrganizationUpdate.md @@ -3,16 +3,17 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `pledgeBadgeShowAmount` | *?bool* | :heavy_minus_sign: | N/A | -| `pledgeMinimumAmount` | *?int* | :heavy_minus_sign: | N/A | -| `name` | *?string* | :heavy_minus_sign: | N/A | -| `avatarUrl` | *?string* | :heavy_minus_sign: | N/A | -| `defaultUpfrontSplitToContributors` | *?int* | :heavy_minus_sign: | N/A | -| `billingEmail` | *?string* | :heavy_minus_sign: | N/A | -| `defaultBadgeCustomContent` | *?string* | :heavy_minus_sign: | N/A | -| `totalMonthlySpendingLimit` | *?int* | :heavy_minus_sign: | N/A | -| `perUserMonthlySpendingLimit` | *?int* | :heavy_minus_sign: | N/A | -| `profileSettings` | [?Components\OrganizationProfileSettings](../../Models/Components/OrganizationProfileSettings.md) | :heavy_minus_sign: | N/A | -| `featureSettings` | [?Components\OrganizationFeatureSettings](../../Models/Components/OrganizationFeatureSettings.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `pledgeBadgeShowAmount` | *?bool* | :heavy_minus_sign: | N/A | +| `pledgeMinimumAmount` | *?int* | :heavy_minus_sign: | N/A | +| `name` | *?string* | :heavy_minus_sign: | N/A | +| `avatarUrl` | *?string* | :heavy_minus_sign: | N/A | +| `defaultUpfrontSplitToContributors` | *?int* | :heavy_minus_sign: | N/A | +| `billingEmail` | *?string* | :heavy_minus_sign: | N/A | +| `defaultBadgeCustomContent` | *?string* | :heavy_minus_sign: | N/A | +| `totalMonthlySpendingLimit` | *?int* | :heavy_minus_sign: | N/A | +| `perUserMonthlySpendingLimit` | *?int* | :heavy_minus_sign: | N/A | +| `profileSettings` | [?Components\OrganizationProfileSettings](../../Models/Components/OrganizationProfileSettings.md) | :heavy_minus_sign: | N/A | +| `featureSettings` | [?Components\OrganizationFeatureSettings](../../Models/Components/OrganizationFeatureSettings.md) | :heavy_minus_sign: | N/A | +| `subscriptionSettings` | [?Components\OrganizationSubscriptionSettings](../../Models/Components/OrganizationSubscriptionSettings.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/PaymentProcessorMetadata.md b/docs/Models/Components/PaymentProcessorMetadata.md deleted file mode 100644 index c197d63..0000000 --- a/docs/Models/Components/PaymentProcessorMetadata.md +++ /dev/null @@ -1,7 +0,0 @@ -# PaymentProcessorMetadata - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/ProductMediaFileCreate.md b/docs/Models/Components/ProductMediaFileCreate.md index 4eb2da5..7240634 100644 --- a/docs/Models/Components/ProductMediaFileCreate.md +++ b/docs/Models/Components/ProductMediaFileCreate.md @@ -5,13 +5,13 @@ Schema to create a file to be used as a product media file. ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `name` | *string* | :heavy_check_mark: | N/A | -| `mimeType` | *string* | :heavy_check_mark: | MIME type of the file. Only images are supported for this type of file. | -| `size` | *int* | :heavy_check_mark: | Size of the file. A maximum of 10 MB is allowed for this type of file. | -| `upload` | [Components\S3FileCreateMultipart](../../Models/Components/S3FileCreateMultipart.md) | :heavy_check_mark: | N/A | -| `service` | [Components\ProductMediaFileCreateService](../../Models/Components/ProductMediaFileCreateService.md) | :heavy_check_mark: | N/A | -| `organizationId` | *?string* | :heavy_minus_sign: | N/A | -| `checksumSha256Base64` | *?string* | :heavy_minus_sign: | N/A | -| `version` | *?string* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `name` | *string* | :heavy_check_mark: | N/A | +| `mimeType` | *string* | :heavy_check_mark: | MIME type of the file. Only images are supported for this type of file. | +| `size` | *int* | :heavy_check_mark: | Size of the file. A maximum of 10 MB is allowed for this type of file. | +| `upload` | [Components\S3FileCreateMultipart](../../Models/Components/S3FileCreateMultipart.md) | :heavy_check_mark: | N/A | +| `service` | *string* | :heavy_check_mark: | N/A | +| `organizationId` | *?string* | :heavy_minus_sign: | N/A | +| `checksumSha256Base64` | *?string* | :heavy_minus_sign: | N/A | +| `version` | *?string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/ProductMediaFileCreateService.md b/docs/Models/Components/ProductMediaFileCreateService.md deleted file mode 100644 index 1aab00b..0000000 --- a/docs/Models/Components/ProductMediaFileCreateService.md +++ /dev/null @@ -1,8 +0,0 @@ -# ProductMediaFileCreateService - - -## Values - -| Name | Value | -| -------------- | -------------- | -| `ProductMedia` | product_media | \ No newline at end of file diff --git a/docs/Models/Components/ProductMediaFileRead.md b/docs/Models/Components/ProductMediaFileRead.md index b55ea06..93dc37f 100644 --- a/docs/Models/Components/ProductMediaFileRead.md +++ b/docs/Models/Components/ProductMediaFileRead.md @@ -13,7 +13,7 @@ File to be used as a product media file. | `path` | *string* | :heavy_check_mark: | N/A | | `mimeType` | *string* | :heavy_check_mark: | N/A | | `size` | *int* | :heavy_check_mark: | N/A | -| `service` | [Components\Service](../../Models/Components/Service.md) | :heavy_check_mark: | N/A | +| `service` | *string* | :heavy_check_mark: | N/A | | `isUploaded` | *bool* | :heavy_check_mark: | N/A | | `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | | `sizeReadable` | *string* | :heavy_check_mark: | N/A | diff --git a/docs/Models/Components/ProductPriceOneTimeCustom.md b/docs/Models/Components/ProductPriceOneTimeCustom.md index 9921165..7c446e1 100644 --- a/docs/Models/Components/ProductPriceOneTimeCustom.md +++ b/docs/Models/Components/ProductPriceOneTimeCustom.md @@ -5,16 +5,16 @@ A pay-what-you-want price for a one-time product. ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -| `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | -| `id` | *string* | :heavy_check_mark: | The ID of the price. | -| `amountType` | [Components\ProductPriceOneTimeCustomAmountType](../../Models/Components/ProductPriceOneTimeCustomAmountType.md) | :heavy_check_mark: | N/A | -| `isArchived` | *bool* | :heavy_check_mark: | Whether the price is archived and no longer available. | -| `productId` | *string* | :heavy_check_mark: | The ID of the product owning the price. | -| `priceCurrency` | *string* | :heavy_check_mark: | The currency. | -| `type` | [Components\ProductPriceOneTimeCustomType](../../Models/Components/ProductPriceOneTimeCustomType.md) | :heavy_check_mark: | The type of the price. | -| `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | -| `minimumAmount` | *int* | :heavy_check_mark: | The minimum amount the customer can pay. | -| `maximumAmount` | *int* | :heavy_check_mark: | The maximum amount the customer can pay. | -| `presetAmount` | *int* | :heavy_check_mark: | The initial amount shown to the customer. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | +| `id` | *string* | :heavy_check_mark: | The ID of the price. | +| `amountType` | *string* | :heavy_check_mark: | N/A | +| `isArchived` | *bool* | :heavy_check_mark: | Whether the price is archived and no longer available. | +| `productId` | *string* | :heavy_check_mark: | The ID of the product owning the price. | +| `priceCurrency` | *string* | :heavy_check_mark: | The currency. | +| `type` | *string* | :heavy_check_mark: | The type of the price. | +| `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | +| `minimumAmount` | *int* | :heavy_check_mark: | The minimum amount the customer can pay. | +| `maximumAmount` | *int* | :heavy_check_mark: | The maximum amount the customer can pay. | +| `presetAmount` | *int* | :heavy_check_mark: | The initial amount shown to the customer. | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceOneTimeCustomAmountType.md b/docs/Models/Components/ProductPriceOneTimeCustomAmountType.md deleted file mode 100644 index 488175a..0000000 --- a/docs/Models/Components/ProductPriceOneTimeCustomAmountType.md +++ /dev/null @@ -1,8 +0,0 @@ -# ProductPriceOneTimeCustomAmountType - - -## Values - -| Name | Value | -| -------- | -------- | -| `Custom` | custom | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceOneTimeCustomCreate.md b/docs/Models/Components/ProductPriceOneTimeCustomCreate.md index f0c4b4d..1bf3be2 100644 --- a/docs/Models/Components/ProductPriceOneTimeCustomCreate.md +++ b/docs/Models/Components/ProductPriceOneTimeCustomCreate.md @@ -5,11 +5,11 @@ Schema to create a pay-what-you-want price for a one-time product. ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | -| `type` | [Components\ProductPriceOneTimeCustomCreateType](../../Models/Components/ProductPriceOneTimeCustomCreateType.md) | :heavy_check_mark: | N/A | -| `amountType` | [Components\ProductPriceOneTimeCustomCreateAmountType](../../Models/Components/ProductPriceOneTimeCustomCreateAmountType.md) | :heavy_check_mark: | N/A | -| `priceCurrency` | *?string* | :heavy_minus_sign: | The currency. Currently, only `usd` is supported. | -| `minimumAmount` | *?int* | :heavy_minus_sign: | The minimum amount the customer can pay. | -| `maximumAmount` | *?int* | :heavy_minus_sign: | The maximum amount the customer can pay. | -| `presetAmount` | *?int* | :heavy_minus_sign: | The initial amount shown to the customer. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `type` | *string* | :heavy_check_mark: | N/A | +| `amountType` | *string* | :heavy_check_mark: | N/A | +| `priceCurrency` | *?string* | :heavy_minus_sign: | The currency. Currently, only `usd` is supported. | +| `minimumAmount` | *?int* | :heavy_minus_sign: | The minimum amount the customer can pay. | +| `maximumAmount` | *?int* | :heavy_minus_sign: | The maximum amount the customer can pay. | +| `presetAmount` | *?int* | :heavy_minus_sign: | The initial amount shown to the customer. | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceOneTimeCustomCreateAmountType.md b/docs/Models/Components/ProductPriceOneTimeCustomCreateAmountType.md deleted file mode 100644 index 9740bdb..0000000 --- a/docs/Models/Components/ProductPriceOneTimeCustomCreateAmountType.md +++ /dev/null @@ -1,8 +0,0 @@ -# ProductPriceOneTimeCustomCreateAmountType - - -## Values - -| Name | Value | -| -------- | -------- | -| `Custom` | custom | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceOneTimeCustomCreateType.md b/docs/Models/Components/ProductPriceOneTimeCustomCreateType.md deleted file mode 100644 index cea48f1..0000000 --- a/docs/Models/Components/ProductPriceOneTimeCustomCreateType.md +++ /dev/null @@ -1,8 +0,0 @@ -# ProductPriceOneTimeCustomCreateType - - -## Values - -| Name | Value | -| --------- | --------- | -| `OneTime` | one_time | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceOneTimeCustomType.md b/docs/Models/Components/ProductPriceOneTimeCustomType.md deleted file mode 100644 index 760fae0..0000000 --- a/docs/Models/Components/ProductPriceOneTimeCustomType.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductPriceOneTimeCustomType - -The type of the price. - - -## Values - -| Name | Value | -| --------- | --------- | -| `OneTime` | one_time | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceOneTimeFixed.md b/docs/Models/Components/ProductPriceOneTimeFixed.md index 186a392..4477e53 100644 --- a/docs/Models/Components/ProductPriceOneTimeFixed.md +++ b/docs/Models/Components/ProductPriceOneTimeFixed.md @@ -5,14 +5,14 @@ A one-time price for a product. ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | -| `id` | *string* | :heavy_check_mark: | The ID of the price. | -| `amountType` | [Components\ProductPriceOneTimeFixedAmountType](../../Models/Components/ProductPriceOneTimeFixedAmountType.md) | :heavy_check_mark: | N/A | -| `isArchived` | *bool* | :heavy_check_mark: | Whether the price is archived and no longer available. | -| `productId` | *string* | :heavy_check_mark: | The ID of the product owning the price. | -| `priceCurrency` | *string* | :heavy_check_mark: | The currency. | -| `priceAmount` | *int* | :heavy_check_mark: | The price in cents. | -| `type` | [Components\ProductPriceOneTimeFixedType](../../Models/Components/ProductPriceOneTimeFixedType.md) | :heavy_check_mark: | The type of the price. | -| `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | +| `id` | *string* | :heavy_check_mark: | The ID of the price. | +| `amountType` | *string* | :heavy_check_mark: | N/A | +| `isArchived` | *bool* | :heavy_check_mark: | Whether the price is archived and no longer available. | +| `productId` | *string* | :heavy_check_mark: | The ID of the product owning the price. | +| `priceCurrency` | *string* | :heavy_check_mark: | The currency. | +| `priceAmount` | *int* | :heavy_check_mark: | The price in cents. | +| `type` | *string* | :heavy_check_mark: | The type of the price. | +| `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceOneTimeFixedAmountType.md b/docs/Models/Components/ProductPriceOneTimeFixedAmountType.md deleted file mode 100644 index 98d8777..0000000 --- a/docs/Models/Components/ProductPriceOneTimeFixedAmountType.md +++ /dev/null @@ -1,8 +0,0 @@ -# ProductPriceOneTimeFixedAmountType - - -## Values - -| Name | Value | -| ------- | ------- | -| `Fixed` | fixed | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceOneTimeFixedCreate.md b/docs/Models/Components/ProductPriceOneTimeFixedCreate.md index b864ecf..acaf683 100644 --- a/docs/Models/Components/ProductPriceOneTimeFixedCreate.md +++ b/docs/Models/Components/ProductPriceOneTimeFixedCreate.md @@ -5,9 +5,9 @@ Schema to create a one-time product price. ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `type` | [Components\ProductPriceOneTimeFixedCreateType](../../Models/Components/ProductPriceOneTimeFixedCreateType.md) | :heavy_check_mark: | N/A | -| `amountType` | [Components\ProductPriceOneTimeFixedCreateAmountType](../../Models/Components/ProductPriceOneTimeFixedCreateAmountType.md) | :heavy_check_mark: | N/A | -| `priceAmount` | *int* | :heavy_check_mark: | The price in cents. | -| `priceCurrency` | *?string* | :heavy_minus_sign: | The currency. Currently, only `usd` is supported. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `type` | *string* | :heavy_check_mark: | N/A | +| `amountType` | *string* | :heavy_check_mark: | N/A | +| `priceAmount` | *int* | :heavy_check_mark: | The price in cents. | +| `priceCurrency` | *?string* | :heavy_minus_sign: | The currency. Currently, only `usd` is supported. | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceOneTimeFixedCreateAmountType.md b/docs/Models/Components/ProductPriceOneTimeFixedCreateAmountType.md deleted file mode 100644 index 67ccfc6..0000000 --- a/docs/Models/Components/ProductPriceOneTimeFixedCreateAmountType.md +++ /dev/null @@ -1,8 +0,0 @@ -# ProductPriceOneTimeFixedCreateAmountType - - -## Values - -| Name | Value | -| ------- | ------- | -| `Fixed` | fixed | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceOneTimeFixedCreateType.md b/docs/Models/Components/ProductPriceOneTimeFixedCreateType.md deleted file mode 100644 index 78c197e..0000000 --- a/docs/Models/Components/ProductPriceOneTimeFixedCreateType.md +++ /dev/null @@ -1,8 +0,0 @@ -# ProductPriceOneTimeFixedCreateType - - -## Values - -| Name | Value | -| --------- | --------- | -| `OneTime` | one_time | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceOneTimeFixedType.md b/docs/Models/Components/ProductPriceOneTimeFixedType.md deleted file mode 100644 index 737939d..0000000 --- a/docs/Models/Components/ProductPriceOneTimeFixedType.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductPriceOneTimeFixedType - -The type of the price. - - -## Values - -| Name | Value | -| --------- | --------- | -| `OneTime` | one_time | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceOneTimeFree.md b/docs/Models/Components/ProductPriceOneTimeFree.md index cb1bfbd..d10e65b 100644 --- a/docs/Models/Components/ProductPriceOneTimeFree.md +++ b/docs/Models/Components/ProductPriceOneTimeFree.md @@ -5,12 +5,12 @@ A free one-time price for a product. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | -| `id` | *string* | :heavy_check_mark: | The ID of the price. | -| `amountType` | [Components\ProductPriceOneTimeFreeAmountType](../../Models/Components/ProductPriceOneTimeFreeAmountType.md) | :heavy_check_mark: | N/A | -| `isArchived` | *bool* | :heavy_check_mark: | Whether the price is archived and no longer available. | -| `productId` | *string* | :heavy_check_mark: | The ID of the product owning the price. | -| `type` | [Components\ProductPriceOneTimeFreeType](../../Models/Components/ProductPriceOneTimeFreeType.md) | :heavy_check_mark: | The type of the price. | -| `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | +| `id` | *string* | :heavy_check_mark: | The ID of the price. | +| `amountType` | *string* | :heavy_check_mark: | N/A | +| `isArchived` | *bool* | :heavy_check_mark: | Whether the price is archived and no longer available. | +| `productId` | *string* | :heavy_check_mark: | The ID of the product owning the price. | +| `type` | *string* | :heavy_check_mark: | The type of the price. | +| `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceOneTimeFreeAmountType.md b/docs/Models/Components/ProductPriceOneTimeFreeAmountType.md deleted file mode 100644 index e56ca98..0000000 --- a/docs/Models/Components/ProductPriceOneTimeFreeAmountType.md +++ /dev/null @@ -1,8 +0,0 @@ -# ProductPriceOneTimeFreeAmountType - - -## Values - -| Name | Value | -| ------ | ------ | -| `Free` | free | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceOneTimeFreeCreate.md b/docs/Models/Components/ProductPriceOneTimeFreeCreate.md index 6896c7b..3fc0c8d 100644 --- a/docs/Models/Components/ProductPriceOneTimeFreeCreate.md +++ b/docs/Models/Components/ProductPriceOneTimeFreeCreate.md @@ -5,7 +5,7 @@ Schema to create a free one-time product price. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | -| `type` | [Components\ProductPriceOneTimeFreeCreateType](../../Models/Components/ProductPriceOneTimeFreeCreateType.md) | :heavy_check_mark: | N/A | -| `amountType` | [Components\ProductPriceOneTimeFreeCreateAmountType](../../Models/Components/ProductPriceOneTimeFreeCreateAmountType.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `type` | *string* | :heavy_check_mark: | N/A | +| `amountType` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceOneTimeFreeCreateAmountType.md b/docs/Models/Components/ProductPriceOneTimeFreeCreateAmountType.md deleted file mode 100644 index 685b6f2..0000000 --- a/docs/Models/Components/ProductPriceOneTimeFreeCreateAmountType.md +++ /dev/null @@ -1,8 +0,0 @@ -# ProductPriceOneTimeFreeCreateAmountType - - -## Values - -| Name | Value | -| ------ | ------ | -| `Free` | free | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceOneTimeFreeCreateType.md b/docs/Models/Components/ProductPriceOneTimeFreeCreateType.md deleted file mode 100644 index 36814cb..0000000 --- a/docs/Models/Components/ProductPriceOneTimeFreeCreateType.md +++ /dev/null @@ -1,8 +0,0 @@ -# ProductPriceOneTimeFreeCreateType - - -## Values - -| Name | Value | -| --------- | --------- | -| `OneTime` | one_time | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceOneTimeFreeType.md b/docs/Models/Components/ProductPriceOneTimeFreeType.md deleted file mode 100644 index 9b1ae0b..0000000 --- a/docs/Models/Components/ProductPriceOneTimeFreeType.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductPriceOneTimeFreeType - -The type of the price. - - -## Values - -| Name | Value | -| --------- | --------- | -| `OneTime` | one_time | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceRecurringCustom.md b/docs/Models/Components/ProductPriceRecurringCustom.md index 8a76185..888d7c4 100644 --- a/docs/Models/Components/ProductPriceRecurringCustom.md +++ b/docs/Models/Components/ProductPriceRecurringCustom.md @@ -5,17 +5,17 @@ A pay-what-you-want recurring price for a product, i.e. a subscription. ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | -| `id` | *string* | :heavy_check_mark: | The ID of the price. | -| `amountType` | [Components\ProductPriceRecurringCustomAmountType](../../Models/Components/ProductPriceRecurringCustomAmountType.md) | :heavy_check_mark: | N/A | -| `isArchived` | *bool* | :heavy_check_mark: | Whether the price is archived and no longer available. | -| `productId` | *string* | :heavy_check_mark: | The ID of the product owning the price. | -| `priceCurrency` | *string* | :heavy_check_mark: | The currency. | -| `type` | [Components\ProductPriceRecurringCustomType](../../Models/Components/ProductPriceRecurringCustomType.md) | :heavy_check_mark: | The type of the price. | -| `recurringInterval` | [Components\SubscriptionRecurringInterval](../../Models/Components/SubscriptionRecurringInterval.md) | :heavy_check_mark: | N/A | -| `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | -| `minimumAmount` | *int* | :heavy_check_mark: | The minimum amount the customer can pay. | -| `maximumAmount` | *int* | :heavy_check_mark: | The maximum amount the customer can pay. | -| `presetAmount` | *int* | :heavy_check_mark: | The initial amount shown to the customer. | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | +| `id` | *string* | :heavy_check_mark: | The ID of the price. | +| `amountType` | *string* | :heavy_check_mark: | N/A | +| `isArchived` | *bool* | :heavy_check_mark: | Whether the price is archived and no longer available. | +| `productId` | *string* | :heavy_check_mark: | The ID of the product owning the price. | +| `priceCurrency` | *string* | :heavy_check_mark: | The currency. | +| `type` | *string* | :heavy_check_mark: | The type of the price. | +| `recurringInterval` | [Components\SubscriptionRecurringInterval](../../Models/Components/SubscriptionRecurringInterval.md) | :heavy_check_mark: | N/A | +| `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | +| `minimumAmount` | *int* | :heavy_check_mark: | The minimum amount the customer can pay. | +| `maximumAmount` | *int* | :heavy_check_mark: | The maximum amount the customer can pay. | +| `presetAmount` | *int* | :heavy_check_mark: | The initial amount shown to the customer. | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceRecurringCustomAmountType.md b/docs/Models/Components/ProductPriceRecurringCustomAmountType.md deleted file mode 100644 index e701cde..0000000 --- a/docs/Models/Components/ProductPriceRecurringCustomAmountType.md +++ /dev/null @@ -1,8 +0,0 @@ -# ProductPriceRecurringCustomAmountType - - -## Values - -| Name | Value | -| -------- | -------- | -| `Custom` | custom | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceRecurringCustomType.md b/docs/Models/Components/ProductPriceRecurringCustomType.md deleted file mode 100644 index ea4d794..0000000 --- a/docs/Models/Components/ProductPriceRecurringCustomType.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductPriceRecurringCustomType - -The type of the price. - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `Recurring` | recurring | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceRecurringFixed.md b/docs/Models/Components/ProductPriceRecurringFixed.md index 37af365..120a998 100644 --- a/docs/Models/Components/ProductPriceRecurringFixed.md +++ b/docs/Models/Components/ProductPriceRecurringFixed.md @@ -9,11 +9,11 @@ A recurring price for a product, i.e. a subscription. | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | | `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | | `id` | *string* | :heavy_check_mark: | The ID of the price. | -| `amountType` | [Components\AmountType](../../Models/Components/AmountType.md) | :heavy_check_mark: | N/A | +| `amountType` | *string* | :heavy_check_mark: | N/A | | `isArchived` | *bool* | :heavy_check_mark: | Whether the price is archived and no longer available. | | `productId` | *string* | :heavy_check_mark: | The ID of the product owning the price. | | `priceCurrency` | *string* | :heavy_check_mark: | The currency. | | `priceAmount` | *int* | :heavy_check_mark: | The price in cents. | -| `type` | [Components\Type](../../Models/Components/Type.md) | :heavy_check_mark: | The type of the price. | +| `type` | *string* | :heavy_check_mark: | The type of the price. | | `recurringInterval` | [Components\SubscriptionRecurringInterval](../../Models/Components/SubscriptionRecurringInterval.md) | :heavy_check_mark: | N/A | | `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceRecurringFixedCreate.md b/docs/Models/Components/ProductPriceRecurringFixedCreate.md index 861f4e6..00c9612 100644 --- a/docs/Models/Components/ProductPriceRecurringFixedCreate.md +++ b/docs/Models/Components/ProductPriceRecurringFixedCreate.md @@ -5,10 +5,10 @@ Schema to create a recurring product price, i.e. a subscription. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -| `type` | [Components\ProductPriceRecurringFixedCreateType](../../Models/Components/ProductPriceRecurringFixedCreateType.md) | :heavy_check_mark: | N/A | -| `amountType` | [Components\ProductPriceRecurringFixedCreateAmountType](../../Models/Components/ProductPriceRecurringFixedCreateAmountType.md) | :heavy_check_mark: | N/A | -| `priceAmount` | *int* | :heavy_check_mark: | The price in cents. | -| `recurringInterval` | [Components\SubscriptionRecurringInterval](../../Models/Components/SubscriptionRecurringInterval.md) | :heavy_check_mark: | N/A | -| `priceCurrency` | *?string* | :heavy_minus_sign: | The currency. Currently, only `usd` is supported. | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `type` | *string* | :heavy_check_mark: | N/A | +| `amountType` | *string* | :heavy_check_mark: | N/A | +| `priceAmount` | *int* | :heavy_check_mark: | The price in cents. | +| `recurringInterval` | [Components\SubscriptionRecurringInterval](../../Models/Components/SubscriptionRecurringInterval.md) | :heavy_check_mark: | N/A | +| `priceCurrency` | *?string* | :heavy_minus_sign: | The currency. Currently, only `usd` is supported. | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceRecurringFixedCreateAmountType.md b/docs/Models/Components/ProductPriceRecurringFixedCreateAmountType.md deleted file mode 100644 index d9a6511..0000000 --- a/docs/Models/Components/ProductPriceRecurringFixedCreateAmountType.md +++ /dev/null @@ -1,8 +0,0 @@ -# ProductPriceRecurringFixedCreateAmountType - - -## Values - -| Name | Value | -| ------- | ------- | -| `Fixed` | fixed | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceRecurringFixedCreateType.md b/docs/Models/Components/ProductPriceRecurringFixedCreateType.md deleted file mode 100644 index f1f3b8e..0000000 --- a/docs/Models/Components/ProductPriceRecurringFixedCreateType.md +++ /dev/null @@ -1,8 +0,0 @@ -# ProductPriceRecurringFixedCreateType - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `Recurring` | recurring | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceRecurringFree.md b/docs/Models/Components/ProductPriceRecurringFree.md index ab0cbce..a0bbd78 100644 --- a/docs/Models/Components/ProductPriceRecurringFree.md +++ b/docs/Models/Components/ProductPriceRecurringFree.md @@ -5,13 +5,13 @@ A free recurring price for a product, i.e. a subscription. ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -| `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | -| `id` | *string* | :heavy_check_mark: | The ID of the price. | -| `amountType` | [Components\ProductPriceRecurringFreeAmountType](../../Models/Components/ProductPriceRecurringFreeAmountType.md) | :heavy_check_mark: | N/A | -| `isArchived` | *bool* | :heavy_check_mark: | Whether the price is archived and no longer available. | -| `productId` | *string* | :heavy_check_mark: | The ID of the product owning the price. | -| `type` | [Components\ProductPriceRecurringFreeType](../../Models/Components/ProductPriceRecurringFreeType.md) | :heavy_check_mark: | The type of the price. | -| `recurringInterval` | [Components\SubscriptionRecurringInterval](../../Models/Components/SubscriptionRecurringInterval.md) | :heavy_check_mark: | N/A | -| `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | +| `id` | *string* | :heavy_check_mark: | The ID of the price. | +| `amountType` | *string* | :heavy_check_mark: | N/A | +| `isArchived` | *bool* | :heavy_check_mark: | Whether the price is archived and no longer available. | +| `productId` | *string* | :heavy_check_mark: | The ID of the product owning the price. | +| `type` | *string* | :heavy_check_mark: | The type of the price. | +| `recurringInterval` | [Components\SubscriptionRecurringInterval](../../Models/Components/SubscriptionRecurringInterval.md) | :heavy_check_mark: | N/A | +| `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceRecurringFreeAmountType.md b/docs/Models/Components/ProductPriceRecurringFreeAmountType.md deleted file mode 100644 index da14d8c..0000000 --- a/docs/Models/Components/ProductPriceRecurringFreeAmountType.md +++ /dev/null @@ -1,8 +0,0 @@ -# ProductPriceRecurringFreeAmountType - - -## Values - -| Name | Value | -| ------ | ------ | -| `Free` | free | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceRecurringFreeCreate.md b/docs/Models/Components/ProductPriceRecurringFreeCreate.md index fd80657..9cfeece 100644 --- a/docs/Models/Components/ProductPriceRecurringFreeCreate.md +++ b/docs/Models/Components/ProductPriceRecurringFreeCreate.md @@ -5,8 +5,8 @@ Schema to create a free recurring product price, i.e. a subscription. ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | -| `type` | [Components\ProductPriceRecurringFreeCreateType](../../Models/Components/ProductPriceRecurringFreeCreateType.md) | :heavy_check_mark: | N/A | -| `amountType` | [Components\ProductPriceRecurringFreeCreateAmountType](../../Models/Components/ProductPriceRecurringFreeCreateAmountType.md) | :heavy_check_mark: | N/A | -| `recurringInterval` | [Components\SubscriptionRecurringInterval](../../Models/Components/SubscriptionRecurringInterval.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `type` | *string* | :heavy_check_mark: | N/A | +| `amountType` | *string* | :heavy_check_mark: | N/A | +| `recurringInterval` | [Components\SubscriptionRecurringInterval](../../Models/Components/SubscriptionRecurringInterval.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceRecurringFreeCreateAmountType.md b/docs/Models/Components/ProductPriceRecurringFreeCreateAmountType.md deleted file mode 100644 index 8ba1135..0000000 --- a/docs/Models/Components/ProductPriceRecurringFreeCreateAmountType.md +++ /dev/null @@ -1,8 +0,0 @@ -# ProductPriceRecurringFreeCreateAmountType - - -## Values - -| Name | Value | -| ------ | ------ | -| `Free` | free | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceRecurringFreeCreateType.md b/docs/Models/Components/ProductPriceRecurringFreeCreateType.md deleted file mode 100644 index 28c4847..0000000 --- a/docs/Models/Components/ProductPriceRecurringFreeCreateType.md +++ /dev/null @@ -1,8 +0,0 @@ -# ProductPriceRecurringFreeCreateType - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `Recurring` | recurring | \ No newline at end of file diff --git a/docs/Models/Components/ProductPriceRecurringFreeType.md b/docs/Models/Components/ProductPriceRecurringFreeType.md deleted file mode 100644 index cff9115..0000000 --- a/docs/Models/Components/ProductPriceRecurringFreeType.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductPriceRecurringFreeType - -The type of the price. - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `Recurring` | recurring | \ No newline at end of file diff --git a/docs/Models/Components/ProductRecurringCreate.md b/docs/Models/Components/ProductRecurringCreate.md index 0de0b44..f9a5f6c 100644 --- a/docs/Models/Components/ProductRecurringCreate.md +++ b/docs/Models/Components/ProductRecurringCreate.md @@ -8,7 +8,7 @@ Schema to create a recurring product, i.e. a subscription. | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `name` | *string* | :heavy_check_mark: | The name of the product. | -| `prices` | array<[Components\ProductPriceRecurringFixedCreate](../../Models/Components/ProductPriceRecurringFixedCreate.md)> | :heavy_check_mark: | List of available prices for this product. | +| `prices` | [array](../../Models/Components/ProductRecurringCreatePrices.md) | :heavy_check_mark: | List of available prices for this product. | | `metadata` | array | :heavy_minus_sign: | Key-value object allowing you to store additional information.

The key must be a string with a maximum length of **40 characters**.
The value must be either:

* A string with a maximum length of **500 characters**
* An integer
* A boolean

You can store up to **50 key-value pairs**. | | `attachedCustomFields` | array<[Components\AttachedCustomFieldCreate](../../Models/Components/AttachedCustomFieldCreate.md)> | :heavy_minus_sign: | List of custom fields to attach. | | `description` | *?string* | :heavy_minus_sign: | The description of the product. | diff --git a/docs/Models/Components/ProductRecurringCreatePrices.md b/docs/Models/Components/ProductRecurringCreatePrices.md new file mode 100644 index 0000000..530f8a8 --- /dev/null +++ b/docs/Models/Components/ProductRecurringCreatePrices.md @@ -0,0 +1,25 @@ +# ProductRecurringCreatePrices + +List of available prices for this product. + + +## Supported Types + +### `array` + +```php +/** +* @var array +*/ +array $value = /* values here */ +``` + +### `array` + +```php +/** +* @var array +*/ +array $value = /* values here */ +``` + diff --git a/docs/Models/Components/PropertyAggregation.md b/docs/Models/Components/PropertyAggregation.md new file mode 100644 index 0000000..042a579 --- /dev/null +++ b/docs/Models/Components/PropertyAggregation.md @@ -0,0 +1,9 @@ +# PropertyAggregation + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `func` | [Components\Func](../../Models/Components/Func.md) | :heavy_check_mark: | N/A | +| `property` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/Refund.md b/docs/Models/Components/Refund.md new file mode 100644 index 0000000..4cce8b8 --- /dev/null +++ b/docs/Models/Components/Refund.md @@ -0,0 +1,21 @@ +# Refund + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Creation timestamp of the object. | +| `id` | *string* | :heavy_check_mark: | The ID of the object. | +| `metadata` | array | :heavy_check_mark: | N/A | +| `status` | [Components\RefundStatus](../../Models/Components/RefundStatus.md) | :heavy_check_mark: | N/A | +| `reason` | [Components\RefundReason](../../Models/Components/RefundReason.md) | :heavy_check_mark: | N/A | +| `amount` | *int* | :heavy_check_mark: | N/A | +| `taxAmount` | *int* | :heavy_check_mark: | N/A | +| `currency` | *string* | :heavy_check_mark: | N/A | +| `organizationId` | *string* | :heavy_check_mark: | N/A | +| `orderId` | *string* | :heavy_check_mark: | N/A | +| `customerId` | *string* | :heavy_check_mark: | N/A | +| `revokeBenefits` | *bool* | :heavy_check_mark: | N/A | +| `modifiedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Last modification timestamp of the object. | +| `subscriptionId` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/RefundCreate.md b/docs/Models/Components/RefundCreate.md new file mode 100644 index 0000000..ba12edb --- /dev/null +++ b/docs/Models/Components/RefundCreate.md @@ -0,0 +1,13 @@ +# RefundCreate + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `orderId` | *string* | :heavy_check_mark: | N/A | +| `reason` | [Components\RefundReason](../../Models/Components/RefundReason.md) | :heavy_check_mark: | N/A | +| `amount` | *int* | :heavy_check_mark: | N/A | +| `metadata` | array | :heavy_minus_sign: | Key-value object allowing you to store additional information.

The key must be a string with a maximum length of **40 characters**.
The value must be either:

* A string with a maximum length of **500 characters**
* An integer
* A boolean

You can store up to **50 key-value pairs**. | +| `revokeBenefits` | *?bool* | :heavy_minus_sign: | Should this refund trigger the associated customer benefits to be revoked?

**Note:**
Only allowed in case the `order` is a one-time purchase.
Subscriptions automatically revoke customer benefits once the
subscription itself is revoked, i.e fully canceled. | +| `comment` | *?string* | :heavy_minus_sign: | An internal comment about the refund. | \ No newline at end of file diff --git a/docs/Models/Components/RefundCreateMetadata.md b/docs/Models/Components/RefundCreateMetadata.md new file mode 100644 index 0000000..337244f --- /dev/null +++ b/docs/Models/Components/RefundCreateMetadata.md @@ -0,0 +1,32 @@ +# RefundCreateMetadata + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `int` + +```php +/** +* @var int +*/ +int $value = /* values here */ +``` + +### `bool` + +```php +/** +* @var bool +*/ +bool $value = /* values here */ +``` + diff --git a/docs/Models/Components/RefundMetadata.md b/docs/Models/Components/RefundMetadata.md new file mode 100644 index 0000000..be553f7 --- /dev/null +++ b/docs/Models/Components/RefundMetadata.md @@ -0,0 +1,32 @@ +# RefundMetadata + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `int` + +```php +/** +* @var int +*/ +int $value = /* values here */ +``` + +### `bool` + +```php +/** +* @var bool +*/ +bool $value = /* values here */ +``` + diff --git a/docs/Models/Components/RefundReason.md b/docs/Models/Components/RefundReason.md new file mode 100644 index 0000000..011fd9e --- /dev/null +++ b/docs/Models/Components/RefundReason.md @@ -0,0 +1,13 @@ +# RefundReason + + +## Values + +| Name | Value | +| ----------------------- | ----------------------- | +| `Duplicate` | duplicate | +| `Fraudulent` | fraudulent | +| `CustomerRequest` | customer_request | +| `ServiceDisruption` | service_disruption | +| `SatisfactionGuarantee` | satisfaction_guarantee | +| `Other` | other | \ No newline at end of file diff --git a/docs/Models/Components/RefundSortProperty.md b/docs/Models/Components/RefundSortProperty.md new file mode 100644 index 0000000..5a323a2 --- /dev/null +++ b/docs/Models/Components/RefundSortProperty.md @@ -0,0 +1,11 @@ +# RefundSortProperty + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `CreatedAt` | created_at | +| `MinusCreatedAt` | -created_at | +| `Amount` | amount | +| `MinusAmount` | -amount | \ No newline at end of file diff --git a/docs/Models/Components/RefundStatus.md b/docs/Models/Components/RefundStatus.md new file mode 100644 index 0000000..c41e382 --- /dev/null +++ b/docs/Models/Components/RefundStatus.md @@ -0,0 +1,11 @@ +# RefundStatus + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `Pending` | pending | +| `Succeeded` | succeeded | +| `Failed` | failed | +| `Canceled` | canceled | \ No newline at end of file diff --git a/docs/Models/Components/ResponseTypes.md b/docs/Models/Components/ResponseTypes.md deleted file mode 100644 index 3616431..0000000 --- a/docs/Models/Components/ResponseTypes.md +++ /dev/null @@ -1,8 +0,0 @@ -# ResponseTypes - - -## Values - -| Name | Value | -| ------ | ------ | -| `Code` | code | \ No newline at end of file diff --git a/docs/Models/Components/Scope.md b/docs/Models/Components/Scope.md index dbb6971..99a2fa8 100644 --- a/docs/Models/Components/Scope.md +++ b/docs/Models/Components/Scope.md @@ -25,6 +25,10 @@ | `ProductsWrite` | products:write | | `BenefitsRead` | benefits:read | | `BenefitsWrite` | benefits:write | +| `EventsRead` | events:read | +| `EventsWrite` | events:write | +| `MetersRead` | meters:read | +| `MetersWrite` | meters:write | | `FilesRead` | files:read | | `FilesWrite` | files:write | | `SubscriptionsRead` | subscriptions:read | @@ -33,6 +37,8 @@ | `CustomersWrite` | customers:write | | `CustomerSessionsWrite` | customer_sessions:write | | `OrdersRead` | orders:read | +| `RefundsRead` | refunds:read | +| `RefundsWrite` | refunds:write | | `MetricsRead` | metrics:read | | `WebhooksRead` | webhooks:read | | `WebhooksWrite` | webhooks:write | diff --git a/docs/Models/Components/Service.md b/docs/Models/Components/Service.md deleted file mode 100644 index 7a2c851..0000000 --- a/docs/Models/Components/Service.md +++ /dev/null @@ -1,8 +0,0 @@ -# Service - - -## Values - -| Name | Value | -| -------------- | -------------- | -| `ProductMedia` | product_media | \ No newline at end of file diff --git a/docs/Models/Components/Status.md b/docs/Models/Components/Status.md deleted file mode 100644 index b0992bc..0000000 --- a/docs/Models/Components/Status.md +++ /dev/null @@ -1,8 +0,0 @@ -# Status - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `Confirmed` | confirmed | \ No newline at end of file diff --git a/docs/Models/Components/Subscription.md b/docs/Models/Components/Subscription.md index 2703347..eccae5d 100644 --- a/docs/Models/Components/Subscription.md +++ b/docs/Models/Components/Subscription.md @@ -24,9 +24,13 @@ | `amount` | *int* | :heavy_check_mark: | N/A | | `currency` | *string* | :heavy_check_mark: | N/A | | `currentPeriodEnd` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | +| `canceledAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | | `startedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | +| `endsAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | | `endedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | | `discountId` | *string* | :heavy_check_mark: | N/A | | `checkoutId` | *string* | :heavy_check_mark: | N/A | -| `customFieldData` | [?Components\SubscriptionCustomFieldData](../../Models/Components/SubscriptionCustomFieldData.md) | :heavy_minus_sign: | Key-value object storing custom field values. | +| `customerCancellationReason` | [Components\CustomerCancellationReason](../../Models/Components/CustomerCancellationReason.md) | :heavy_check_mark: | N/A | +| `customerCancellationComment` | *string* | :heavy_check_mark: | N/A | +| `customFieldData` | array | :heavy_minus_sign: | Key-value object storing custom field values. | | `discount` | [Components\DiscountFixedOnceForeverDurationBase\|Components\DiscountFixedRepeatDurationBase\|Components\DiscountPercentageOnceForeverDurationBase\|Components\DiscountPercentageRepeatDurationBase](../../Models/Components/SubscriptionDiscount.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/SubscriptionCancel.md b/docs/Models/Components/SubscriptionCancel.md new file mode 100644 index 0000000..26dc1f4 --- /dev/null +++ b/docs/Models/Components/SubscriptionCancel.md @@ -0,0 +1,11 @@ +# SubscriptionCancel + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `cancelAtPeriodEnd` | *?bool* | :heavy_minus_sign: | Cancel an active subscription once the current period ends.

Or uncancel a subscription currently set to be revoked at period end. | +| `revoke` | *?bool* | :heavy_minus_sign: | Cancel and revoke an active subscription immediately | +| `customerCancellationReason` | [?Components\CustomerCancellationReason](../../Models/Components/CustomerCancellationReason.md) | :heavy_minus_sign: | Customer reason for cancellation.

Helpful to monitor reasons behind churn for future improvements.

Only set this in case your own service is requesting the reason from the
customer. Or you know based on direct conversations, i.e support, with
the customer.

* `too_expensive`: Too expensive for the customer.
* `missing_features`: Customer is missing certain features.
* `switched_service`: Customer switched to another service.
* `unused`: Customer is not using it enough.
* `customer_service`: Customer is not satisfied with the customer service.
* `low_quality`: Customer is unhappy with the quality.
* `too_complex`: Customer considers the service too complicated.
* `other`: Other reason(s). | +| `customerCancellationComment` | *?string* | :heavy_minus_sign: | Customer feedback and why they decided to cancel.

**IMPORTANT:**
Do not use this to store internal notes! It's intended to be input
from the customer and is therefore also available in their Polar
purchases library.

Only set this in case your own service is requesting the reason from the
customer. Or you copy a message directly from a customer
conversation, i.e support. | \ No newline at end of file diff --git a/docs/Models/Components/SubscriptionCustomFieldData.md b/docs/Models/Components/SubscriptionCustomFieldData.md deleted file mode 100644 index 92d7b36..0000000 --- a/docs/Models/Components/SubscriptionCustomFieldData.md +++ /dev/null @@ -1,9 +0,0 @@ -# SubscriptionCustomFieldData - -Key-value object storing custom field values. - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/SubscriptionProrationBehavior.md b/docs/Models/Components/SubscriptionProrationBehavior.md new file mode 100644 index 0000000..764c8dd --- /dev/null +++ b/docs/Models/Components/SubscriptionProrationBehavior.md @@ -0,0 +1,9 @@ +# SubscriptionProrationBehavior + + +## Values + +| Name | Value | +| --------- | --------- | +| `Invoice` | invoice | +| `Prorate` | prorate | \ No newline at end of file diff --git a/docs/Models/Components/SubscriptionUpdate.md b/docs/Models/Components/SubscriptionUpdate.md new file mode 100644 index 0000000..e6631f2 --- /dev/null +++ b/docs/Models/Components/SubscriptionUpdate.md @@ -0,0 +1,23 @@ +# SubscriptionUpdate + + +## Supported Types + +### `Components\SubscriptionUpdatePrice` + +```php +/** +* @var Components\SubscriptionUpdatePrice +*/ +Components\SubscriptionUpdatePrice $value = /* values here */ +``` + +### `Components\SubscriptionCancel` + +```php +/** +* @var Components\SubscriptionCancel +*/ +Components\SubscriptionCancel $value = /* values here */ +``` + diff --git a/docs/Models/Components/SubscriptionUpdatePrice.md b/docs/Models/Components/SubscriptionUpdatePrice.md new file mode 100644 index 0000000..d3d3dad --- /dev/null +++ b/docs/Models/Components/SubscriptionUpdatePrice.md @@ -0,0 +1,9 @@ +# SubscriptionUpdatePrice + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `productPriceId` | *string* | :heavy_check_mark: | Update subscription to another price. | +| `prorationBehavior` | [?Components\SubscriptionProrationBehavior](../../Models/Components/SubscriptionProrationBehavior.md) | :heavy_minus_sign: | Determine how to handle the proration billing. If not provided, will use the default organization setting. | \ No newline at end of file diff --git a/docs/Models/Components/Interval.md b/docs/Models/Components/TimeInterval.md similarity index 91% rename from docs/Models/Components/Interval.md rename to docs/Models/Components/TimeInterval.md index 0507245..ec56881 100644 --- a/docs/Models/Components/Interval.md +++ b/docs/Models/Components/TimeInterval.md @@ -1,4 +1,4 @@ -# Interval +# TimeInterval ## Values diff --git a/docs/Models/Components/TokenResponse.md b/docs/Models/Components/TokenResponse.md index f7a4b6c..23e5293 100644 --- a/docs/Models/Components/TokenResponse.md +++ b/docs/Models/Components/TokenResponse.md @@ -3,11 +3,11 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `accessToken` | *string* | :heavy_check_mark: | N/A | -| `tokenType` | [Components\TokenType](../../Models/Components/TokenType.md) | :heavy_check_mark: | N/A | -| `expiresIn` | *int* | :heavy_check_mark: | N/A | -| `scope` | *string* | :heavy_check_mark: | N/A | -| `idToken` | *string* | :heavy_check_mark: | N/A | -| `refreshToken` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `accessToken` | *string* | :heavy_check_mark: | N/A | +| `tokenType` | *string* | :heavy_check_mark: | N/A | +| `expiresIn` | *int* | :heavy_check_mark: | N/A | +| `scope` | *string* | :heavy_check_mark: | N/A | +| `idToken` | *string* | :heavy_check_mark: | N/A | +| `refreshToken` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/TokenType.md b/docs/Models/Components/TokenType.md index 73dcc0c..6ef3808 100644 --- a/docs/Models/Components/TokenType.md +++ b/docs/Models/Components/TokenType.md @@ -3,6 +3,7 @@ ## Values -| Name | Value | -| -------- | -------- | -| `Bearer` | Bearer | \ No newline at end of file +| Name | Value | +| -------------- | -------------- | +| `AccessToken` | access_token | +| `RefreshToken` | refresh_token | \ No newline at end of file diff --git a/docs/Models/Components/Type.md b/docs/Models/Components/Type.md deleted file mode 100644 index e427cc7..0000000 --- a/docs/Models/Components/Type.md +++ /dev/null @@ -1,10 +0,0 @@ -# Type - -The type of the price. - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `Recurring` | recurring | \ No newline at end of file diff --git a/docs/Models/Components/Value.md b/docs/Models/Components/Value.md new file mode 100644 index 0000000..c20e912 --- /dev/null +++ b/docs/Models/Components/Value.md @@ -0,0 +1,32 @@ +# Value + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `int` + +```php +/** +* @var int +*/ +int $value = /* values here */ +``` + +### `bool` + +```php +/** +* @var bool +*/ +bool $value = /* values here */ +``` + diff --git a/docs/Models/Components/WebhookBenefitCreatedPayload.md b/docs/Models/Components/WebhookBenefitCreatedPayload.md index 4a129d4..58a8855 100644 --- a/docs/Models/Components/WebhookBenefitCreatedPayload.md +++ b/docs/Models/Components/WebhookBenefitCreatedPayload.md @@ -9,5 +9,5 @@ Sent when a new benefit is created. | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `type` | [Components\WebhookBenefitCreatedPayloadType](../../Models/Components/WebhookBenefitCreatedPayloadType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `data` | [Components\BenefitAds\|Components\BenefitCustom\|Components\BenefitDiscord\|Components\BenefitGitHubRepository\|Components\BenefitDownloadables\|Components\BenefitLicenseKeys](../../Models/Components/Benefit.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/WebhookBenefitCreatedPayloadType.md b/docs/Models/Components/WebhookBenefitCreatedPayloadType.md deleted file mode 100644 index 5e65f63..0000000 --- a/docs/Models/Components/WebhookBenefitCreatedPayloadType.md +++ /dev/null @@ -1,8 +0,0 @@ -# WebhookBenefitCreatedPayloadType - - -## Values - -| Name | Value | -| ---------------- | ---------------- | -| `BenefitCreated` | benefit.created | \ No newline at end of file diff --git a/docs/Models/Components/WebhookBenefitGrantCreatedPayload.md b/docs/Models/Components/WebhookBenefitGrantCreatedPayload.md index 65265a5..ee3142c 100644 --- a/docs/Models/Components/WebhookBenefitGrantCreatedPayload.md +++ b/docs/Models/Components/WebhookBenefitGrantCreatedPayload.md @@ -7,7 +7,7 @@ Sent when a new benefit grant is created. ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `type` | [Components\WebhookBenefitGrantCreatedPayloadType](../../Models/Components/WebhookBenefitGrantCreatedPayloadType.md) | :heavy_check_mark: | N/A | -| `data` | [Components\BenefitGrantWebhook](../../Models/Components/BenefitGrantWebhook.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `type` | *string* | :heavy_check_mark: | N/A | +| `data` | [Components\BenefitGrantWebhook](../../Models/Components/BenefitGrantWebhook.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/WebhookBenefitGrantCreatedPayloadType.md b/docs/Models/Components/WebhookBenefitGrantCreatedPayloadType.md deleted file mode 100644 index eb39cbd..0000000 --- a/docs/Models/Components/WebhookBenefitGrantCreatedPayloadType.md +++ /dev/null @@ -1,8 +0,0 @@ -# WebhookBenefitGrantCreatedPayloadType - - -## Values - -| Name | Value | -| --------------------- | --------------------- | -| `BenefitGrantCreated` | benefit_grant.created | \ No newline at end of file diff --git a/docs/Models/Components/WebhookBenefitGrantRevokedPayload.md b/docs/Models/Components/WebhookBenefitGrantRevokedPayload.md index 413187f..31bf9be 100644 --- a/docs/Models/Components/WebhookBenefitGrantRevokedPayload.md +++ b/docs/Models/Components/WebhookBenefitGrantRevokedPayload.md @@ -7,7 +7,7 @@ Sent when a new benefit grant is revoked. ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `type` | [Components\WebhookBenefitGrantRevokedPayloadType](../../Models/Components/WebhookBenefitGrantRevokedPayloadType.md) | :heavy_check_mark: | N/A | -| `data` | [Components\BenefitGrantWebhook](../../Models/Components/BenefitGrantWebhook.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `type` | *string* | :heavy_check_mark: | N/A | +| `data` | [Components\BenefitGrantWebhook](../../Models/Components/BenefitGrantWebhook.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/WebhookBenefitGrantRevokedPayloadType.md b/docs/Models/Components/WebhookBenefitGrantRevokedPayloadType.md deleted file mode 100644 index d8b80bb..0000000 --- a/docs/Models/Components/WebhookBenefitGrantRevokedPayloadType.md +++ /dev/null @@ -1,8 +0,0 @@ -# WebhookBenefitGrantRevokedPayloadType - - -## Values - -| Name | Value | -| --------------------- | --------------------- | -| `BenefitGrantRevoked` | benefit_grant.revoked | \ No newline at end of file diff --git a/docs/Models/Components/WebhookBenefitGrantUpdatedPayload.md b/docs/Models/Components/WebhookBenefitGrantUpdatedPayload.md index 71a10fd..84dab9e 100644 --- a/docs/Models/Components/WebhookBenefitGrantUpdatedPayload.md +++ b/docs/Models/Components/WebhookBenefitGrantUpdatedPayload.md @@ -7,7 +7,7 @@ Sent when a new benefit grant is updated. ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `type` | [Components\WebhookBenefitGrantUpdatedPayloadType](../../Models/Components/WebhookBenefitGrantUpdatedPayloadType.md) | :heavy_check_mark: | N/A | -| `data` | [Components\BenefitGrantWebhook](../../Models/Components/BenefitGrantWebhook.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `type` | *string* | :heavy_check_mark: | N/A | +| `data` | [Components\BenefitGrantWebhook](../../Models/Components/BenefitGrantWebhook.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/WebhookBenefitGrantUpdatedPayloadType.md b/docs/Models/Components/WebhookBenefitGrantUpdatedPayloadType.md deleted file mode 100644 index fc99860..0000000 --- a/docs/Models/Components/WebhookBenefitGrantUpdatedPayloadType.md +++ /dev/null @@ -1,8 +0,0 @@ -# WebhookBenefitGrantUpdatedPayloadType - - -## Values - -| Name | Value | -| --------------------- | --------------------- | -| `BenefitGrantUpdated` | benefit_grant.updated | \ No newline at end of file diff --git a/docs/Models/Components/WebhookBenefitUpdatedPayload.md b/docs/Models/Components/WebhookBenefitUpdatedPayload.md index 7d385be..c54a850 100644 --- a/docs/Models/Components/WebhookBenefitUpdatedPayload.md +++ b/docs/Models/Components/WebhookBenefitUpdatedPayload.md @@ -9,5 +9,5 @@ Sent when a benefit is updated. | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `type` | [Components\WebhookBenefitUpdatedPayloadType](../../Models/Components/WebhookBenefitUpdatedPayloadType.md) | :heavy_check_mark: | N/A | +| `type` | *string* | :heavy_check_mark: | N/A | | `data` | [Components\BenefitAds\|Components\BenefitCustom\|Components\BenefitDiscord\|Components\BenefitGitHubRepository\|Components\BenefitDownloadables\|Components\BenefitLicenseKeys](../../Models/Components/Benefit.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/WebhookBenefitUpdatedPayloadType.md b/docs/Models/Components/WebhookBenefitUpdatedPayloadType.md deleted file mode 100644 index 66948db..0000000 --- a/docs/Models/Components/WebhookBenefitUpdatedPayloadType.md +++ /dev/null @@ -1,8 +0,0 @@ -# WebhookBenefitUpdatedPayloadType - - -## Values - -| Name | Value | -| ---------------- | ---------------- | -| `BenefitUpdated` | benefit.updated | \ No newline at end of file diff --git a/docs/Models/Components/WebhookCheckoutCreatedPayload.md b/docs/Models/Components/WebhookCheckoutCreatedPayload.md index 6469b63..2785898 100644 --- a/docs/Models/Components/WebhookCheckoutCreatedPayload.md +++ b/docs/Models/Components/WebhookCheckoutCreatedPayload.md @@ -7,7 +7,7 @@ Sent when a new checkout is created. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `type` | [Components\WebhookCheckoutCreatedPayloadType](../../Models/Components/WebhookCheckoutCreatedPayloadType.md) | :heavy_check_mark: | N/A | -| `data` | [Components\Checkout](../../Models/Components/Checkout.md) | :heavy_check_mark: | Checkout session data retrieved using an access token. | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `type` | *string* | :heavy_check_mark: | N/A | +| `data` | [Components\Checkout](../../Models/Components/Checkout.md) | :heavy_check_mark: | Checkout session data retrieved using an access token. | \ No newline at end of file diff --git a/docs/Models/Components/WebhookCheckoutCreatedPayloadType.md b/docs/Models/Components/WebhookCheckoutCreatedPayloadType.md deleted file mode 100644 index 7f736f0..0000000 --- a/docs/Models/Components/WebhookCheckoutCreatedPayloadType.md +++ /dev/null @@ -1,8 +0,0 @@ -# WebhookCheckoutCreatedPayloadType - - -## Values - -| Name | Value | -| ----------------- | ----------------- | -| `CheckoutCreated` | checkout.created | \ No newline at end of file diff --git a/docs/Models/Components/WebhookCheckoutUpdatedPayload.md b/docs/Models/Components/WebhookCheckoutUpdatedPayload.md index fc2b83f..2f0d68f 100644 --- a/docs/Models/Components/WebhookCheckoutUpdatedPayload.md +++ b/docs/Models/Components/WebhookCheckoutUpdatedPayload.md @@ -7,7 +7,7 @@ Sent when a checkout is updated. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `type` | [Components\WebhookCheckoutUpdatedPayloadType](../../Models/Components/WebhookCheckoutUpdatedPayloadType.md) | :heavy_check_mark: | N/A | -| `data` | [Components\Checkout](../../Models/Components/Checkout.md) | :heavy_check_mark: | Checkout session data retrieved using an access token. | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `type` | *string* | :heavy_check_mark: | N/A | +| `data` | [Components\Checkout](../../Models/Components/Checkout.md) | :heavy_check_mark: | Checkout session data retrieved using an access token. | \ No newline at end of file diff --git a/docs/Models/Components/WebhookCheckoutUpdatedPayloadType.md b/docs/Models/Components/WebhookCheckoutUpdatedPayloadType.md deleted file mode 100644 index da3cbac..0000000 --- a/docs/Models/Components/WebhookCheckoutUpdatedPayloadType.md +++ /dev/null @@ -1,8 +0,0 @@ -# WebhookCheckoutUpdatedPayloadType - - -## Values - -| Name | Value | -| ----------------- | ----------------- | -| `CheckoutUpdated` | checkout.updated | \ No newline at end of file diff --git a/docs/Models/Components/WebhookOrderCreatedPayload.md b/docs/Models/Components/WebhookOrderCreatedPayload.md index 9749663..307dc71 100644 --- a/docs/Models/Components/WebhookOrderCreatedPayload.md +++ b/docs/Models/Components/WebhookOrderCreatedPayload.md @@ -7,7 +7,7 @@ Sent when a new order is created. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `type` | [Components\WebhookOrderCreatedPayloadType](../../Models/Components/WebhookOrderCreatedPayloadType.md) | :heavy_check_mark: | N/A | -| `data` | [Components\Order](../../Models/Components/Order.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `type` | *string* | :heavy_check_mark: | N/A | +| `data` | [Components\Order](../../Models/Components/Order.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/WebhookOrderCreatedPayloadType.md b/docs/Models/Components/WebhookOrderCreatedPayloadType.md deleted file mode 100644 index b14c620..0000000 --- a/docs/Models/Components/WebhookOrderCreatedPayloadType.md +++ /dev/null @@ -1,8 +0,0 @@ -# WebhookOrderCreatedPayloadType - - -## Values - -| Name | Value | -| -------------- | -------------- | -| `OrderCreated` | order.created | \ No newline at end of file diff --git a/docs/Models/Components/WebhookOrderRefundedPayload.md b/docs/Models/Components/WebhookOrderRefundedPayload.md new file mode 100644 index 0000000..85d6c3c --- /dev/null +++ b/docs/Models/Components/WebhookOrderRefundedPayload.md @@ -0,0 +1,13 @@ +# WebhookOrderRefundedPayload + +Sent when an order is fully or partially refunded. + +**Discord & Slack support:** Full + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `type` | *string* | :heavy_check_mark: | N/A | +| `data` | [Components\Order](../../Models/Components/Order.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/WebhookOrganizationUpdatedPayload.md b/docs/Models/Components/WebhookOrganizationUpdatedPayload.md index b71c1e1..3f1ecb2 100644 --- a/docs/Models/Components/WebhookOrganizationUpdatedPayload.md +++ b/docs/Models/Components/WebhookOrganizationUpdatedPayload.md @@ -7,7 +7,7 @@ Sent when a organization is updated. ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `type` | [Components\WebhookOrganizationUpdatedPayloadType](../../Models/Components/WebhookOrganizationUpdatedPayloadType.md) | :heavy_check_mark: | N/A | -| `data` | [Components\Organization](../../Models/Components/Organization.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `type` | *string* | :heavy_check_mark: | N/A | +| `data` | [Components\Organization](../../Models/Components/Organization.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/WebhookOrganizationUpdatedPayloadType.md b/docs/Models/Components/WebhookOrganizationUpdatedPayloadType.md deleted file mode 100644 index 2281b97..0000000 --- a/docs/Models/Components/WebhookOrganizationUpdatedPayloadType.md +++ /dev/null @@ -1,8 +0,0 @@ -# WebhookOrganizationUpdatedPayloadType - - -## Values - -| Name | Value | -| --------------------- | --------------------- | -| `OrganizationUpdated` | organization.updated | \ No newline at end of file diff --git a/docs/Models/Components/WebhookPledgeCreatedPayload.md b/docs/Models/Components/WebhookPledgeCreatedPayload.md index 764f041..9e7d6f0 100644 --- a/docs/Models/Components/WebhookPledgeCreatedPayload.md +++ b/docs/Models/Components/WebhookPledgeCreatedPayload.md @@ -7,7 +7,7 @@ Sent when a new pledge is created. Note that this does mean that the pledge has ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| `type` | [Components\WebhookPledgeCreatedPayloadType](../../Models/Components/WebhookPledgeCreatedPayloadType.md) | :heavy_check_mark: | N/A | -| `data` | [Components\Pledge](../../Models/Components/Pledge.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `type` | *string* | :heavy_check_mark: | N/A | +| `data` | [Components\Pledge](../../Models/Components/Pledge.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/WebhookPledgeCreatedPayloadType.md b/docs/Models/Components/WebhookPledgeCreatedPayloadType.md deleted file mode 100644 index c69bb16..0000000 --- a/docs/Models/Components/WebhookPledgeCreatedPayloadType.md +++ /dev/null @@ -1,8 +0,0 @@ -# WebhookPledgeCreatedPayloadType - - -## Values - -| Name | Value | -| --------------- | --------------- | -| `PledgeCreated` | pledge.created | \ No newline at end of file diff --git a/docs/Models/Components/WebhookPledgeUpdatedPayload.md b/docs/Models/Components/WebhookPledgeUpdatedPayload.md index e07d65f..af60f7d 100644 --- a/docs/Models/Components/WebhookPledgeUpdatedPayload.md +++ b/docs/Models/Components/WebhookPledgeUpdatedPayload.md @@ -7,7 +7,7 @@ Sent when a pledge is updated. ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| `type` | [Components\WebhookPledgeUpdatedPayloadType](../../Models/Components/WebhookPledgeUpdatedPayloadType.md) | :heavy_check_mark: | N/A | -| `data` | [Components\Pledge](../../Models/Components/Pledge.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `type` | *string* | :heavy_check_mark: | N/A | +| `data` | [Components\Pledge](../../Models/Components/Pledge.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/WebhookPledgeUpdatedPayloadType.md b/docs/Models/Components/WebhookPledgeUpdatedPayloadType.md deleted file mode 100644 index 964def7..0000000 --- a/docs/Models/Components/WebhookPledgeUpdatedPayloadType.md +++ /dev/null @@ -1,8 +0,0 @@ -# WebhookPledgeUpdatedPayloadType - - -## Values - -| Name | Value | -| --------------- | --------------- | -| `PledgeUpdated` | pledge.updated | \ No newline at end of file diff --git a/docs/Models/Components/WebhookProductCreatedPayload.md b/docs/Models/Components/WebhookProductCreatedPayload.md index 4c2b32d..6f2b4e1 100644 --- a/docs/Models/Components/WebhookProductCreatedPayload.md +++ b/docs/Models/Components/WebhookProductCreatedPayload.md @@ -7,7 +7,7 @@ Sent when a new product is created. ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `type` | [Components\WebhookProductCreatedPayloadType](../../Models/Components/WebhookProductCreatedPayloadType.md) | :heavy_check_mark: | N/A | -| `data` | [Components\Product](../../Models/Components/Product.md) | :heavy_check_mark: | A product. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `type` | *string* | :heavy_check_mark: | N/A | +| `data` | [Components\Product](../../Models/Components/Product.md) | :heavy_check_mark: | A product. | \ No newline at end of file diff --git a/docs/Models/Components/WebhookProductCreatedPayloadType.md b/docs/Models/Components/WebhookProductCreatedPayloadType.md deleted file mode 100644 index 4a74296..0000000 --- a/docs/Models/Components/WebhookProductCreatedPayloadType.md +++ /dev/null @@ -1,8 +0,0 @@ -# WebhookProductCreatedPayloadType - - -## Values - -| Name | Value | -| ---------------- | ---------------- | -| `ProductCreated` | product.created | \ No newline at end of file diff --git a/docs/Models/Components/WebhookProductUpdatedPayload.md b/docs/Models/Components/WebhookProductUpdatedPayload.md index e1de271..d987701 100644 --- a/docs/Models/Components/WebhookProductUpdatedPayload.md +++ b/docs/Models/Components/WebhookProductUpdatedPayload.md @@ -7,7 +7,7 @@ Sent when a product is updated. ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `type` | [Components\WebhookProductUpdatedPayloadType](../../Models/Components/WebhookProductUpdatedPayloadType.md) | :heavy_check_mark: | N/A | -| `data` | [Components\Product](../../Models/Components/Product.md) | :heavy_check_mark: | A product. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `type` | *string* | :heavy_check_mark: | N/A | +| `data` | [Components\Product](../../Models/Components/Product.md) | :heavy_check_mark: | A product. | \ No newline at end of file diff --git a/docs/Models/Components/WebhookProductUpdatedPayloadType.md b/docs/Models/Components/WebhookProductUpdatedPayloadType.md deleted file mode 100644 index a8e3f0f..0000000 --- a/docs/Models/Components/WebhookProductUpdatedPayloadType.md +++ /dev/null @@ -1,8 +0,0 @@ -# WebhookProductUpdatedPayloadType - - -## Values - -| Name | Value | -| ---------------- | ---------------- | -| `ProductUpdated` | product.updated | \ No newline at end of file diff --git a/docs/Models/Components/WebhookRefundCreatedPayload.md b/docs/Models/Components/WebhookRefundCreatedPayload.md new file mode 100644 index 0000000..d1e93e5 --- /dev/null +++ b/docs/Models/Components/WebhookRefundCreatedPayload.md @@ -0,0 +1,13 @@ +# WebhookRefundCreatedPayload + +Sent when a refund is created regardless of status. + +**Discord & Slack support:** Full + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `type` | *string* | :heavy_check_mark: | N/A | +| `data` | [Components\Refund](../../Models/Components/Refund.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/WebhookRefundUpdatedPayload.md b/docs/Models/Components/WebhookRefundUpdatedPayload.md new file mode 100644 index 0000000..500b14a --- /dev/null +++ b/docs/Models/Components/WebhookRefundUpdatedPayload.md @@ -0,0 +1,13 @@ +# WebhookRefundUpdatedPayload + +Sent when a refund is updated. + +**Discord & Slack support:** Full + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `type` | *string* | :heavy_check_mark: | N/A | +| `data` | [Components\Refund](../../Models/Components/Refund.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/WebhookSubscriptionActivePayload.md b/docs/Models/Components/WebhookSubscriptionActivePayload.md index 92753b6..a3cccab 100644 --- a/docs/Models/Components/WebhookSubscriptionActivePayload.md +++ b/docs/Models/Components/WebhookSubscriptionActivePayload.md @@ -8,7 +8,7 @@ whether because it's a new paid subscription or because payment was recovered. ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | -| `type` | [Components\WebhookSubscriptionActivePayloadType](../../Models/Components/WebhookSubscriptionActivePayloadType.md) | :heavy_check_mark: | N/A | -| `data` | [Components\Subscription](../../Models/Components/Subscription.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `type` | *string* | :heavy_check_mark: | N/A | +| `data` | [Components\Subscription](../../Models/Components/Subscription.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/WebhookSubscriptionActivePayloadType.md b/docs/Models/Components/WebhookSubscriptionActivePayloadType.md deleted file mode 100644 index 731d2c5..0000000 --- a/docs/Models/Components/WebhookSubscriptionActivePayloadType.md +++ /dev/null @@ -1,8 +0,0 @@ -# WebhookSubscriptionActivePayloadType - - -## Values - -| Name | Value | -| -------------------- | -------------------- | -| `SubscriptionActive` | subscription.active | \ No newline at end of file diff --git a/docs/Models/Components/WebhookSubscriptionCanceledPayload.md b/docs/Models/Components/WebhookSubscriptionCanceledPayload.md index 2e2a9e4..81367f1 100644 --- a/docs/Models/Components/WebhookSubscriptionCanceledPayload.md +++ b/docs/Models/Components/WebhookSubscriptionCanceledPayload.md @@ -1,14 +1,14 @@ # WebhookSubscriptionCanceledPayload -Sent when a subscription is canceled by the user. -They might still have access until the end of the current period. +Sent when a subscription is canceled. +Customers might still have access until the end of the current period. **Discord & Slack support:** Full ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -| `type` | [Components\WebhookSubscriptionCanceledPayloadType](../../Models/Components/WebhookSubscriptionCanceledPayloadType.md) | :heavy_check_mark: | N/A | -| `data` | [Components\Subscription](../../Models/Components/Subscription.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `type` | *string* | :heavy_check_mark: | N/A | +| `data` | [Components\Subscription](../../Models/Components/Subscription.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/WebhookSubscriptionCanceledPayloadType.md b/docs/Models/Components/WebhookSubscriptionCanceledPayloadType.md deleted file mode 100644 index 845d3c2..0000000 --- a/docs/Models/Components/WebhookSubscriptionCanceledPayloadType.md +++ /dev/null @@ -1,8 +0,0 @@ -# WebhookSubscriptionCanceledPayloadType - - -## Values - -| Name | Value | -| ---------------------- | ---------------------- | -| `SubscriptionCanceled` | subscription.canceled | \ No newline at end of file diff --git a/docs/Models/Components/WebhookSubscriptionCreatedPayload.md b/docs/Models/Components/WebhookSubscriptionCreatedPayload.md index 614f2d6..5ab3ad9 100644 --- a/docs/Models/Components/WebhookSubscriptionCreatedPayload.md +++ b/docs/Models/Components/WebhookSubscriptionCreatedPayload.md @@ -7,7 +7,7 @@ Sent when a new subscription is created. ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `type` | [Components\WebhookSubscriptionCreatedPayloadType](../../Models/Components/WebhookSubscriptionCreatedPayloadType.md) | :heavy_check_mark: | N/A | -| `data` | [Components\Subscription](../../Models/Components/Subscription.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `type` | *string* | :heavy_check_mark: | N/A | +| `data` | [Components\Subscription](../../Models/Components/Subscription.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/WebhookSubscriptionCreatedPayloadType.md b/docs/Models/Components/WebhookSubscriptionCreatedPayloadType.md deleted file mode 100644 index 5d55c4f..0000000 --- a/docs/Models/Components/WebhookSubscriptionCreatedPayloadType.md +++ /dev/null @@ -1,8 +0,0 @@ -# WebhookSubscriptionCreatedPayloadType - - -## Values - -| Name | Value | -| --------------------- | --------------------- | -| `SubscriptionCreated` | subscription.created | \ No newline at end of file diff --git a/docs/Models/Components/WebhookSubscriptionRevokedPayload.md b/docs/Models/Components/WebhookSubscriptionRevokedPayload.md index 1fb2d7f..e7b11f6 100644 --- a/docs/Models/Components/WebhookSubscriptionRevokedPayload.md +++ b/docs/Models/Components/WebhookSubscriptionRevokedPayload.md @@ -8,7 +8,7 @@ Happens when the subscription is canceled, or payment is past due. ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `type` | [Components\WebhookSubscriptionRevokedPayloadType](../../Models/Components/WebhookSubscriptionRevokedPayloadType.md) | :heavy_check_mark: | N/A | -| `data` | [Components\Subscription](../../Models/Components/Subscription.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `type` | *string* | :heavy_check_mark: | N/A | +| `data` | [Components\Subscription](../../Models/Components/Subscription.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/WebhookSubscriptionRevokedPayloadType.md b/docs/Models/Components/WebhookSubscriptionRevokedPayloadType.md deleted file mode 100644 index bbe5895..0000000 --- a/docs/Models/Components/WebhookSubscriptionRevokedPayloadType.md +++ /dev/null @@ -1,8 +0,0 @@ -# WebhookSubscriptionRevokedPayloadType - - -## Values - -| Name | Value | -| --------------------- | --------------------- | -| `SubscriptionRevoked` | subscription.revoked | \ No newline at end of file diff --git a/docs/Models/Components/WebhookSubscriptionUncanceledPayload.md b/docs/Models/Components/WebhookSubscriptionUncanceledPayload.md new file mode 100644 index 0000000..92138c0 --- /dev/null +++ b/docs/Models/Components/WebhookSubscriptionUncanceledPayload.md @@ -0,0 +1,13 @@ +# WebhookSubscriptionUncanceledPayload + +Sent when a subscription is uncanceled. + +**Discord & Slack support:** Full + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `type` | *string* | :heavy_check_mark: | N/A | +| `data` | [Components\Subscription](../../Models/Components/Subscription.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/WebhookSubscriptionUpdatedPayload.md b/docs/Models/Components/WebhookSubscriptionUpdatedPayload.md index b66a6eb..f8207a5 100644 --- a/docs/Models/Components/WebhookSubscriptionUpdatedPayload.md +++ b/docs/Models/Components/WebhookSubscriptionUpdatedPayload.md @@ -11,7 +11,7 @@ To listen specifically for renewals, you can listen to `order.created` events an ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `type` | [Components\WebhookSubscriptionUpdatedPayloadType](../../Models/Components/WebhookSubscriptionUpdatedPayloadType.md) | :heavy_check_mark: | N/A | -| `data` | [Components\Subscription](../../Models/Components/Subscription.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `type` | *string* | :heavy_check_mark: | N/A | +| `data` | [Components\Subscription](../../Models/Components/Subscription.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/WebhookSubscriptionUpdatedPayloadType.md b/docs/Models/Components/WebhookSubscriptionUpdatedPayloadType.md deleted file mode 100644 index 072f5a2..0000000 --- a/docs/Models/Components/WebhookSubscriptionUpdatedPayloadType.md +++ /dev/null @@ -1,8 +0,0 @@ -# WebhookSubscriptionUpdatedPayloadType - - -## Values - -| Name | Value | -| --------------------- | --------------------- | -| `SubscriptionUpdated` | subscription.updated | \ No newline at end of file diff --git a/docs/Models/Errors/AlreadyActiveSubscriptionError.md b/docs/Models/Errors/AlreadyActiveSubscriptionError.md new file mode 100644 index 0000000..527668e --- /dev/null +++ b/docs/Models/Errors/AlreadyActiveSubscriptionError.md @@ -0,0 +1,9 @@ +# AlreadyActiveSubscriptionError + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `error` | *string* | :heavy_check_mark: | N/A | +| `detail` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Errors/AlreadyCanceledSubscription.md b/docs/Models/Errors/AlreadyCanceledSubscription.md index 7963760..1344bda 100644 --- a/docs/Models/Errors/AlreadyCanceledSubscription.md +++ b/docs/Models/Errors/AlreadyCanceledSubscription.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `error` | [Errors\AlreadyCanceledSubscriptionError](../../Models/Errors/AlreadyCanceledSubscriptionError.md) | :heavy_check_mark: | N/A | -| `detail` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `error` | *string* | :heavy_check_mark: | N/A | +| `detail` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Errors/AlreadyCanceledSubscriptionError.md b/docs/Models/Errors/AlreadyCanceledSubscriptionError.md deleted file mode 100644 index bb716c0..0000000 --- a/docs/Models/Errors/AlreadyCanceledSubscriptionError.md +++ /dev/null @@ -1,8 +0,0 @@ -# AlreadyCanceledSubscriptionError - - -## Values - -| Name | Value | -| ----------------------------- | ----------------------------- | -| `AlreadyCanceledSubscription` | AlreadyCanceledSubscription | \ No newline at end of file diff --git a/docs/Models/Errors/Error.md b/docs/Models/Errors/Error.md deleted file mode 100644 index d6d7b60..0000000 --- a/docs/Models/Errors/Error.md +++ /dev/null @@ -1,8 +0,0 @@ -# Error - - -## Values - -| Name | Value | -| ------------------ | ------------------ | -| `ResourceNotFound` | ResourceNotFound | \ No newline at end of file diff --git a/docs/Models/Errors/NotPermitted.md b/docs/Models/Errors/NotPermitted.md index b10301c..666d921 100644 --- a/docs/Models/Errors/NotPermitted.md +++ b/docs/Models/Errors/NotPermitted.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `error` | [Errors\NotPermittedError](../../Models/Errors/NotPermittedError.md) | :heavy_check_mark: | N/A | -| `detail` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `error` | *string* | :heavy_check_mark: | N/A | +| `detail` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Errors/NotPermittedError.md b/docs/Models/Errors/NotPermittedError.md deleted file mode 100644 index 7db6e3d..0000000 --- a/docs/Models/Errors/NotPermittedError.md +++ /dev/null @@ -1,8 +0,0 @@ -# NotPermittedError - - -## Values - -| Name | Value | -| -------------- | -------------- | -| `NotPermitted` | NotPermitted | \ No newline at end of file diff --git a/docs/Models/Errors/RefundAmountTooHigh.md b/docs/Models/Errors/RefundAmountTooHigh.md new file mode 100644 index 0000000..b2ef866 --- /dev/null +++ b/docs/Models/Errors/RefundAmountTooHigh.md @@ -0,0 +1,9 @@ +# RefundAmountTooHigh + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `error` | *string* | :heavy_check_mark: | N/A | +| `detail` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Errors/RefundedAlready.md b/docs/Models/Errors/RefundedAlready.md new file mode 100644 index 0000000..b1661d0 --- /dev/null +++ b/docs/Models/Errors/RefundedAlready.md @@ -0,0 +1,9 @@ +# RefundedAlready + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `error` | *string* | :heavy_check_mark: | N/A | +| `detail` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Errors/ResourceNotFound.md b/docs/Models/Errors/ResourceNotFound.md index efedd93..e3facb8 100644 --- a/docs/Models/Errors/ResourceNotFound.md +++ b/docs/Models/Errors/ResourceNotFound.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -| `error` | [Errors\Error](../../Models/Errors/Error.md) | :heavy_check_mark: | N/A | -| `detail` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `error` | *string* | :heavy_check_mark: | N/A | +| `detail` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Errors/Unauthorized.md b/docs/Models/Errors/Unauthorized.md index 97c6136..0b9f6bb 100644 --- a/docs/Models/Errors/Unauthorized.md +++ b/docs/Models/Errors/Unauthorized.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `error` | [Errors\UnauthorizedError](../../Models/Errors/UnauthorizedError.md) | :heavy_check_mark: | N/A | -| `detail` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `error` | *string* | :heavy_check_mark: | N/A | +| `detail` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Errors/UnauthorizedError.md b/docs/Models/Errors/UnauthorizedError.md deleted file mode 100644 index f45ff5d..0000000 --- a/docs/Models/Errors/UnauthorizedError.md +++ /dev/null @@ -1,8 +0,0 @@ -# UnauthorizedError - - -## Values - -| Name | Value | -| -------------- | -------------- | -| `Unauthorized` | Unauthorized | \ No newline at end of file diff --git a/docs/Models/Operations/CustomerPortalBenefitGrantsListRequest.md b/docs/Models/Operations/CustomerPortalBenefitGrantsListRequest.md index 4c0c0b0..19b9a20 100644 --- a/docs/Models/Operations/CustomerPortalBenefitGrantsListRequest.md +++ b/docs/Models/Operations/CustomerPortalBenefitGrantsListRequest.md @@ -11,6 +11,6 @@ | `benefitId` | [string\|array\|null](../../Models/Operations/CustomerPortalBenefitGrantsListQueryParamBenefitIDFilter.md) | :heavy_minus_sign: | Filter by benefit ID. | | `organizationId` | [string\|array\|null](../../Models/Operations/CustomerPortalBenefitGrantsListQueryParamOrganizationIDFilter.md) | :heavy_minus_sign: | Filter by organization ID. | | `checkoutId` | [string\|array\|null](../../Models/Operations/CheckoutIDFilter.md) | :heavy_minus_sign: | Filter by checkout ID. | -| `orderId` | [string\|array\|null](../../Models/Operations/OrderIDFilter.md) | :heavy_minus_sign: | Filter by order ID. | -| `subscriptionId` | [string\|array\|null](../../Models/Operations/SubscriptionIDFilter.md) | :heavy_minus_sign: | Filter by subscription ID. | +| `orderId` | [string\|array\|null](../../Models/Operations/QueryParamOrderIDFilter.md) | :heavy_minus_sign: | Filter by order ID. | +| `subscriptionId` | [string\|array\|null](../../Models/Operations/QueryParamSubscriptionIDFilter.md) | :heavy_minus_sign: | Filter by subscription ID. | | `sorting` | array<[Components\CustomerBenefitGrantSortProperty](../../Models/Components/CustomerBenefitGrantSortProperty.md)> | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | \ No newline at end of file diff --git a/docs/Models/Operations/CustomerPortalOrdersListQueryParamSubscriptionIDFilter.md b/docs/Models/Operations/CustomerPortalOrdersListQueryParamSubscriptionIDFilter.md new file mode 100644 index 0000000..d7e89cc --- /dev/null +++ b/docs/Models/Operations/CustomerPortalOrdersListQueryParamSubscriptionIDFilter.md @@ -0,0 +1,25 @@ +# CustomerPortalOrdersListQueryParamSubscriptionIDFilter + +Filter by subscription ID. + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `array` + +```php +/** +* @var array +*/ +array $value = /* values here */ +``` + diff --git a/docs/Models/Operations/CustomerPortalOrdersListRequest.md b/docs/Models/Operations/CustomerPortalOrdersListRequest.md index ed0b10e..ec6115c 100644 --- a/docs/Models/Operations/CustomerPortalOrdersListRequest.md +++ b/docs/Models/Operations/CustomerPortalOrdersListRequest.md @@ -10,6 +10,6 @@ | `organizationId` | [string\|array\|null](../../Models/Operations/CustomerPortalOrdersListQueryParamOrganizationIDFilter.md) | :heavy_minus_sign: | Filter by organization ID. | | `productId` | [string\|array\|null](../../Models/Operations/CustomerPortalOrdersListQueryParamProductIDFilter.md) | :heavy_minus_sign: | Filter by product ID. | | `productPriceType` | [Components\ProductPriceType\|array\|null](../../Models/Operations/CustomerPortalOrdersListQueryParamProductPriceTypeFilter.md) | :heavy_minus_sign: | Filter by product price type. `recurring` will return orders corresponding to subscriptions creations or renewals. `one_time` will return orders corresponding to one-time purchases. | -| `subscriptionId` | [string\|array\|null](../../Models/Operations/QueryParamSubscriptionIDFilter.md) | :heavy_minus_sign: | Filter by subscription ID. | +| `subscriptionId` | [string\|array\|null](../../Models/Operations/CustomerPortalOrdersListQueryParamSubscriptionIDFilter.md) | :heavy_minus_sign: | Filter by subscription ID. | | `query` | *?string* | :heavy_minus_sign: | Search by product or organization name. | | `sorting` | array<[Components\CustomerOrderSortProperty](../../Models/Components/CustomerOrderSortProperty.md)> | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | \ No newline at end of file diff --git a/docs/Models/Operations/CustomerPortalSubscriptionsCancelResponse.md b/docs/Models/Operations/CustomerPortalSubscriptionsCancelResponse.md index 74a00bd..82136a9 100644 --- a/docs/Models/Operations/CustomerPortalSubscriptionsCancelResponse.md +++ b/docs/Models/Operations/CustomerPortalSubscriptionsCancelResponse.md @@ -8,4 +8,4 @@ | `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `customerSubscription` | [?Components\CustomerSubscription](../../Models/Components/CustomerSubscription.md) | :heavy_minus_sign: | Subscription canceled. | \ No newline at end of file +| `customerSubscription` | [?Components\CustomerSubscription](../../Models/Components/CustomerSubscription.md) | :heavy_minus_sign: | Customer subscription is canceled. | \ No newline at end of file diff --git a/docs/Models/Operations/CustomerPortalSubscriptionsUpdateRequest.md b/docs/Models/Operations/CustomerPortalSubscriptionsUpdateRequest.md index 2e0f556..319c281 100644 --- a/docs/Models/Operations/CustomerPortalSubscriptionsUpdateRequest.md +++ b/docs/Models/Operations/CustomerPortalSubscriptionsUpdateRequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The subscription ID. | -| `customerSubscriptionUpdate` | [Components\CustomerSubscriptionUpdate](../../Models/Components/CustomerSubscriptionUpdate.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The subscription ID. | +| `customerSubscriptionUpdate` | [Components\CustomerSubscriptionUpdatePrice\|Components\CustomerSubscriptionCancel](../../Models/Components/CustomerSubscriptionUpdate.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/CustomerPortalSubscriptionsUpdateResponse.md b/docs/Models/Operations/CustomerPortalSubscriptionsUpdateResponse.md index f407c9f..8fbc1ae 100644 --- a/docs/Models/Operations/CustomerPortalSubscriptionsUpdateResponse.md +++ b/docs/Models/Operations/CustomerPortalSubscriptionsUpdateResponse.md @@ -8,4 +8,4 @@ | `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `customerSubscription` | [?Components\CustomerSubscription](../../Models/Components/CustomerSubscription.md) | :heavy_minus_sign: | Subscription updated. | \ No newline at end of file +| `customerSubscription` | [?Components\CustomerSubscription](../../Models/Components/CustomerSubscription.md) | :heavy_minus_sign: | Customer subscription updated. | \ No newline at end of file diff --git a/docs/Models/Operations/CustomersListRequest.md b/docs/Models/Operations/CustomersListRequest.md index 2f8a8ae..461c8a2 100644 --- a/docs/Models/Operations/CustomersListRequest.md +++ b/docs/Models/Operations/CustomersListRequest.md @@ -8,5 +8,7 @@ | `page` | *?int* | :heavy_minus_sign: | Page number, defaults to 1. | | `limit` | *?int* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | | `organizationId` | [string\|array\|null](../../Models/Operations/CustomersListQueryParamOrganizationIDFilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `email` | *?string* | :heavy_minus_sign: | Filter by exact email. | | `query` | *?string* | :heavy_minus_sign: | Filter by name or email. | -| `sorting` | array<[Components\CustomerSortProperty](../../Models/Components/CustomerSortProperty.md)> | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | \ No newline at end of file +| `sorting` | array<[Components\CustomerSortProperty](../../Models/Components/CustomerSortProperty.md)> | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `metadata` | array | :heavy_minus_sign: | Filter by metadata key-value pairs. It uses the `deepObject` style, e.g. `?metadata[key]=value`. | \ No newline at end of file diff --git a/docs/Models/Operations/EventsGetRequest.md b/docs/Models/Operations/EventsGetRequest.md new file mode 100644 index 0000000..6862789 --- /dev/null +++ b/docs/Models/Operations/EventsGetRequest.md @@ -0,0 +1,8 @@ +# EventsGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *string* | :heavy_check_mark: | The event ID. | \ No newline at end of file diff --git a/docs/Models/Operations/EventsGetResponse.md b/docs/Models/Operations/EventsGetResponse.md new file mode 100644 index 0000000..1c5c8b6 --- /dev/null +++ b/docs/Models/Operations/EventsGetResponse.md @@ -0,0 +1,11 @@ +# EventsGetResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `event` | [?Components\Event](../../Models/Components/Event.md) | :heavy_minus_sign: | Successful Response | \ No newline at end of file diff --git a/docs/Models/Operations/EventsIngestResponse.md b/docs/Models/Operations/EventsIngestResponse.md new file mode 100644 index 0000000..f59c7c9 --- /dev/null +++ b/docs/Models/Operations/EventsIngestResponse.md @@ -0,0 +1,11 @@ +# EventsIngestResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `eventsIngestResponse` | [?Components\EventsIngestResponse](../../Models/Components/EventsIngestResponse.md) | :heavy_minus_sign: | Successful Response | \ No newline at end of file diff --git a/docs/Models/Operations/EventsListQueryParamCustomerIDFilter.md b/docs/Models/Operations/EventsListQueryParamCustomerIDFilter.md new file mode 100644 index 0000000..297a201 --- /dev/null +++ b/docs/Models/Operations/EventsListQueryParamCustomerIDFilter.md @@ -0,0 +1,25 @@ +# EventsListQueryParamCustomerIDFilter + +Filter by customer ID. + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `array` + +```php +/** +* @var array +*/ +array $value = /* values here */ +``` + diff --git a/docs/Models/Operations/EventsListQueryParamOrganizationIDFilter.md b/docs/Models/Operations/EventsListQueryParamOrganizationIDFilter.md new file mode 100644 index 0000000..97f9845 --- /dev/null +++ b/docs/Models/Operations/EventsListQueryParamOrganizationIDFilter.md @@ -0,0 +1,25 @@ +# EventsListQueryParamOrganizationIDFilter + +Filter by organization ID. + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `array` + +```php +/** +* @var array +*/ +array $value = /* values here */ +``` + diff --git a/docs/Models/Operations/EventsListRequest.md b/docs/Models/Operations/EventsListRequest.md new file mode 100644 index 0000000..9bf438b --- /dev/null +++ b/docs/Models/Operations/EventsListRequest.md @@ -0,0 +1,17 @@ +# EventsListRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `page` | *?int* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *?int* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `startTimestamp` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Filter events after this timestamp. | +| `endTimestamp` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | Filter events before this timestamp. | +| `organizationId` | [string\|array\|null](../../Models/Operations/EventsListQueryParamOrganizationIDFilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `customerId` | [string\|array\|null](../../Models/Operations/EventsListQueryParamCustomerIDFilter.md) | :heavy_minus_sign: | Filter by customer ID. | +| `externalCustomerId` | [string\|array\|null](../../Models/Operations/ExternalCustomerIDFilter.md) | :heavy_minus_sign: | Filter by external customer ID. | +| `source` | [Components\EventSource\|array\|null](../../Models/Operations/SourceFilter.md) | :heavy_minus_sign: | Filter by event source. | +| `sorting` | array<[Components\EventSortProperty](../../Models/Components/EventSortProperty.md)> | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `metadata` | array | :heavy_minus_sign: | Filter by metadata key-value pairs. It uses the `deepObject` style, e.g. `?metadata[key]=value`. | \ No newline at end of file diff --git a/docs/Models/Operations/EventsListResponse.md b/docs/Models/Operations/EventsListResponse.md new file mode 100644 index 0000000..17a0793 --- /dev/null +++ b/docs/Models/Operations/EventsListResponse.md @@ -0,0 +1,11 @@ +# EventsListResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `listResourceEvent` | [?Components\ListResourceEvent](../../Models/Components/ListResourceEvent.md) | :heavy_minus_sign: | Successful Response | \ No newline at end of file diff --git a/docs/Models/Operations/ExternalCustomerIDFilter.md b/docs/Models/Operations/ExternalCustomerIDFilter.md new file mode 100644 index 0000000..25f4919 --- /dev/null +++ b/docs/Models/Operations/ExternalCustomerIDFilter.md @@ -0,0 +1,25 @@ +# ExternalCustomerIDFilter + +Filter by external customer ID. + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `array` + +```php +/** +* @var array +*/ +array $value = /* values here */ +``` + diff --git a/docs/Models/Operations/MetersCreateResponse.md b/docs/Models/Operations/MetersCreateResponse.md new file mode 100644 index 0000000..006d68d --- /dev/null +++ b/docs/Models/Operations/MetersCreateResponse.md @@ -0,0 +1,11 @@ +# MetersCreateResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `meter` | [?Components\Meter](../../Models/Components/Meter.md) | :heavy_minus_sign: | Meter created. | \ No newline at end of file diff --git a/docs/Models/Operations/MetersEventsRequest.md b/docs/Models/Operations/MetersEventsRequest.md new file mode 100644 index 0000000..d2c2374 --- /dev/null +++ b/docs/Models/Operations/MetersEventsRequest.md @@ -0,0 +1,10 @@ +# MetersEventsRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The meter ID. | +| `page` | *?int* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *?int* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | \ No newline at end of file diff --git a/docs/Models/Operations/MetersEventsResponse.md b/docs/Models/Operations/MetersEventsResponse.md new file mode 100644 index 0000000..e345057 --- /dev/null +++ b/docs/Models/Operations/MetersEventsResponse.md @@ -0,0 +1,11 @@ +# MetersEventsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `listResourceEvent` | [?Components\ListResourceEvent](../../Models/Components/ListResourceEvent.md) | :heavy_minus_sign: | Successful Response | \ No newline at end of file diff --git a/docs/Models/Operations/MetersGetRequest.md b/docs/Models/Operations/MetersGetRequest.md new file mode 100644 index 0000000..1db246a --- /dev/null +++ b/docs/Models/Operations/MetersGetRequest.md @@ -0,0 +1,8 @@ +# MetersGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *string* | :heavy_check_mark: | The meter ID. | \ No newline at end of file diff --git a/docs/Models/Operations/MetersGetResponse.md b/docs/Models/Operations/MetersGetResponse.md new file mode 100644 index 0000000..b4321cd --- /dev/null +++ b/docs/Models/Operations/MetersGetResponse.md @@ -0,0 +1,11 @@ +# MetersGetResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `meter` | [?Components\Meter](../../Models/Components/Meter.md) | :heavy_minus_sign: | Successful Response | \ No newline at end of file diff --git a/docs/Models/Operations/MetersListQueryParamOrganizationIDFilter.md b/docs/Models/Operations/MetersListQueryParamOrganizationIDFilter.md new file mode 100644 index 0000000..1d8c4c5 --- /dev/null +++ b/docs/Models/Operations/MetersListQueryParamOrganizationIDFilter.md @@ -0,0 +1,25 @@ +# MetersListQueryParamOrganizationIDFilter + +Filter by organization ID. + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `array` + +```php +/** +* @var array +*/ +array $value = /* values here */ +``` + diff --git a/docs/Models/Operations/MetersListRequest.md b/docs/Models/Operations/MetersListRequest.md new file mode 100644 index 0000000..5ea69b6 --- /dev/null +++ b/docs/Models/Operations/MetersListRequest.md @@ -0,0 +1,13 @@ +# MetersListRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `page` | *?int* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *?int* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `organizationId` | [string\|array\|null](../../Models/Operations/MetersListQueryParamOrganizationIDFilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `query` | *?string* | :heavy_minus_sign: | Filter by name. | +| `sorting` | array<[Components\MeterSortProperty](../../Models/Components/MeterSortProperty.md)> | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | +| `metadata` | array | :heavy_minus_sign: | Filter by metadata key-value pairs. It uses the `deepObject` style, e.g. `?metadata[key]=value`. | \ No newline at end of file diff --git a/docs/Models/Operations/MetersListResponse.md b/docs/Models/Operations/MetersListResponse.md new file mode 100644 index 0000000..2ca9135 --- /dev/null +++ b/docs/Models/Operations/MetersListResponse.md @@ -0,0 +1,11 @@ +# MetersListResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `listResourceMeter` | [?Components\ListResourceMeter](../../Models/Components/ListResourceMeter.md) | :heavy_minus_sign: | Successful Response | \ No newline at end of file diff --git a/docs/Models/Operations/MetersQuantitiesQueryParamCustomerIDFilter.md b/docs/Models/Operations/MetersQuantitiesQueryParamCustomerIDFilter.md new file mode 100644 index 0000000..fabaec4 --- /dev/null +++ b/docs/Models/Operations/MetersQuantitiesQueryParamCustomerIDFilter.md @@ -0,0 +1,25 @@ +# MetersQuantitiesQueryParamCustomerIDFilter + +Filter by customer ID. + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `array` + +```php +/** +* @var array +*/ +array $value = /* values here */ +``` + diff --git a/docs/Models/Operations/MetersQuantitiesRequest.md b/docs/Models/Operations/MetersQuantitiesRequest.md new file mode 100644 index 0000000..51996d1 --- /dev/null +++ b/docs/Models/Operations/MetersQuantitiesRequest.md @@ -0,0 +1,13 @@ +# MetersQuantitiesRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `id` | *string* | :heavy_check_mark: | The meter ID. | +| `startTimestamp` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Start timestamp. | +| `endTimestamp` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | End timestamp. | +| `interval` | [Components\TimeInterval](../../Models/Components/TimeInterval.md) | :heavy_check_mark: | Interval between two timestamps. | +| `customerId` | [string\|array\|null](../../Models/Operations/MetersQuantitiesQueryParamCustomerIDFilter.md) | :heavy_minus_sign: | Filter by customer ID. | +| `exernalCustomerId` | [string\|array\|null](../../Models/Operations/QueryParamExternalCustomerIDFilter.md) | :heavy_minus_sign: | Filter by external customer ID. | \ No newline at end of file diff --git a/docs/Models/Operations/MetersQuantitiesResponse.md b/docs/Models/Operations/MetersQuantitiesResponse.md new file mode 100644 index 0000000..5076753 --- /dev/null +++ b/docs/Models/Operations/MetersQuantitiesResponse.md @@ -0,0 +1,11 @@ +# MetersQuantitiesResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `meterQuantities` | [?Components\MeterQuantities](../../Models/Components/MeterQuantities.md) | :heavy_minus_sign: | Successful Response | \ No newline at end of file diff --git a/docs/Models/Operations/MetersUpdateRequest.md b/docs/Models/Operations/MetersUpdateRequest.md new file mode 100644 index 0000000..155dab5 --- /dev/null +++ b/docs/Models/Operations/MetersUpdateRequest.md @@ -0,0 +1,9 @@ +# MetersUpdateRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The meter ID. | +| `meterUpdate` | [Components\MeterUpdate](../../Models/Components/MeterUpdate.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/MetersUpdateResponse.md b/docs/Models/Operations/MetersUpdateResponse.md new file mode 100644 index 0000000..2cf9064 --- /dev/null +++ b/docs/Models/Operations/MetersUpdateResponse.md @@ -0,0 +1,11 @@ +# MetersUpdateResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `meter` | [?Components\Meter](../../Models/Components/Meter.md) | :heavy_minus_sign: | Meter updated. | \ No newline at end of file diff --git a/docs/Models/Operations/MetricsGetQueryParamCustomerIDFilter.md b/docs/Models/Operations/MetricsGetQueryParamCustomerIDFilter.md new file mode 100644 index 0000000..929d93a --- /dev/null +++ b/docs/Models/Operations/MetricsGetQueryParamCustomerIDFilter.md @@ -0,0 +1,25 @@ +# MetricsGetQueryParamCustomerIDFilter + +Filter by customer ID. + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `array` + +```php +/** +* @var array +*/ +array $value = /* values here */ +``` + diff --git a/docs/Models/Operations/MetricsGetRequest.md b/docs/Models/Operations/MetricsGetRequest.md index 80d0e2b..ba9a6bf 100644 --- a/docs/Models/Operations/MetricsGetRequest.md +++ b/docs/Models/Operations/MetricsGetRequest.md @@ -7,7 +7,8 @@ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `startDate` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | Start date. | | `endDate` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | End date. | -| `interval` | [Components\Interval](../../Models/Components/Interval.md) | :heavy_check_mark: | Interval between two timestamps. | +| `interval` | [Components\TimeInterval](../../Models/Components/TimeInterval.md) | :heavy_check_mark: | Interval between two timestamps. | | `organizationId` | [string\|array\|null](../../Models/Operations/MetricsGetQueryParamOrganizationIDFilter.md) | :heavy_minus_sign: | Filter by organization ID. | | `productId` | [string\|array\|null](../../Models/Operations/MetricsGetQueryParamProductIDFilter.md) | :heavy_minus_sign: | Filter by product ID. | -| `productPriceType` | [Components\ProductPriceType\|array\|null](../../Models/Operations/QueryParamProductPriceTypeFilter.md) | :heavy_minus_sign: | Filter by product price type. `recurring` will filter data corresponding to subscriptions creations or renewals. `one_time` will filter data corresponding to one-time purchases. | \ No newline at end of file +| `productPriceType` | [Components\ProductPriceType\|array\|null](../../Models/Operations/QueryParamProductPriceTypeFilter.md) | :heavy_minus_sign: | Filter by product price type. `recurring` will filter data corresponding to subscriptions creations or renewals. `one_time` will filter data corresponding to one-time purchases. | +| `customerId` | [string\|array\|null](../../Models/Operations/MetricsGetQueryParamCustomerIDFilter.md) | :heavy_minus_sign: | Filter by customer ID. | \ No newline at end of file diff --git a/docs/Models/Operations/OrdersListQueryParamProductIDFilter.md b/docs/Models/Operations/OrdersListQueryParamProductIDFilter.md new file mode 100644 index 0000000..7447221 --- /dev/null +++ b/docs/Models/Operations/OrdersListQueryParamProductIDFilter.md @@ -0,0 +1,25 @@ +# OrdersListQueryParamProductIDFilter + +Filter by product ID. + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `array` + +```php +/** +* @var array +*/ +array $value = /* values here */ +``` + diff --git a/docs/Models/Operations/OrdersListRequest.md b/docs/Models/Operations/OrdersListRequest.md index 3c648e8..fcf15db 100644 --- a/docs/Models/Operations/OrdersListRequest.md +++ b/docs/Models/Operations/OrdersListRequest.md @@ -8,7 +8,7 @@ | `page` | *?int* | :heavy_minus_sign: | Page number, defaults to 1. | | `limit` | *?int* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | | `organizationId` | [string\|array\|null](../../Models/Operations/OrdersListQueryParamOrganizationIDFilter.md) | :heavy_minus_sign: | Filter by organization ID. | -| `productId` | [string\|array\|null](../../Models/Operations/QueryParamProductIDFilter.md) | :heavy_minus_sign: | Filter by product ID. | +| `productId` | [string\|array\|null](../../Models/Operations/OrdersListQueryParamProductIDFilter.md) | :heavy_minus_sign: | Filter by product ID. | | `productPriceType` | [Components\ProductPriceType\|array\|null](../../Models/Operations/ProductPriceTypeFilter.md) | :heavy_minus_sign: | Filter by product price type. `recurring` will return orders corresponding to subscriptions creations or renewals. `one_time` will return orders corresponding to one-time purchases. | | `discountId` | [string\|array\|null](../../Models/Operations/QueryParamDiscountIDFilter.md) | :heavy_minus_sign: | Filter by discount ID. | | `customerId` | [string\|array\|null](../../Models/Operations/OrdersListQueryParamCustomerIDFilter.md) | :heavy_minus_sign: | Filter by customer ID. | diff --git a/docs/Models/Operations/ProductsListRequest.md b/docs/Models/Operations/ProductsListRequest.md index 4a65d16..3fb339c 100644 --- a/docs/Models/Operations/ProductsListRequest.md +++ b/docs/Models/Operations/ProductsListRequest.md @@ -7,6 +7,7 @@ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `page` | *?int* | :heavy_minus_sign: | Page number, defaults to 1. | | `limit` | *?int* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `id` | [string\|array\|null](../../Models/Operations/QueryParamProductIDFilter.md) | :heavy_minus_sign: | Filter by product ID. | | `organizationId` | [string\|array\|null](../../Models/Operations/ProductsListQueryParamOrganizationIDFilter.md) | :heavy_minus_sign: | Filter by organization ID. | | `query` | *?string* | :heavy_minus_sign: | Filter by product name. | | `isArchived` | *?bool* | :heavy_minus_sign: | Filter on archived products. | diff --git a/docs/Models/Operations/QueryParamExternalCustomerIDFilter.md b/docs/Models/Operations/QueryParamExternalCustomerIDFilter.md new file mode 100644 index 0000000..651ac7a --- /dev/null +++ b/docs/Models/Operations/QueryParamExternalCustomerIDFilter.md @@ -0,0 +1,25 @@ +# QueryParamExternalCustomerIDFilter + +Filter by external customer ID. + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `array` + +```php +/** +* @var array +*/ +array $value = /* values here */ +``` + diff --git a/docs/Models/Operations/QueryParamOrderIDFilter.md b/docs/Models/Operations/QueryParamOrderIDFilter.md new file mode 100644 index 0000000..c92d59b --- /dev/null +++ b/docs/Models/Operations/QueryParamOrderIDFilter.md @@ -0,0 +1,25 @@ +# QueryParamOrderIDFilter + +Filter by order ID. + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `array` + +```php +/** +* @var array +*/ +array $value = /* values here */ +``` + diff --git a/docs/Models/Operations/RefundIDFilter.md b/docs/Models/Operations/RefundIDFilter.md new file mode 100644 index 0000000..cdb0a72 --- /dev/null +++ b/docs/Models/Operations/RefundIDFilter.md @@ -0,0 +1,25 @@ +# RefundIDFilter + +Filter by refund ID. + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `array` + +```php +/** +* @var array +*/ +array $value = /* values here */ +``` + diff --git a/docs/Models/Operations/RefundsCreateResponse.md b/docs/Models/Operations/RefundsCreateResponse.md new file mode 100644 index 0000000..f81199b --- /dev/null +++ b/docs/Models/Operations/RefundsCreateResponse.md @@ -0,0 +1,11 @@ +# RefundsCreateResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `refund` | [?Components\Refund](../../Models/Components/Refund.md) | :heavy_minus_sign: | Successful Response | \ No newline at end of file diff --git a/docs/Models/Operations/RefundsListQueryParamCustomerIDFilter.md b/docs/Models/Operations/RefundsListQueryParamCustomerIDFilter.md new file mode 100644 index 0000000..1f6d92c --- /dev/null +++ b/docs/Models/Operations/RefundsListQueryParamCustomerIDFilter.md @@ -0,0 +1,25 @@ +# RefundsListQueryParamCustomerIDFilter + +Filter by customer ID. + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `array` + +```php +/** +* @var array +*/ +array $value = /* values here */ +``` + diff --git a/docs/Models/Operations/RefundsListQueryParamOrganizationIDFilter.md b/docs/Models/Operations/RefundsListQueryParamOrganizationIDFilter.md new file mode 100644 index 0000000..94130d1 --- /dev/null +++ b/docs/Models/Operations/RefundsListQueryParamOrganizationIDFilter.md @@ -0,0 +1,25 @@ +# RefundsListQueryParamOrganizationIDFilter + +Filter by organization ID. + + +## Supported Types + +### `string` + +```php +/** +* @var string +*/ +string $value = /* values here */ +``` + +### `array` + +```php +/** +* @var array +*/ +array $value = /* values here */ +``` + diff --git a/docs/Models/Operations/RefundsListRequest.md b/docs/Models/Operations/RefundsListRequest.md new file mode 100644 index 0000000..2e14c59 --- /dev/null +++ b/docs/Models/Operations/RefundsListRequest.md @@ -0,0 +1,16 @@ +# RefundsListRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `page` | *?int* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *?int* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | +| `id` | [string\|array\|null](../../Models/Operations/RefundIDFilter.md) | :heavy_minus_sign: | Filter by refund ID. | +| `organizationId` | [string\|array\|null](../../Models/Operations/RefundsListQueryParamOrganizationIDFilter.md) | :heavy_minus_sign: | Filter by organization ID. | +| `orderId` | [string\|array\|null](../../Models/Operations/OrderIDFilter.md) | :heavy_minus_sign: | Filter by order ID. | +| `subscriptionId` | [string\|array\|null](../../Models/Operations/SubscriptionIDFilter.md) | :heavy_minus_sign: | Filter by subscription ID. | +| `customerId` | [string\|array\|null](../../Models/Operations/RefundsListQueryParamCustomerIDFilter.md) | :heavy_minus_sign: | Filter by customer ID. | +| `succeeded` | *?bool* | :heavy_minus_sign: | Filter by `succeeded`. | +| `sorting` | array<[Components\RefundSortProperty](../../Models/Components/RefundSortProperty.md)> | :heavy_minus_sign: | Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. | \ No newline at end of file diff --git a/docs/Models/Operations/RefundsListResponse.md b/docs/Models/Operations/RefundsListResponse.md new file mode 100644 index 0000000..73b29d2 --- /dev/null +++ b/docs/Models/Operations/RefundsListResponse.md @@ -0,0 +1,11 @@ +# RefundsListResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `listResourceRefund` | [?Components\ListResourceRefund](../../Models/Components/ListResourceRefund.md) | :heavy_minus_sign: | Successful Response | \ No newline at end of file diff --git a/docs/Models/Operations/SourceFilter.md b/docs/Models/Operations/SourceFilter.md new file mode 100644 index 0000000..4b1a2ce --- /dev/null +++ b/docs/Models/Operations/SourceFilter.md @@ -0,0 +1,25 @@ +# SourceFilter + +Filter by event source. + + +## Supported Types + +### `Components\EventSource` + +```php +/** +* @var Components\EventSource +*/ +Components\EventSource $value = /* values here */ +``` + +### `array` + +```php +/** +* @var array +*/ +array $value = /* values here */ +``` + diff --git a/docs/Models/Operations/SubscriptionsGetRequest.md b/docs/Models/Operations/SubscriptionsGetRequest.md new file mode 100644 index 0000000..210686b --- /dev/null +++ b/docs/Models/Operations/SubscriptionsGetRequest.md @@ -0,0 +1,8 @@ +# SubscriptionsGetRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `id` | *string* | :heavy_check_mark: | The subscription ID. | \ No newline at end of file diff --git a/docs/Models/Operations/SubscriptionsGetResponse.md b/docs/Models/Operations/SubscriptionsGetResponse.md new file mode 100644 index 0000000..3046912 --- /dev/null +++ b/docs/Models/Operations/SubscriptionsGetResponse.md @@ -0,0 +1,11 @@ +# SubscriptionsGetResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `subscription` | [?Components\Subscription](../../Models/Components/Subscription.md) | :heavy_minus_sign: | Successful Response | \ No newline at end of file diff --git a/docs/Models/Operations/SubscriptionsRevokeRequest.md b/docs/Models/Operations/SubscriptionsRevokeRequest.md new file mode 100644 index 0000000..2984add --- /dev/null +++ b/docs/Models/Operations/SubscriptionsRevokeRequest.md @@ -0,0 +1,8 @@ +# SubscriptionsRevokeRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `id` | *string* | :heavy_check_mark: | The subscription ID. | \ No newline at end of file diff --git a/docs/Models/Operations/SubscriptionsRevokeResponse.md b/docs/Models/Operations/SubscriptionsRevokeResponse.md new file mode 100644 index 0000000..f4f87cd --- /dev/null +++ b/docs/Models/Operations/SubscriptionsRevokeResponse.md @@ -0,0 +1,11 @@ +# SubscriptionsRevokeResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `subscription` | [?Components\Subscription](../../Models/Components/Subscription.md) | :heavy_minus_sign: | Subscription revoked. | \ No newline at end of file diff --git a/docs/Models/Operations/SubscriptionsUpdateRequest.md b/docs/Models/Operations/SubscriptionsUpdateRequest.md new file mode 100644 index 0000000..9fcd2b7 --- /dev/null +++ b/docs/Models/Operations/SubscriptionsUpdateRequest.md @@ -0,0 +1,9 @@ +# SubscriptionsUpdateRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The subscription ID. | +| `subscriptionUpdate` | [Components\SubscriptionUpdatePrice\|Components\SubscriptionCancel](../../Models/Components/SubscriptionUpdate.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/SubscriptionsUpdateResponse.md b/docs/Models/Operations/SubscriptionsUpdateResponse.md new file mode 100644 index 0000000..e9f8c86 --- /dev/null +++ b/docs/Models/Operations/SubscriptionsUpdateResponse.md @@ -0,0 +1,11 @@ +# SubscriptionsUpdateResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `subscription` | [?Components\Subscription](../../Models/Components/Subscription.md) | :heavy_minus_sign: | Subscription updated. | \ No newline at end of file diff --git a/docs/Models/Webhooks/EndpointorderRefundedPostResponse.md b/docs/Models/Webhooks/EndpointorderRefundedPostResponse.md new file mode 100644 index 0000000..5fb7273 --- /dev/null +++ b/docs/Models/Webhooks/EndpointorderRefundedPostResponse.md @@ -0,0 +1,11 @@ +# EndpointorderRefundedPostResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `any` | *mixed* | :heavy_minus_sign: | Successful Response | \ No newline at end of file diff --git a/docs/Models/Webhooks/EndpointrefundCreatedPostResponse.md b/docs/Models/Webhooks/EndpointrefundCreatedPostResponse.md new file mode 100644 index 0000000..1bc5baa --- /dev/null +++ b/docs/Models/Webhooks/EndpointrefundCreatedPostResponse.md @@ -0,0 +1,11 @@ +# EndpointrefundCreatedPostResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `any` | *mixed* | :heavy_minus_sign: | Successful Response | \ No newline at end of file diff --git a/docs/Models/Webhooks/EndpointrefundUpdatedPostResponse.md b/docs/Models/Webhooks/EndpointrefundUpdatedPostResponse.md new file mode 100644 index 0000000..95e2815 --- /dev/null +++ b/docs/Models/Webhooks/EndpointrefundUpdatedPostResponse.md @@ -0,0 +1,11 @@ +# EndpointrefundUpdatedPostResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `any` | *mixed* | :heavy_minus_sign: | Successful Response | \ No newline at end of file diff --git a/docs/Models/Webhooks/EndpointsubscriptionUncanceledPostResponse.md b/docs/Models/Webhooks/EndpointsubscriptionUncanceledPostResponse.md new file mode 100644 index 0000000..8b430df --- /dev/null +++ b/docs/Models/Webhooks/EndpointsubscriptionUncanceledPostResponse.md @@ -0,0 +1,11 @@ +# EndpointsubscriptionUncanceledPostResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `any` | *mixed* | :heavy_minus_sign: | Successful Response | \ No newline at end of file diff --git a/docs/sdks/advertisements/README.md b/docs/sdks/advertisements/README.md index d5d2f26..586b4d5 100644 --- a/docs/sdks/advertisements/README.md +++ b/docs/sdks/advertisements/README.md @@ -21,9 +21,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -68,9 +70,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); diff --git a/docs/sdks/benefitgrants/README.md b/docs/sdks/benefitgrants/README.md index 5705cdd..8c03f19 100644 --- a/docs/sdks/benefitgrants/README.md +++ b/docs/sdks/benefitgrants/README.md @@ -22,9 +22,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -69,9 +71,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Operations; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Operations\CustomerPortalBenefitGrantsListRequest(); @@ -118,9 +122,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); diff --git a/docs/sdks/benefits/README.md b/docs/sdks/benefits/README.md index 3111fdb..197bdd9 100644 --- a/docs/sdks/benefits/README.md +++ b/docs/sdks/benefits/README.md @@ -26,9 +26,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Components\BenefitDiscordCreate( description: 'delightfully fumigate convection though zowie up bulky electronics', @@ -81,9 +83,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -128,9 +132,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -177,9 +183,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Operations; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Operations\BenefitsGrantsRequest( id: '', @@ -229,9 +237,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -289,9 +299,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); diff --git a/docs/sdks/checkoutlinks/README.md b/docs/sdks/checkoutlinks/README.md index 55c079f..636f3c6 100644 --- a/docs/sdks/checkoutlinks/README.md +++ b/docs/sdks/checkoutlinks/README.md @@ -25,9 +25,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Components\CheckoutLinkProductCreate( productId: '', @@ -72,9 +74,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -118,9 +122,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -165,9 +171,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Operations; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Operations\CheckoutLinksListRequest(); @@ -214,9 +222,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $checkoutLinkUpdate = new Components\CheckoutLinkUpdate(); diff --git a/docs/sdks/checkouts/README.md b/docs/sdks/checkouts/README.md index a237fdf..70acb1f 100644 --- a/docs/sdks/checkouts/README.md +++ b/docs/sdks/checkouts/README.md @@ -24,9 +24,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Components\CheckoutLegacyCreate( productPriceId: '', @@ -74,9 +76,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); diff --git a/docs/sdks/clients/README.md b/docs/sdks/clients/README.md index 618cffb..e03d438 100644 --- a/docs/sdks/clients/README.md +++ b/docs/sdks/clients/README.md @@ -24,9 +24,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -76,9 +78,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Components\OAuth2ClientConfiguration( redirectUris: [ @@ -126,9 +130,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -171,9 +177,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -217,9 +225,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $oAuth2ClientConfigurationUpdate = new Components\OAuth2ClientConfigurationUpdate( redirectUris: [ diff --git a/docs/sdks/custom/README.md b/docs/sdks/custom/README.md index 8cc1976..44fc428 100644 --- a/docs/sdks/custom/README.md +++ b/docs/sdks/custom/README.md @@ -29,9 +29,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $checkoutConfirmStripe = new Components\CheckoutConfirmStripe(); @@ -59,11 +61,12 @@ if ($response->checkoutPublicConfirmed !== null) { ### Errors -| Error Type | Status Code | Content Type | -| -------------------------- | -------------------------- | -------------------------- | -| Errors\ResourceNotFound | 404 | application/json | -| Errors\HTTPValidationError | 422 | application/json | -| Errors\APIException | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Errors\AlreadyActiveSubscriptionError | 403 | application/json | +| Errors\ResourceNotFound | 404 | application/json | +| Errors\HTTPValidationError | 422 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | ## clientGet @@ -78,9 +81,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -125,9 +130,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $checkoutUpdatePublic = new Components\CheckoutUpdatePublic(); @@ -155,11 +162,12 @@ if ($response->checkoutPublic !== null) { ### Errors -| Error Type | Status Code | Content Type | -| -------------------------- | -------------------------- | -------------------------- | -| Errors\ResourceNotFound | 404 | application/json | -| Errors\HTTPValidationError | 422 | application/json | -| Errors\APIException | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Errors\AlreadyActiveSubscriptionError | 403 | application/json | +| Errors\ResourceNotFound | 404 | application/json | +| Errors\HTTPValidationError | 422 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | ## create @@ -175,9 +183,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Components\CheckoutProductCreate( productId: '', @@ -222,9 +232,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -269,9 +281,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Operations; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Operations\CheckoutsCustomListRequest(); @@ -318,9 +332,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $checkoutUpdate = new Components\CheckoutUpdate(); @@ -348,8 +364,9 @@ if ($response->checkout !== null) { ### Errors -| Error Type | Status Code | Content Type | -| -------------------------- | -------------------------- | -------------------------- | -| Errors\ResourceNotFound | 404 | application/json | -| Errors\HTTPValidationError | 422 | application/json | -| Errors\APIException | 4XX, 5XX | \*/\* | \ No newline at end of file +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Errors\AlreadyActiveSubscriptionError | 403 | application/json | +| Errors\ResourceNotFound | 404 | application/json | +| Errors\HTTPValidationError | 422 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/customers/README.md b/docs/sdks/customers/README.md index 620887d..4a09935 100644 --- a/docs/sdks/customers/README.md +++ b/docs/sdks/customers/README.md @@ -25,9 +25,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Components\CustomerCreate( email: 'Loyal79@yahoo.com', @@ -74,9 +76,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -120,9 +124,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -167,9 +173,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Operations; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Operations\CustomersListRequest(); @@ -216,9 +224,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $customerUpdate = new Components\CustomerUpdate(); diff --git a/docs/sdks/customersessions/README.md b/docs/sdks/customersessions/README.md index 707a9e8..7a68afe 100644 --- a/docs/sdks/customersessions/README.md +++ b/docs/sdks/customersessions/README.md @@ -21,9 +21,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Components\CustomerSessionCreate( customerId: '', diff --git a/docs/sdks/customfields/README.md b/docs/sdks/customfields/README.md index 0a0b29a..46ef2b5 100644 --- a/docs/sdks/customfields/README.md +++ b/docs/sdks/customfields/README.md @@ -25,9 +25,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Components\CustomFieldCreateNumber( slug: '', @@ -74,9 +76,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -120,9 +124,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -167,9 +173,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Operations; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Operations\CustomFieldsListRequest(); @@ -216,9 +224,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); diff --git a/docs/sdks/discounts/README.md b/docs/sdks/discounts/README.md index 39be599..7f9d7e0 100644 --- a/docs/sdks/discounts/README.md +++ b/docs/sdks/discounts/README.md @@ -25,9 +25,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Components\DiscountFixedRepeatDurationCreate( duration: Components\DiscountDuration::Forever, @@ -76,9 +78,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -122,9 +126,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -169,9 +175,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Operations; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Operations\DiscountsListRequest(); @@ -218,9 +226,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $discountUpdate = new Components\DiscountUpdate(); diff --git a/docs/sdks/downloadables/README.md b/docs/sdks/downloadables/README.md index 14afc25..f6cba45 100644 --- a/docs/sdks/downloadables/README.md +++ b/docs/sdks/downloadables/README.md @@ -21,9 +21,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -66,9 +68,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); diff --git a/docs/sdks/events/README.md b/docs/sdks/events/README.md new file mode 100644 index 0000000..a4ca2cc --- /dev/null +++ b/docs/sdks/events/README.md @@ -0,0 +1,164 @@ +# Events +(*events*) + +## Overview + +### Available Operations + +* [get](#get) - Get Event +* [ingest](#ingest) - Ingest Events +* [list](#list) - List Events + +## get + +Get an event by ID. + +### Example Usage + +```php +declare(strict_types=1); + +require 'vendor/autoload.php'; + +use Polar; + +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); + + + +$response = $sdk->events->get( + id: '' +); + +if ($response->event !== null) { + // handle response +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *string* | :heavy_check_mark: | The event ID. | + +### Response + +**[?Operations\EventsGetResponse](../../Models/Operations/EventsGetResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| Errors\ResourceNotFound | 404 | application/json | +| Errors\HTTPValidationError | 422 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | + +## ingest + +Ingest batch of events. + +### Example Usage + +```php +declare(strict_types=1); + +require 'vendor/autoload.php'; + +use Polar; +use Polar\Models\Components; + +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); + +$request = new Components\EventsIngest( + events: [ + new Components\EventCreateExternalCustomer( + name: '', + externalCustomerId: '', + ), + ], +); + +$response = $sdk->events->ingest( + request: $request +); + +if ($response->eventsIngestResponse !== null) { + // handle response +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `$request` | [Components\EventsIngest](../../Models/Components/EventsIngest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[?Operations\EventsIngestResponse](../../Models/Operations/EventsIngestResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| Errors\HTTPValidationError | 422 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | + +## list + +List events. + +### Example Usage + +```php +declare(strict_types=1); + +require 'vendor/autoload.php'; + +use Polar; +use Polar\Models\Operations; + +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); + +$request = new Operations\EventsListRequest(); + +$responses = $sdk->events->list( + request: $request +); + + +foreach ($responses as $response) { + if ($response->statusCode === 200) { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `$request` | [Operations\EventsListRequest](../../Models/Operations/EventsListRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[?Operations\EventsListResponse](../../Models/Operations/EventsListResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| Errors\HTTPValidationError | 422 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/externalorganizations/README.md b/docs/sdks/externalorganizations/README.md index fe1242f..aaadeb2 100644 --- a/docs/sdks/externalorganizations/README.md +++ b/docs/sdks/externalorganizations/README.md @@ -21,9 +21,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Operations; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Operations\ExternalOrganizationsListRequest(); diff --git a/docs/sdks/files/README.md b/docs/sdks/files/README.md index 8732e1d..10b2948 100644 --- a/docs/sdks/files/README.md +++ b/docs/sdks/files/README.md @@ -25,9 +25,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Components\OrganizationAvatarFileCreate( name: '', @@ -83,9 +85,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -130,9 +134,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -188,9 +194,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $filePatch = new Components\FilePatch(); @@ -239,9 +247,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $fileUploadCompleted = new Components\FileUploadCompleted( id: '', diff --git a/docs/sdks/licensekeys/README.md b/docs/sdks/licensekeys/README.md index edca73d..31d6ea1 100644 --- a/docs/sdks/licensekeys/README.md +++ b/docs/sdks/licensekeys/README.md @@ -23,9 +23,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -70,9 +72,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -120,9 +124,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -182,9 +188,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $licenseKeyUpdate = new Components\LicenseKeyUpdate(); diff --git a/docs/sdks/meters/README.md b/docs/sdks/meters/README.md new file mode 100644 index 0000000..53270fc --- /dev/null +++ b/docs/sdks/meters/README.md @@ -0,0 +1,336 @@ +# Meters +(*meters*) + +## Overview + +### Available Operations + +* [create](#create) - Create Meter +* [events](#events) - Get Meter Events +* [get](#get) - Get Meter +* [list](#list) - List Meters +* [quantities](#quantities) - Get Meter Quantities +* [update](#update) - Update Meter + +## create + +Create a meter. + +### Example Usage + +```php +declare(strict_types=1); + +require 'vendor/autoload.php'; + +use Polar; +use Polar\Models\Components; + +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); + +$request = new Components\MeterCreate( + name: '', + filter: new Components\Filter( + conjunction: Components\FilterConjunction::And, + clauses: [ + + ], + ), + aggregation: new Components\PropertyAggregation( + func: Components\Func::Max, + property: '', + ), +); + +$response = $sdk->meters->create( + request: $request +); + +if ($response->meter !== null) { + // handle response +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `$request` | [Components\MeterCreate](../../Models/Components/MeterCreate.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[?Operations\MetersCreateResponse](../../Models/Operations/MetersCreateResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| Errors\HTTPValidationError | 422 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | + +## events + +Get events matching the filter of a meter. + +### Example Usage + +```php +declare(strict_types=1); + +require 'vendor/autoload.php'; + +use Polar; + +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); + + + +$responses = $sdk->meters->events( + id: '', + page: 1, + limit: 10 + +); + + +foreach ($responses as $response) { + if ($response->statusCode === 200) { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The meter ID. | +| `page` | *?int* | :heavy_minus_sign: | Page number, defaults to 1. | +| `limit` | *?int* | :heavy_minus_sign: | Size of a page, defaults to 10. Maximum is 100. | + +### Response + +**[?Operations\MetersEventsResponse](../../Models/Operations/MetersEventsResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| Errors\ResourceNotFound | 404 | application/json | +| Errors\HTTPValidationError | 422 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | + +## get + +Get a meter by ID. + +### Example Usage + +```php +declare(strict_types=1); + +require 'vendor/autoload.php'; + +use Polar; + +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); + + + +$response = $sdk->meters->get( + id: '' +); + +if ($response->meter !== null) { + // handle response +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *string* | :heavy_check_mark: | The meter ID. | + +### Response + +**[?Operations\MetersGetResponse](../../Models/Operations/MetersGetResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| Errors\ResourceNotFound | 404 | application/json | +| Errors\HTTPValidationError | 422 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | + +## list + +List meters. + +### Example Usage + +```php +declare(strict_types=1); + +require 'vendor/autoload.php'; + +use Polar; +use Polar\Models\Operations; + +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); + +$request = new Operations\MetersListRequest(); + +$responses = $sdk->meters->list( + request: $request +); + + +foreach ($responses as $response) { + if ($response->statusCode === 200) { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `$request` | [Operations\MetersListRequest](../../Models/Operations/MetersListRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[?Operations\MetersListResponse](../../Models/Operations/MetersListResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| Errors\HTTPValidationError | 422 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | + +## quantities + +Get quantities of a meter over a time period. + +### Example Usage + +```php +declare(strict_types=1); + +require 'vendor/autoload.php'; + +use Polar; +use Polar\Models\Components; +use Polar\Models\Operations; +use Polar\Utils; + +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); + +$request = new Operations\MetersQuantitiesRequest( + id: '', + startTimestamp: Utils\Utils::parseDateTime('2023-09-17T00:45:34.608Z'), + endTimestamp: Utils\Utils::parseDateTime('2023-07-21T18:11:39.069Z'), + interval: Components\TimeInterval::Hour, +); + +$response = $sdk->meters->quantities( + request: $request +); + +if ($response->meterQuantities !== null) { + // handle response +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `$request` | [Operations\MetersQuantitiesRequest](../../Models/Operations/MetersQuantitiesRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[?Operations\MetersQuantitiesResponse](../../Models/Operations/MetersQuantitiesResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| Errors\ResourceNotFound | 404 | application/json | +| Errors\HTTPValidationError | 422 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | + +## update + +Update a meter. + +### Example Usage + +```php +declare(strict_types=1); + +require 'vendor/autoload.php'; + +use Polar; +use Polar\Models\Components; + +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); + +$meterUpdate = new Components\MeterUpdate(); + +$response = $sdk->meters->update( + id: '', + meterUpdate: $meterUpdate + +); + +if ($response->meter !== null) { + // handle response +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The meter ID. | +| `meterUpdate` | [Components\MeterUpdate](../../Models/Components/MeterUpdate.md) | :heavy_check_mark: | N/A | + +### Response + +**[?Operations\MetersUpdateResponse](../../Models/Operations/MetersUpdateResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| Errors\ResourceNotFound | 404 | application/json | +| Errors\HTTPValidationError | 422 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/metrics/README.md b/docs/sdks/metrics/README.md index 90f2049..0cf12e9 100644 --- a/docs/sdks/metrics/README.md +++ b/docs/sdks/metrics/README.md @@ -24,14 +24,16 @@ use Polar; use Polar\Models\Components; use Polar\Models\Operations; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Operations\MetricsGetRequest( - startDate: LocalDate::parse('2024-02-07'), - endDate: LocalDate::parse('2023-09-05'), - interval: Components\Interval::Week, + startDate: LocalDate::parse('2025-02-06'), + endDate: LocalDate::parse('2024-09-04'), + interval: Components\TimeInterval::Week, ); $response = $sdk->metrics->get( @@ -73,9 +75,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); diff --git a/docs/sdks/oauth2/README.md b/docs/sdks/oauth2/README.md index 3253abc..705224b 100644 --- a/docs/sdks/oauth2/README.md +++ b/docs/sdks/oauth2/README.md @@ -24,9 +24,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -63,9 +65,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Operations; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Operations\Oauth2IntrospectTokenIntrospectTokenRequest( token: '', @@ -112,9 +116,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Components\Onev11oauth21tokenPostXComponentsAuthorizationCodeTokenRequest( clientId: '', @@ -162,9 +168,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Operations; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Operations\Oauth2RevokeTokenRevokeTokenRequest( token: '', @@ -210,9 +218,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); diff --git a/docs/sdks/orders/README.md b/docs/sdks/orders/README.md index 67dd8e3..5aba15e 100644 --- a/docs/sdks/orders/README.md +++ b/docs/sdks/orders/README.md @@ -22,9 +22,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -68,9 +70,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -115,9 +119,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Operations; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Operations\OrdersListRequest(); diff --git a/docs/sdks/organizations/README.md b/docs/sdks/organizations/README.md index 6e98cdd..b710293 100644 --- a/docs/sdks/organizations/README.md +++ b/docs/sdks/organizations/README.md @@ -24,9 +24,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Components\OrganizationCreate( name: '', @@ -72,9 +74,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -119,9 +123,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -177,9 +183,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $organizationUpdate = new Components\OrganizationUpdate(); diff --git a/docs/sdks/polar/README.md b/docs/sdks/polar/README.md index 91fbe83..8c5008c 100644 --- a/docs/sdks/polar/README.md +++ b/docs/sdks/polar/README.md @@ -2,6 +2,6 @@ ## Overview -Read the docs at https://docs.polar.sh/api +Read the docs at https://docs.polar.sh/api-reference ### Available Operations diff --git a/docs/sdks/polarcustomers/README.md b/docs/sdks/polarcustomers/README.md index 6e83242..2fc5924 100644 --- a/docs/sdks/polarcustomers/README.md +++ b/docs/sdks/polarcustomers/README.md @@ -20,9 +20,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); diff --git a/docs/sdks/polarlicensekeys/README.md b/docs/sdks/polarlicensekeys/README.md index d9c1386..d67237c 100644 --- a/docs/sdks/polarlicensekeys/README.md +++ b/docs/sdks/polarlicensekeys/README.md @@ -25,9 +25,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Components\LicenseKeyActivate( key: '', @@ -77,9 +79,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Components\LicenseKeyDeactivate( key: '', @@ -127,9 +131,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -173,9 +179,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -233,9 +241,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Components\LicenseKeyValidate( key: '', diff --git a/docs/sdks/polarorders/README.md b/docs/sdks/polarorders/README.md index b3f55e4..4afd7a1 100644 --- a/docs/sdks/polarorders/README.md +++ b/docs/sdks/polarorders/README.md @@ -22,9 +22,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -68,9 +70,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -115,9 +119,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Operations; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Operations\CustomerPortalOrdersListRequest(); diff --git a/docs/sdks/polarorganizations/README.md b/docs/sdks/polarorganizations/README.md index 69e35db..e74aaf1 100644 --- a/docs/sdks/polarorganizations/README.md +++ b/docs/sdks/polarorganizations/README.md @@ -20,9 +20,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); diff --git a/docs/sdks/polarsubscriptions/README.md b/docs/sdks/polarsubscriptions/README.md index f2b2207..e1bd37e 100644 --- a/docs/sdks/polarsubscriptions/README.md +++ b/docs/sdks/polarsubscriptions/README.md @@ -23,9 +23,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -70,9 +72,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -117,9 +121,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Operations; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Operations\CustomerPortalSubscriptionsListRequest(); @@ -166,17 +172,17 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); -$customerSubscriptionUpdate = new Components\CustomerSubscriptionUpdate( - productPriceId: '', -); $response = $sdk->customerPortal->subscriptions->update( id: '', - customerSubscriptionUpdate: $customerSubscriptionUpdate + customerSubscriptionUpdate: new Components\CustomerSubscriptionCancel() ); @@ -187,10 +193,10 @@ if ($response->customerSubscription !== null) { ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The subscription ID. | -| `customerSubscriptionUpdate` | [Components\CustomerSubscriptionUpdate](../../Models/Components/CustomerSubscriptionUpdate.md) | :heavy_check_mark: | N/A | +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The subscription ID. | +| `customerSubscriptionUpdate` | [Components\CustomerSubscriptionUpdatePrice\|Components\CustomerSubscriptionCancel](../../Models/Components/CustomerSubscriptionUpdate.md) | :heavy_check_mark: | N/A | ### Response @@ -198,8 +204,9 @@ if ($response->customerSubscription !== null) { ### Errors -| Error Type | Status Code | Content Type | -| -------------------------- | -------------------------- | -------------------------- | -| Errors\ResourceNotFound | 404 | application/json | -| Errors\HTTPValidationError | 422 | application/json | -| Errors\APIException | 4XX, 5XX | \*/\* | \ No newline at end of file +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| Errors\AlreadyCanceledSubscription | 403 | application/json | +| Errors\ResourceNotFound | 404 | application/json | +| Errors\HTTPValidationError | 422 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/products/README.md b/docs/sdks/products/README.md index 14895f8..656765e 100644 --- a/docs/sdks/products/README.md +++ b/docs/sdks/products/README.md @@ -25,15 +25,16 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Components\ProductRecurringCreate( name: '', prices: [ - new Components\ProductPriceRecurringFixedCreate( - priceAmount: 638424, + new Components\ProductPriceRecurringFreeCreate( recurringInterval: Components\SubscriptionRecurringInterval::Month, ), ], @@ -78,9 +79,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -125,9 +128,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Operations; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Operations\ProductsListRequest(); @@ -174,9 +179,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $productUpdate = new Components\ProductUpdate(); @@ -225,9 +232,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $productBenefitsUpdate = new Components\ProductBenefitsUpdate( benefits: [ diff --git a/docs/sdks/refunds/README.md b/docs/sdks/refunds/README.md new file mode 100644 index 0000000..610df79 --- /dev/null +++ b/docs/sdks/refunds/README.md @@ -0,0 +1,114 @@ +# Refunds +(*refunds*) + +## Overview + +### Available Operations + +* [create](#create) - Create Refund +* [list](#list) - List Refunds + +## create + +Create a refund. + +### Example Usage + +```php +declare(strict_types=1); + +require 'vendor/autoload.php'; + +use Polar; +use Polar\Models\Components; + +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); + +$request = new Components\RefundCreate( + orderId: '', + reason: Components\RefundReason::CustomerRequest, + amount: 638424, +); + +$response = $sdk->refunds->create( + request: $request +); + +if ($response->refund !== null) { + // handle response +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `$request` | [Components\RefundCreate](../../Models/Components/RefundCreate.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[?Operations\RefundsCreateResponse](../../Models/Operations/RefundsCreateResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| Errors\RefundAmountTooHigh | 400 | application/json | +| Errors\RefundedAlready | 403 | application/json | +| Errors\HTTPValidationError | 422 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | + +## list + +List products. + +### Example Usage + +```php +declare(strict_types=1); + +require 'vendor/autoload.php'; + +use Polar; +use Polar\Models\Operations; + +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); + +$request = new Operations\RefundsListRequest(); + +$responses = $sdk->refunds->list( + request: $request +); + + +foreach ($responses as $response) { + if ($response->statusCode === 200) { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `$request` | [Operations\RefundsListRequest](../../Models/Operations/RefundsListRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[?Operations\RefundsListResponse](../../Models/Operations/RefundsListResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| Errors\HTTPValidationError | 422 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/repositories/README.md b/docs/sdks/repositories/README.md index 2a8775f..00a0bf1 100644 --- a/docs/sdks/repositories/README.md +++ b/docs/sdks/repositories/README.md @@ -22,9 +22,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -69,9 +71,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Operations; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Operations\RepositoriesListRequest(); @@ -118,9 +122,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Components; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $repositoryUpdate = new Components\RepositoryUpdate(); diff --git a/docs/sdks/subscriptions/README.md b/docs/sdks/subscriptions/README.md index f05f4ec..31ffc8a 100644 --- a/docs/sdks/subscriptions/README.md +++ b/docs/sdks/subscriptions/README.md @@ -6,7 +6,10 @@ ### Available Operations * [export](#export) - Export Subscriptions +* [get](#get) - Get Subscription * [list](#list) - List Subscriptions +* [revoke](#revoke) - Revoke Subscription +* [update](#update) - Update Subscription ## export @@ -21,9 +24,11 @@ require 'vendor/autoload.php'; use Polar; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); @@ -55,6 +60,54 @@ if ($response->any !== null) { | Errors\HTTPValidationError | 422 | application/json | | Errors\APIException | 4XX, 5XX | \*/\* | +## get + +Get a subscription by ID. + +### Example Usage + +```php +declare(strict_types=1); + +require 'vendor/autoload.php'; + +use Polar; + +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); + + + +$response = $sdk->subscriptions->get( + id: '' +); + +if ($response->subscription !== null) { + // handle response +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `id` | *string* | :heavy_check_mark: | The subscription ID. | + +### Response + +**[?Operations\SubscriptionsGetResponse](../../Models/Operations/SubscriptionsGetResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| Errors\ResourceNotFound | 404 | application/json | +| Errors\HTTPValidationError | 422 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | + ## list List subscriptions. @@ -69,9 +122,11 @@ require 'vendor/autoload.php'; use Polar; use Polar\Models\Operations; -$security = ''; - -$sdk = Polar\Polar::builder()->setSecurity($security)->build(); +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); $request = new Operations\SubscriptionsListRequest(); @@ -102,4 +157,106 @@ foreach ($responses as $response) { | Error Type | Status Code | Content Type | | -------------------------- | -------------------------- | -------------------------- | | Errors\HTTPValidationError | 422 | application/json | -| Errors\APIException | 4XX, 5XX | \*/\* | \ No newline at end of file +| Errors\APIException | 4XX, 5XX | \*/\* | + +## revoke + +Revoke a subscription, i.e cancel immediately. + +### Example Usage + +```php +declare(strict_types=1); + +require 'vendor/autoload.php'; + +use Polar; + +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); + + + +$response = $sdk->subscriptions->revoke( + id: '' +); + +if ($response->subscription !== null) { + // handle response +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `id` | *string* | :heavy_check_mark: | The subscription ID. | + +### Response + +**[?Operations\SubscriptionsRevokeResponse](../../Models/Operations/SubscriptionsRevokeResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| Errors\AlreadyCanceledSubscription | 403 | application/json | +| Errors\ResourceNotFound | 404 | application/json | +| Errors\HTTPValidationError | 422 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | + +## update + +Update a subscription. + +### Example Usage + +```php +declare(strict_types=1); + +require 'vendor/autoload.php'; + +use Polar; +use Polar\Models\Components; + +$sdk = Polar\Polar::builder() + ->setSecurity( + '' + ) + ->build(); + + + +$response = $sdk->subscriptions->update( + id: '', + subscriptionUpdate: new Components\SubscriptionCancel() + +); + +if ($response->subscription !== null) { + // handle response +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The subscription ID. | +| `subscriptionUpdate` | [Components\SubscriptionUpdatePrice\|Components\SubscriptionCancel](../../Models/Components/SubscriptionUpdate.md) | :heavy_check_mark: | N/A | + +### Response + +**[?Operations\SubscriptionsUpdateResponse](../../Models/Operations/SubscriptionsUpdateResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| Errors\AlreadyCanceledSubscription | 403 | application/json | +| Errors\ResourceNotFound | 404 | application/json | +| Errors\HTTPValidationError | 422 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/src/Advertisements.php b/src/Advertisements.php index 638ab65..80ca154 100644 --- a/src/Advertisements.php +++ b/src/Advertisements.php @@ -11,6 +11,7 @@ use Polar\Hooks\HookContext; use Polar\Models\Components; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class Advertisements @@ -53,7 +54,7 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\AdvertisementsGetResponse * @throws \Polar\Models\Errors\APIException */ - public function get(string $id): Operations\AdvertisementsGetResponse + public function get(string $id, ?Options $options = null): Operations\AdvertisementsGetResponse { $request = new Operations\AdvertisementsGetRequest( id: $id, @@ -61,32 +62,28 @@ public function get(string $id): Operations\AdvertisementsGetResponse $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/advertisements/{id}', Operations\AdvertisementsGetRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('advertisements:get', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -103,7 +100,7 @@ public function get(string $id): Operations\AdvertisementsGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -114,7 +111,7 @@ public function get(string $id): Operations\AdvertisementsGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -125,7 +122,9 @@ public function get(string $id): Operations\AdvertisementsGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -144,7 +143,7 @@ public function get(string $id): Operations\AdvertisementsGetResponse * @return Operations\AdvertisementsListResponse * @throws \Polar\Models\Errors\APIException */ - private function listIndividual(string $benefitId, ?int $page = null, ?int $limit = null, ?array $sorting = null): Operations\AdvertisementsListResponse + private function listIndividual(string $benefitId, ?int $page = null, ?int $limit = null, ?array $sorting = null, ?Options $options = null): Operations\AdvertisementsListResponse { $request = new Operations\AdvertisementsListRequest( benefitId: $benefitId, @@ -155,35 +154,31 @@ private function listIndividual(string $benefitId, ?int $page = null, ?int $limi $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/advertisements/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $qp = Utils\Utils::getQueryParams(Operations\AdvertisementsListRequest::class, $request, $urlOverride); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('advertisements:list', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -235,7 +230,7 @@ private function listIndividual(string $benefitId, ?int $page = null, ?int $limi } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -246,7 +241,9 @@ private function listIndividual(string $benefitId, ?int $page = null, ?int $limi } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -264,9 +261,9 @@ private function listIndividual(string $benefitId, ?int $page = null, ?int $limi * @return \Generator * @throws \Polar\Models\Errors\APIException */ - public function list(string $benefitId, ?int $page = null, ?int $limit = null, ?array $sorting = null): \Generator + public function list(string $benefitId, ?int $page = null, ?int $limit = null, ?array $sorting = null, ?Options $options = null): \Generator { - $res = $this->listIndividual($benefitId, $page, $limit, $sorting); + $res = $this->listIndividual($benefitId, $page, $limit, $sorting, $options); while ($res !== null) { yield $res; $res = $res->next($res); diff --git a/src/BenefitGrants.php b/src/BenefitGrants.php index 56cc121..1a144f3 100644 --- a/src/BenefitGrants.php +++ b/src/BenefitGrants.php @@ -11,6 +11,7 @@ use Polar\Hooks\HookContext; use Polar\Models\Components; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class BenefitGrants @@ -53,7 +54,7 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\CustomerPortalBenefitGrantsGetResponse * @throws \Polar\Models\Errors\APIException */ - public function get(string $id): Operations\CustomerPortalBenefitGrantsGetResponse + public function get(string $id, ?Options $options = null): Operations\CustomerPortalBenefitGrantsGetResponse { $request = new Operations\CustomerPortalBenefitGrantsGetRequest( id: $id, @@ -61,32 +62,28 @@ public function get(string $id): Operations\CustomerPortalBenefitGrantsGetRespon $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/customer-portal/benefit-grants/{id}', Operations\CustomerPortalBenefitGrantsGetRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('customer_portal:benefit-grants:get', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -103,7 +100,7 @@ public function get(string $id): Operations\CustomerPortalBenefitGrantsGetRespon } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -114,7 +111,7 @@ public function get(string $id): Operations\CustomerPortalBenefitGrantsGetRespon } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -125,7 +122,9 @@ public function get(string $id): Operations\CustomerPortalBenefitGrantsGetRespon } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -141,40 +140,36 @@ public function get(string $id): Operations\CustomerPortalBenefitGrantsGetRespon * @return Operations\CustomerPortalBenefitGrantsListResponse * @throws \Polar\Models\Errors\APIException */ - private function listIndividual(?Operations\CustomerPortalBenefitGrantsListRequest $request = null): Operations\CustomerPortalBenefitGrantsListResponse + private function listIndividual(?Operations\CustomerPortalBenefitGrantsListRequest $request = null, ?Options $options = null): Operations\CustomerPortalBenefitGrantsListResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/customer-portal/benefit-grants/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $qp = Utils\Utils::getQueryParams(Operations\CustomerPortalBenefitGrantsListRequest::class, $request, $urlOverride); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('customer_portal:benefit-grants:list', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -233,7 +228,7 @@ private function listIndividual(?Operations\CustomerPortalBenefitGrantsListReque } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -244,7 +239,9 @@ private function listIndividual(?Operations\CustomerPortalBenefitGrantsListReque } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -259,9 +256,9 @@ private function listIndividual(?Operations\CustomerPortalBenefitGrantsListReque * @return \Generator * @throws \Polar\Models\Errors\APIException */ - public function list(?Operations\CustomerPortalBenefitGrantsListRequest $request = null): \Generator + public function list(?Operations\CustomerPortalBenefitGrantsListRequest $request = null, ?Options $options = null): \Generator { - $res = $this->listIndividual($request); + $res = $this->listIndividual($request, $options); while ($res !== null) { yield $res; $res = $res->next($res); @@ -278,7 +275,7 @@ public function list(?Operations\CustomerPortalBenefitGrantsListRequest $request * @return Operations\CustomerPortalBenefitGrantsUpdateResponse * @throws \Polar\Models\Errors\APIException */ - public function update(Components\CustomerBenefitGrantDiscordUpdate|Components\CustomerBenefitGrantGitHubRepositoryUpdate|Components\CustomerBenefitGrantDownloadablesUpdate|Components\CustomerBenefitGrantLicenseKeysUpdate|Components\CustomerBenefitGrantAdsUpdate|Components\CustomerBenefitGrantCustomUpdate $customerBenefitGrantUpdate, string $id): Operations\CustomerPortalBenefitGrantsUpdateResponse + public function update(Components\CustomerBenefitGrantDiscordUpdate|Components\CustomerBenefitGrantGitHubRepositoryUpdate|Components\CustomerBenefitGrantDownloadablesUpdate|Components\CustomerBenefitGrantLicenseKeysUpdate|Components\CustomerBenefitGrantAdsUpdate|Components\CustomerBenefitGrantCustomUpdate $customerBenefitGrantUpdate, string $id, ?Options $options = null): Operations\CustomerPortalBenefitGrantsUpdateResponse { $request = new Operations\CustomerPortalBenefitGrantsUpdateRequest( id: $id, @@ -287,37 +284,33 @@ public function update(Components\CustomerBenefitGrantDiscordUpdate|Components\C $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/customer-portal/benefit-grants/{id}', Operations\CustomerPortalBenefitGrantsUpdateRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'customerBenefitGrantUpdate', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); $hookContext = new HookContext('customer_portal:benefit-grants:update', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 403 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -334,7 +327,7 @@ public function update(Components\CustomerBenefitGrantDiscordUpdate|Components\C } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 403) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -345,7 +338,7 @@ public function update(Components\CustomerBenefitGrantDiscordUpdate|Components\C } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -356,7 +349,7 @@ public function update(Components\CustomerBenefitGrantDiscordUpdate|Components\C } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -367,7 +360,9 @@ public function update(Components\CustomerBenefitGrantDiscordUpdate|Components\C } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/Benefits.php b/src/Benefits.php index 212ee58..37db625 100644 --- a/src/Benefits.php +++ b/src/Benefits.php @@ -11,6 +11,7 @@ use Polar\Hooks\HookContext; use Polar\Models\Components; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class Benefits @@ -53,42 +54,38 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\BenefitsCreateResponse * @throws \Polar\Models\Errors\APIException */ - public function create(Components\BenefitCustomCreate|Components\BenefitAdsCreate|Components\BenefitDiscordCreate|Components\BenefitGitHubRepositoryCreate|Components\BenefitDownloadablesCreate|Components\BenefitLicenseKeysCreate $request): Operations\BenefitsCreateResponse + public function create(Components\BenefitCustomCreate|Components\BenefitAdsCreate|Components\BenefitDiscordCreate|Components\BenefitGitHubRepositoryCreate|Components\BenefitDownloadablesCreate|Components\BenefitLicenseKeysCreate $request, ?Options $options = null): Operations\BenefitsCreateResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/benefits/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); $hookContext = new HookContext('benefits:create', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 201) { + if (Utils\Utils::matchStatusCodes($statusCode, ['201'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -105,7 +102,7 @@ public function create(Components\BenefitCustomCreate|Components\BenefitAdsCreat } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -116,7 +113,9 @@ public function create(Components\BenefitCustomCreate|Components\BenefitAdsCreat } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -136,7 +135,7 @@ public function create(Components\BenefitCustomCreate|Components\BenefitAdsCreat * @return Operations\BenefitsDeleteResponse * @throws \Polar\Models\Errors\APIException */ - public function delete(string $id): Operations\BenefitsDeleteResponse + public function delete(string $id, ?Options $options = null): Operations\BenefitsDeleteResponse { $request = new Operations\BenefitsDeleteRequest( id: $id, @@ -144,32 +143,28 @@ public function delete(string $id): Operations\BenefitsDeleteResponse $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/benefits/{id}', Operations\BenefitsDeleteRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('DELETE', $url); $hookContext = new HookContext('benefits:delete', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 403 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 204) { + if (Utils\Utils::matchStatusCodes($statusCode, ['204'])) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); return new Operations\BenefitsDeleteResponse( @@ -177,7 +172,7 @@ public function delete(string $id): Operations\BenefitsDeleteResponse contentType: $contentType, rawResponse: $httpResponse ); - } elseif ($statusCode == 403) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -188,7 +183,7 @@ public function delete(string $id): Operations\BenefitsDeleteResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -199,7 +194,7 @@ public function delete(string $id): Operations\BenefitsDeleteResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -210,7 +205,9 @@ public function delete(string $id): Operations\BenefitsDeleteResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -226,7 +223,7 @@ public function delete(string $id): Operations\BenefitsDeleteResponse * @return Operations\BenefitsGetResponse * @throws \Polar\Models\Errors\APIException */ - public function get(string $id): Operations\BenefitsGetResponse + public function get(string $id, ?Options $options = null): Operations\BenefitsGetResponse { $request = new Operations\BenefitsGetRequest( id: $id, @@ -234,32 +231,28 @@ public function get(string $id): Operations\BenefitsGetResponse $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/benefits/{id}', Operations\BenefitsGetRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('benefits:get', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -276,7 +269,7 @@ public function get(string $id): Operations\BenefitsGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -287,7 +280,7 @@ public function get(string $id): Operations\BenefitsGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -298,7 +291,9 @@ public function get(string $id): Operations\BenefitsGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -316,40 +311,36 @@ public function get(string $id): Operations\BenefitsGetResponse * @return Operations\BenefitsGrantsResponse * @throws \Polar\Models\Errors\APIException */ - private function grantsIndividual(Operations\BenefitsGrantsRequest $request): Operations\BenefitsGrantsResponse + private function grantsIndividual(Operations\BenefitsGrantsRequest $request, ?Options $options = null): Operations\BenefitsGrantsResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/benefits/{id}/grants', Operations\BenefitsGrantsRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $qp = Utils\Utils::getQueryParams(Operations\BenefitsGrantsRequest::class, $request, $urlOverride); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('benefits:grants', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -404,7 +395,7 @@ private function grantsIndividual(Operations\BenefitsGrantsRequest $request): Op } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -415,7 +406,7 @@ private function grantsIndividual(Operations\BenefitsGrantsRequest $request): Op } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -426,7 +417,9 @@ private function grantsIndividual(Operations\BenefitsGrantsRequest $request): Op } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -443,9 +436,9 @@ private function grantsIndividual(Operations\BenefitsGrantsRequest $request): Op * @return \Generator * @throws \Polar\Models\Errors\APIException */ - public function grants(Operations\BenefitsGrantsRequest $request): \Generator + public function grants(Operations\BenefitsGrantsRequest $request, ?Options $options = null): \Generator { - $res = $this->grantsIndividual($request); + $res = $this->grantsIndividual($request, $options); while ($res !== null) { yield $res; $res = $res->next($res); @@ -464,7 +457,7 @@ public function grants(Operations\BenefitsGrantsRequest $request): \Generator * @return Operations\BenefitsListResponse * @throws \Polar\Models\Errors\APIException */ - private function listIndividual(string|array|null $organizationId = null, Components\BenefitType|array|null $typeFilter = null, ?int $page = null, ?int $limit = null): Operations\BenefitsListResponse + private function listIndividual(string|array|null $organizationId = null, Components\BenefitType|array|null $typeFilter = null, ?int $page = null, ?int $limit = null, ?Options $options = null): Operations\BenefitsListResponse { $request = new Operations\BenefitsListRequest( organizationId: $organizationId, @@ -475,35 +468,31 @@ private function listIndividual(string|array|null $organizationId = null, Compon $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/benefits/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $qp = Utils\Utils::getQueryParams(Operations\BenefitsListRequest::class, $request, $urlOverride); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('benefits:list', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -555,7 +544,7 @@ private function listIndividual(string|array|null $organizationId = null, Compon } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -566,7 +555,9 @@ private function listIndividual(string|array|null $organizationId = null, Compon } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -584,9 +575,9 @@ private function listIndividual(string|array|null $organizationId = null, Compon * @return \Generator * @throws \Polar\Models\Errors\APIException */ - public function list(string|array|null $organizationId = null, Components\BenefitType|array|null $typeFilter = null, ?int $page = null, ?int $limit = null): \Generator + public function list(string|array|null $organizationId = null, Components\BenefitType|array|null $typeFilter = null, ?int $page = null, ?int $limit = null, ?Options $options = null): \Generator { - $res = $this->listIndividual($organizationId, $typeFilter, $page, $limit); + $res = $this->listIndividual($organizationId, $typeFilter, $page, $limit, $options); while ($res !== null) { yield $res; $res = $res->next($res); @@ -603,7 +594,7 @@ public function list(string|array|null $organizationId = null, Components\Benefi * @return Operations\BenefitsUpdateResponse * @throws \Polar\Models\Errors\APIException */ - public function update(Components\BenefitAdsUpdate|Components\BenefitCustomUpdate|Components\BenefitDiscordUpdate|Components\BenefitGitHubRepositoryUpdate|Components\BenefitDownloadablesUpdate|Components\BenefitLicenseKeysUpdate $requestBody, string $id): Operations\BenefitsUpdateResponse + public function update(Components\BenefitAdsUpdate|Components\BenefitCustomUpdate|Components\BenefitDiscordUpdate|Components\BenefitGitHubRepositoryUpdate|Components\BenefitDownloadablesUpdate|Components\BenefitLicenseKeysUpdate $requestBody, string $id, ?Options $options = null): Operations\BenefitsUpdateResponse { $request = new Operations\BenefitsUpdateRequest( id: $id, @@ -612,37 +603,33 @@ public function update(Components\BenefitAdsUpdate|Components\BenefitCustomUpdat $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/benefits/{id}', Operations\BenefitsUpdateRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'requestBody', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); $hookContext = new HookContext('benefits:update', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 403 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -659,7 +646,7 @@ public function update(Components\BenefitAdsUpdate|Components\BenefitCustomUpdat } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 403) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -670,7 +657,7 @@ public function update(Components\BenefitAdsUpdate|Components\BenefitCustomUpdat } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -681,7 +668,7 @@ public function update(Components\BenefitAdsUpdate|Components\BenefitCustomUpdat } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -692,7 +679,9 @@ public function update(Components\BenefitAdsUpdate|Components\BenefitCustomUpdat } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/CheckoutLinks.php b/src/CheckoutLinks.php index 5087535..cf23fb2 100644 --- a/src/CheckoutLinks.php +++ b/src/CheckoutLinks.php @@ -11,6 +11,7 @@ use Polar\Hooks\HookContext; use Polar\Models\Components; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class CheckoutLinks @@ -53,42 +54,38 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\CheckoutLinksCreateResponse * @throws \Polar\Models\Errors\APIException */ - public function create(Components\CheckoutLinkProductCreate|Components\CheckoutLinkPriceCreate $request): Operations\CheckoutLinksCreateResponse + public function create(Components\CheckoutLinkProductCreate|Components\CheckoutLinkPriceCreate $request, ?Options $options = null): Operations\CheckoutLinksCreateResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/checkout-links/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); $hookContext = new HookContext('checkout-links:create', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 201) { + if (Utils\Utils::matchStatusCodes($statusCode, ['201'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -105,7 +102,7 @@ public function create(Components\CheckoutLinkProductCreate|Components\CheckoutL } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -116,7 +113,9 @@ public function create(Components\CheckoutLinkProductCreate|Components\CheckoutL } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -132,7 +131,7 @@ public function create(Components\CheckoutLinkProductCreate|Components\CheckoutL * @return Operations\CheckoutLinksDeleteResponse * @throws \Polar\Models\Errors\APIException */ - public function delete(string $id): Operations\CheckoutLinksDeleteResponse + public function delete(string $id, ?Options $options = null): Operations\CheckoutLinksDeleteResponse { $request = new Operations\CheckoutLinksDeleteRequest( id: $id, @@ -140,32 +139,28 @@ public function delete(string $id): Operations\CheckoutLinksDeleteResponse $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/checkout-links/{id}', Operations\CheckoutLinksDeleteRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('DELETE', $url); $hookContext = new HookContext('checkout-links:delete', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 204) { + if (Utils\Utils::matchStatusCodes($statusCode, ['204'])) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); return new Operations\CheckoutLinksDeleteResponse( @@ -173,7 +168,7 @@ public function delete(string $id): Operations\CheckoutLinksDeleteResponse contentType: $contentType, rawResponse: $httpResponse ); - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -184,7 +179,7 @@ public function delete(string $id): Operations\CheckoutLinksDeleteResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -195,7 +190,9 @@ public function delete(string $id): Operations\CheckoutLinksDeleteResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -211,7 +208,7 @@ public function delete(string $id): Operations\CheckoutLinksDeleteResponse * @return Operations\CheckoutLinksGetResponse * @throws \Polar\Models\Errors\APIException */ - public function get(string $id): Operations\CheckoutLinksGetResponse + public function get(string $id, ?Options $options = null): Operations\CheckoutLinksGetResponse { $request = new Operations\CheckoutLinksGetRequest( id: $id, @@ -219,32 +216,28 @@ public function get(string $id): Operations\CheckoutLinksGetResponse $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/checkout-links/{id}', Operations\CheckoutLinksGetRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('checkout-links:get', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -261,7 +254,7 @@ public function get(string $id): Operations\CheckoutLinksGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -272,7 +265,7 @@ public function get(string $id): Operations\CheckoutLinksGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -283,7 +276,9 @@ public function get(string $id): Operations\CheckoutLinksGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -299,40 +294,36 @@ public function get(string $id): Operations\CheckoutLinksGetResponse * @return Operations\CheckoutLinksListResponse * @throws \Polar\Models\Errors\APIException */ - private function listIndividual(?Operations\CheckoutLinksListRequest $request = null): Operations\CheckoutLinksListResponse + private function listIndividual(?Operations\CheckoutLinksListRequest $request = null, ?Options $options = null): Operations\CheckoutLinksListResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/checkout-links/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $qp = Utils\Utils::getQueryParams(Operations\CheckoutLinksListRequest::class, $request, $urlOverride); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('checkout-links:list', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -387,7 +378,7 @@ private function listIndividual(?Operations\CheckoutLinksListRequest $request = } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -398,7 +389,9 @@ private function listIndividual(?Operations\CheckoutLinksListRequest $request = } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -413,9 +406,9 @@ private function listIndividual(?Operations\CheckoutLinksListRequest $request = * @return \Generator * @throws \Polar\Models\Errors\APIException */ - public function list(?Operations\CheckoutLinksListRequest $request = null): \Generator + public function list(?Operations\CheckoutLinksListRequest $request = null, ?Options $options = null): \Generator { - $res = $this->listIndividual($request); + $res = $this->listIndividual($request, $options); while ($res !== null) { yield $res; $res = $res->next($res); @@ -432,7 +425,7 @@ public function list(?Operations\CheckoutLinksListRequest $request = null): \Gen * @return Operations\CheckoutLinksUpdateResponse * @throws \Polar\Models\Errors\APIException */ - public function update(Components\CheckoutLinkUpdate $checkoutLinkUpdate, string $id): Operations\CheckoutLinksUpdateResponse + public function update(Components\CheckoutLinkUpdate $checkoutLinkUpdate, string $id, ?Options $options = null): Operations\CheckoutLinksUpdateResponse { $request = new Operations\CheckoutLinksUpdateRequest( id: $id, @@ -441,37 +434,33 @@ public function update(Components\CheckoutLinkUpdate $checkoutLinkUpdate, string $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/checkout-links/{id}', Operations\CheckoutLinksUpdateRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'checkoutLinkUpdate', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); $hookContext = new HookContext('checkout-links:update', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -488,7 +477,7 @@ public function update(Components\CheckoutLinkUpdate $checkoutLinkUpdate, string } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -499,7 +488,7 @@ public function update(Components\CheckoutLinkUpdate $checkoutLinkUpdate, string } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -510,7 +499,9 @@ public function update(Components\CheckoutLinkUpdate $checkoutLinkUpdate, string } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/Checkouts.php b/src/Checkouts.php index 892fbda..74b431d 100644 --- a/src/Checkouts.php +++ b/src/Checkouts.php @@ -11,6 +11,7 @@ use Polar\Hooks\HookContext; use Polar\Models\Components; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class Checkouts @@ -57,43 +58,39 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @throws \Polar\Models\Errors\APIException * @deprecated method: This API is deprecated. We recommend you to use the new custom checkout API, which is more flexible and powerful. Please refer to the documentation for more information.. Use create instead. */ - public function create(Components\CheckoutLegacyCreate $request): Operations\CheckoutsCreateResponse + public function create(Components\CheckoutLegacyCreate $request, ?Options $options = null): Operations\CheckoutsCreateResponse { trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED); $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/checkouts/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); $hookContext = new HookContext('checkouts:create', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 201) { + if (Utils\Utils::matchStatusCodes($statusCode, ['201'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -110,7 +107,7 @@ public function create(Components\CheckoutLegacyCreate $request): Operations\Che } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -121,7 +118,9 @@ public function create(Components\CheckoutLegacyCreate $request): Operations\Che } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -138,7 +137,7 @@ public function create(Components\CheckoutLegacyCreate $request): Operations\Che * @throws \Polar\Models\Errors\APIException * @deprecated method: This API is deprecated. We recommend you to use the new custom checkout API, which is more flexible and powerful. Please refer to the documentation for more information.. */ - public function get(string $id): Operations\CheckoutsGetResponse + public function get(string $id, ?Options $options = null): Operations\CheckoutsGetResponse { trigger_error('Method '.__METHOD__.' is deprecated', E_USER_DEPRECATED); $request = new Operations\CheckoutsGetRequest( @@ -147,32 +146,28 @@ public function get(string $id): Operations\CheckoutsGetResponse $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/checkouts/{id}', Operations\CheckoutsGetRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('checkouts:get', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -189,7 +184,7 @@ public function get(string $id): Operations\CheckoutsGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -200,7 +195,9 @@ public function get(string $id): Operations\CheckoutsGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/Clients.php b/src/Clients.php index 8e43bfb..deec45e 100644 --- a/src/Clients.php +++ b/src/Clients.php @@ -11,6 +11,7 @@ use Polar\Hooks\HookContext; use Polar\Models\Components; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class Clients @@ -54,7 +55,7 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\Oauth2ClientsListResponse * @throws \Polar\Models\Errors\APIException */ - private function listIndividual(?int $page = null, ?int $limit = null): Operations\Oauth2ClientsListResponse + private function listIndividual(?int $page = null, ?int $limit = null, ?Options $options = null): Operations\Oauth2ClientsListResponse { $request = new Operations\Oauth2ClientsListRequest( page: $page, @@ -63,35 +64,31 @@ private function listIndividual(?int $page = null, ?int $limit = null): Operatio $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/oauth2/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $qp = Utils\Utils::getQueryParams(Operations\Oauth2ClientsListRequest::class, $request, $urlOverride); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('oauth2:clients:list', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -141,7 +138,7 @@ private function listIndividual(?int $page = null, ?int $limit = null): Operatio } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -152,7 +149,9 @@ private function listIndividual(?int $page = null, ?int $limit = null): Operatio } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -168,9 +167,9 @@ private function listIndividual(?int $page = null, ?int $limit = null): Operatio * @return \Generator * @throws \Polar\Models\Errors\APIException */ - public function list(?int $page = null, ?int $limit = null): \Generator + public function list(?int $page = null, ?int $limit = null, ?Options $options = null): \Generator { - $res = $this->listIndividual($page, $limit); + $res = $this->listIndividual($page, $limit, $options); while ($res !== null) { yield $res; $res = $res->next($res); @@ -186,42 +185,38 @@ public function list(?int $page = null, ?int $limit = null): \Generator * @return Operations\Oauth2ClientsOauth2CreateClientResponse * @throws \Polar\Models\Errors\APIException */ - public function create(Components\OAuth2ClientConfiguration $request): Operations\Oauth2ClientsOauth2CreateClientResponse + public function create(Components\OAuth2ClientConfiguration $request, ?Options $options = null): Operations\Oauth2ClientsOauth2CreateClientResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/oauth2/register'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); $hookContext = new HookContext('oauth2:clients:oauth2:create_client', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -238,7 +233,7 @@ public function create(Components\OAuth2ClientConfiguration $request): Operation } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -249,7 +244,9 @@ public function create(Components\OAuth2ClientConfiguration $request): Operation } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -265,7 +262,7 @@ public function create(Components\OAuth2ClientConfiguration $request): Operation * @return Operations\Oauth2ClientsOauth2DeleteClientResponse * @throws \Polar\Models\Errors\APIException */ - public function delete(string $clientId): Operations\Oauth2ClientsOauth2DeleteClientResponse + public function delete(string $clientId, ?Options $options = null): Operations\Oauth2ClientsOauth2DeleteClientResponse { $request = new Operations\Oauth2ClientsOauth2DeleteClientRequest( clientId: $clientId, @@ -273,32 +270,28 @@ public function delete(string $clientId): Operations\Oauth2ClientsOauth2DeleteCl $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/oauth2/register/{client_id}', Operations\Oauth2ClientsOauth2DeleteClientRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('DELETE', $url); $hookContext = new HookContext('oauth2:clients:oauth2:delete_client', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -315,7 +308,7 @@ public function delete(string $clientId): Operations\Oauth2ClientsOauth2DeleteCl } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -326,7 +319,9 @@ public function delete(string $clientId): Operations\Oauth2ClientsOauth2DeleteCl } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -342,7 +337,7 @@ public function delete(string $clientId): Operations\Oauth2ClientsOauth2DeleteCl * @return Operations\Oauth2ClientsOauth2GetClientResponse * @throws \Polar\Models\Errors\APIException */ - public function get(string $clientId): Operations\Oauth2ClientsOauth2GetClientResponse + public function get(string $clientId, ?Options $options = null): Operations\Oauth2ClientsOauth2GetClientResponse { $request = new Operations\Oauth2ClientsOauth2GetClientRequest( clientId: $clientId, @@ -350,32 +345,28 @@ public function get(string $clientId): Operations\Oauth2ClientsOauth2GetClientRe $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/oauth2/register/{client_id}', Operations\Oauth2ClientsOauth2GetClientRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('oauth2:clients:oauth2:get_client', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -392,7 +383,7 @@ public function get(string $clientId): Operations\Oauth2ClientsOauth2GetClientRe } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -403,7 +394,9 @@ public function get(string $clientId): Operations\Oauth2ClientsOauth2GetClientRe } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -420,7 +413,7 @@ public function get(string $clientId): Operations\Oauth2ClientsOauth2GetClientRe * @return Operations\Oauth2ClientsOauth2UpdateClientResponse * @throws \Polar\Models\Errors\APIException */ - public function update(Components\OAuth2ClientConfigurationUpdate $oAuth2ClientConfigurationUpdate, string $clientId): Operations\Oauth2ClientsOauth2UpdateClientResponse + public function update(Components\OAuth2ClientConfigurationUpdate $oAuth2ClientConfigurationUpdate, string $clientId, ?Options $options = null): Operations\Oauth2ClientsOauth2UpdateClientResponse { $request = new Operations\Oauth2ClientsOauth2UpdateClientRequest( clientId: $clientId, @@ -429,37 +422,33 @@ public function update(Components\OAuth2ClientConfigurationUpdate $oAuth2ClientC $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/oauth2/register/{client_id}', Operations\Oauth2ClientsOauth2UpdateClientRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'oAuth2ClientConfigurationUpdate', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('PUT', $url); $hookContext = new HookContext('oauth2:clients:oauth2:update_client', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -476,7 +465,7 @@ public function update(Components\OAuth2ClientConfigurationUpdate $oAuth2ClientC } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -487,7 +476,9 @@ public function update(Components\OAuth2ClientConfigurationUpdate $oAuth2ClientC } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/Custom.php b/src/Custom.php index 7209f1f..30bdd2d 100644 --- a/src/Custom.php +++ b/src/Custom.php @@ -11,6 +11,7 @@ use Polar\Hooks\HookContext; use Polar\Models\Components; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class Custom @@ -56,7 +57,7 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\CheckoutsCustomClientConfirmResponse * @throws \Polar\Models\Errors\APIException */ - public function clientConfirm(Components\CheckoutConfirmStripe $checkoutConfirmStripe, string $clientSecret): Operations\CheckoutsCustomClientConfirmResponse + public function clientConfirm(Components\CheckoutConfirmStripe $checkoutConfirmStripe, string $clientSecret, ?Options $options = null): Operations\CheckoutsCustomClientConfirmResponse { $request = new Operations\CheckoutsCustomClientConfirmRequest( clientSecret: $clientSecret, @@ -65,37 +66,33 @@ public function clientConfirm(Components\CheckoutConfirmStripe $checkoutConfirmS $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/checkouts/custom/client/{client_secret}/confirm', Operations\CheckoutsCustomClientConfirmRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'checkoutConfirmStripe', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); $hookContext = new HookContext('checkouts:custom:client_confirm', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -112,7 +109,18 @@ public function clientConfirm(Components\CheckoutConfirmStripe $checkoutConfirmS } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\AlreadyActiveSubscriptionError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -123,7 +131,7 @@ public function clientConfirm(Components\CheckoutConfirmStripe $checkoutConfirmS } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -134,7 +142,9 @@ public function clientConfirm(Components\CheckoutConfirmStripe $checkoutConfirmS } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -150,7 +160,7 @@ public function clientConfirm(Components\CheckoutConfirmStripe $checkoutConfirmS * @return Operations\CheckoutsCustomClientGetResponse * @throws \Polar\Models\Errors\APIException */ - public function clientGet(string $clientSecret): Operations\CheckoutsCustomClientGetResponse + public function clientGet(string $clientSecret, ?Options $options = null): Operations\CheckoutsCustomClientGetResponse { $request = new Operations\CheckoutsCustomClientGetRequest( clientSecret: $clientSecret, @@ -158,32 +168,28 @@ public function clientGet(string $clientSecret): Operations\CheckoutsCustomClien $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/checkouts/custom/client/{client_secret}', Operations\CheckoutsCustomClientGetRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('checkouts:custom:client_get', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -200,7 +206,7 @@ public function clientGet(string $clientSecret): Operations\CheckoutsCustomClien } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -211,7 +217,7 @@ public function clientGet(string $clientSecret): Operations\CheckoutsCustomClien } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -222,7 +228,9 @@ public function clientGet(string $clientSecret): Operations\CheckoutsCustomClien } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -239,7 +247,7 @@ public function clientGet(string $clientSecret): Operations\CheckoutsCustomClien * @return Operations\CheckoutsCustomClientUpdateResponse * @throws \Polar\Models\Errors\APIException */ - public function clientUpdate(Components\CheckoutUpdatePublic $checkoutUpdatePublic, string $clientSecret): Operations\CheckoutsCustomClientUpdateResponse + public function clientUpdate(Components\CheckoutUpdatePublic $checkoutUpdatePublic, string $clientSecret, ?Options $options = null): Operations\CheckoutsCustomClientUpdateResponse { $request = new Operations\CheckoutsCustomClientUpdateRequest( clientSecret: $clientSecret, @@ -248,37 +256,33 @@ public function clientUpdate(Components\CheckoutUpdatePublic $checkoutUpdatePubl $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/checkouts/custom/client/{client_secret}', Operations\CheckoutsCustomClientUpdateRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'checkoutUpdatePublic', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); $hookContext = new HookContext('checkouts:custom:client_update', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -295,7 +299,18 @@ public function clientUpdate(Components\CheckoutUpdatePublic $checkoutUpdatePubl } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\AlreadyActiveSubscriptionError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -306,7 +321,7 @@ public function clientUpdate(Components\CheckoutUpdatePublic $checkoutUpdatePubl } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -317,7 +332,9 @@ public function clientUpdate(Components\CheckoutUpdatePublic $checkoutUpdatePubl } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -333,42 +350,38 @@ public function clientUpdate(Components\CheckoutUpdatePublic $checkoutUpdatePubl * @return Operations\CheckoutsCustomCreateResponse * @throws \Polar\Models\Errors\APIException */ - public function create(Components\CheckoutProductCreate|Components\CheckoutPriceCreate $request): Operations\CheckoutsCustomCreateResponse + public function create(Components\CheckoutProductCreate|Components\CheckoutPriceCreate $request, ?Options $options = null): Operations\CheckoutsCustomCreateResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/checkouts/custom/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); $hookContext = new HookContext('checkouts:custom:create', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 201) { + if (Utils\Utils::matchStatusCodes($statusCode, ['201'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -385,7 +398,7 @@ public function create(Components\CheckoutProductCreate|Components\CheckoutPrice } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -396,7 +409,9 @@ public function create(Components\CheckoutProductCreate|Components\CheckoutPrice } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -412,7 +427,7 @@ public function create(Components\CheckoutProductCreate|Components\CheckoutPrice * @return Operations\CheckoutsCustomGetResponse * @throws \Polar\Models\Errors\APIException */ - public function get(string $id): Operations\CheckoutsCustomGetResponse + public function get(string $id, ?Options $options = null): Operations\CheckoutsCustomGetResponse { $request = new Operations\CheckoutsCustomGetRequest( id: $id, @@ -420,32 +435,28 @@ public function get(string $id): Operations\CheckoutsCustomGetResponse $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/checkouts/custom/{id}', Operations\CheckoutsCustomGetRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('checkouts:custom:get', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -462,7 +473,7 @@ public function get(string $id): Operations\CheckoutsCustomGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -473,7 +484,7 @@ public function get(string $id): Operations\CheckoutsCustomGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -484,7 +495,9 @@ public function get(string $id): Operations\CheckoutsCustomGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -500,40 +513,36 @@ public function get(string $id): Operations\CheckoutsCustomGetResponse * @return Operations\CheckoutsCustomListResponse * @throws \Polar\Models\Errors\APIException */ - private function listIndividual(?Operations\CheckoutsCustomListRequest $request = null): Operations\CheckoutsCustomListResponse + private function listIndividual(?Operations\CheckoutsCustomListRequest $request = null, ?Options $options = null): Operations\CheckoutsCustomListResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/checkouts/custom/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $qp = Utils\Utils::getQueryParams(Operations\CheckoutsCustomListRequest::class, $request, $urlOverride); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('checkouts:custom:list', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -588,7 +597,7 @@ private function listIndividual(?Operations\CheckoutsCustomListRequest $request } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -599,7 +608,9 @@ private function listIndividual(?Operations\CheckoutsCustomListRequest $request } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -614,9 +625,9 @@ private function listIndividual(?Operations\CheckoutsCustomListRequest $request * @return \Generator * @throws \Polar\Models\Errors\APIException */ - public function list(?Operations\CheckoutsCustomListRequest $request = null): \Generator + public function list(?Operations\CheckoutsCustomListRequest $request = null, ?Options $options = null): \Generator { - $res = $this->listIndividual($request); + $res = $this->listIndividual($request, $options); while ($res !== null) { yield $res; $res = $res->next($res); @@ -633,7 +644,7 @@ public function list(?Operations\CheckoutsCustomListRequest $request = null): \G * @return Operations\CheckoutsCustomUpdateResponse * @throws \Polar\Models\Errors\APIException */ - public function update(Components\CheckoutUpdate $checkoutUpdate, string $id): Operations\CheckoutsCustomUpdateResponse + public function update(Components\CheckoutUpdate $checkoutUpdate, string $id, ?Options $options = null): Operations\CheckoutsCustomUpdateResponse { $request = new Operations\CheckoutsCustomUpdateRequest( id: $id, @@ -642,37 +653,33 @@ public function update(Components\CheckoutUpdate $checkoutUpdate, string $id): O $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/checkouts/custom/{id}', Operations\CheckoutsCustomUpdateRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'checkoutUpdate', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); $hookContext = new HookContext('checkouts:custom:update', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -689,7 +696,18 @@ public function update(Components\CheckoutUpdate $checkoutUpdate, string $id): O } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\AlreadyActiveSubscriptionError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -700,7 +718,7 @@ public function update(Components\CheckoutUpdate $checkoutUpdate, string $id): O } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -711,7 +729,9 @@ public function update(Components\CheckoutUpdate $checkoutUpdate, string $id): O } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/CustomFields.php b/src/CustomFields.php index 4a4bd64..e9f6b18 100644 --- a/src/CustomFields.php +++ b/src/CustomFields.php @@ -11,6 +11,7 @@ use Polar\Hooks\HookContext; use Polar\Models\Components; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class CustomFields @@ -53,42 +54,38 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\CustomFieldsCreateResponse * @throws \Polar\Models\Errors\APIException */ - public function create(Components\CustomFieldCreateText|Components\CustomFieldCreateNumber|Components\CustomFieldCreateDate|Components\CustomFieldCreateCheckbox|Components\CustomFieldCreateSelect $request): Operations\CustomFieldsCreateResponse + public function create(Components\CustomFieldCreateText|Components\CustomFieldCreateNumber|Components\CustomFieldCreateDate|Components\CustomFieldCreateCheckbox|Components\CustomFieldCreateSelect $request, ?Options $options = null): Operations\CustomFieldsCreateResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/custom-fields/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); $hookContext = new HookContext('custom-fields:create', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 201) { + if (Utils\Utils::matchStatusCodes($statusCode, ['201'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -105,7 +102,7 @@ public function create(Components\CustomFieldCreateText|Components\CustomFieldCr } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -116,7 +113,9 @@ public function create(Components\CustomFieldCreateText|Components\CustomFieldCr } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -132,7 +131,7 @@ public function create(Components\CustomFieldCreateText|Components\CustomFieldCr * @return Operations\CustomFieldsDeleteResponse * @throws \Polar\Models\Errors\APIException */ - public function delete(string $id): Operations\CustomFieldsDeleteResponse + public function delete(string $id, ?Options $options = null): Operations\CustomFieldsDeleteResponse { $request = new Operations\CustomFieldsDeleteRequest( id: $id, @@ -140,32 +139,28 @@ public function delete(string $id): Operations\CustomFieldsDeleteResponse $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/custom-fields/{id}', Operations\CustomFieldsDeleteRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('DELETE', $url); $hookContext = new HookContext('custom-fields:delete', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 204) { + if (Utils\Utils::matchStatusCodes($statusCode, ['204'])) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); return new Operations\CustomFieldsDeleteResponse( @@ -173,7 +168,7 @@ public function delete(string $id): Operations\CustomFieldsDeleteResponse contentType: $contentType, rawResponse: $httpResponse ); - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -184,7 +179,7 @@ public function delete(string $id): Operations\CustomFieldsDeleteResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -195,7 +190,9 @@ public function delete(string $id): Operations\CustomFieldsDeleteResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -211,7 +208,7 @@ public function delete(string $id): Operations\CustomFieldsDeleteResponse * @return Operations\CustomFieldsGetResponse * @throws \Polar\Models\Errors\APIException */ - public function get(string $id): Operations\CustomFieldsGetResponse + public function get(string $id, ?Options $options = null): Operations\CustomFieldsGetResponse { $request = new Operations\CustomFieldsGetRequest( id: $id, @@ -219,32 +216,28 @@ public function get(string $id): Operations\CustomFieldsGetResponse $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/custom-fields/{id}', Operations\CustomFieldsGetRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('custom-fields:get', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -261,7 +254,7 @@ public function get(string $id): Operations\CustomFieldsGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -272,7 +265,7 @@ public function get(string $id): Operations\CustomFieldsGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -283,7 +276,9 @@ public function get(string $id): Operations\CustomFieldsGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -299,40 +294,36 @@ public function get(string $id): Operations\CustomFieldsGetResponse * @return Operations\CustomFieldsListResponse * @throws \Polar\Models\Errors\APIException */ - private function listIndividual(?Operations\CustomFieldsListRequest $request = null): Operations\CustomFieldsListResponse + private function listIndividual(?Operations\CustomFieldsListRequest $request = null, ?Options $options = null): Operations\CustomFieldsListResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/custom-fields/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $qp = Utils\Utils::getQueryParams(Operations\CustomFieldsListRequest::class, $request, $urlOverride); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('custom-fields:list', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -388,7 +379,7 @@ private function listIndividual(?Operations\CustomFieldsListRequest $request = n } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -399,7 +390,9 @@ private function listIndividual(?Operations\CustomFieldsListRequest $request = n } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -414,9 +407,9 @@ private function listIndividual(?Operations\CustomFieldsListRequest $request = n * @return \Generator * @throws \Polar\Models\Errors\APIException */ - public function list(?Operations\CustomFieldsListRequest $request = null): \Generator + public function list(?Operations\CustomFieldsListRequest $request = null, ?Options $options = null): \Generator { - $res = $this->listIndividual($request); + $res = $this->listIndividual($request, $options); while ($res !== null) { yield $res; $res = $res->next($res); @@ -433,7 +426,7 @@ public function list(?Operations\CustomFieldsListRequest $request = null): \Gene * @return Operations\CustomFieldsUpdateResponse * @throws \Polar\Models\Errors\APIException */ - public function update(Components\CustomFieldUpdateText|Components\CustomFieldUpdateNumber|Components\CustomFieldUpdateDate|Components\CustomFieldUpdateCheckbox|Components\CustomFieldUpdateSelect $customFieldUpdate, string $id): Operations\CustomFieldsUpdateResponse + public function update(Components\CustomFieldUpdateText|Components\CustomFieldUpdateNumber|Components\CustomFieldUpdateDate|Components\CustomFieldUpdateCheckbox|Components\CustomFieldUpdateSelect $customFieldUpdate, string $id, ?Options $options = null): Operations\CustomFieldsUpdateResponse { $request = new Operations\CustomFieldsUpdateRequest( id: $id, @@ -442,37 +435,33 @@ public function update(Components\CustomFieldUpdateText|Components\CustomFieldUp $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/custom-fields/{id}', Operations\CustomFieldsUpdateRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'customFieldUpdate', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); $hookContext = new HookContext('custom-fields:update', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -489,7 +478,7 @@ public function update(Components\CustomFieldUpdateText|Components\CustomFieldUp } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -500,7 +489,7 @@ public function update(Components\CustomFieldUpdateText|Components\CustomFieldUp } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -511,7 +500,9 @@ public function update(Components\CustomFieldUpdateText|Components\CustomFieldUp } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/CustomerSessions.php b/src/CustomerSessions.php index cb03d02..971470b 100644 --- a/src/CustomerSessions.php +++ b/src/CustomerSessions.php @@ -11,6 +11,7 @@ use Polar\Hooks\HookContext; use Polar\Models\Components; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class CustomerSessions @@ -53,42 +54,38 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\CustomerSessionsCreateResponse * @throws \Polar\Models\Errors\APIException */ - public function create(Components\CustomerSessionCreate $request): Operations\CustomerSessionsCreateResponse + public function create(Components\CustomerSessionCreate $request, ?Options $options = null): Operations\CustomerSessionsCreateResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/customer-sessions/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); $hookContext = new HookContext('customer-sessions:create', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 201) { + if (Utils\Utils::matchStatusCodes($statusCode, ['201'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -105,7 +102,7 @@ public function create(Components\CustomerSessionCreate $request): Operations\Cu } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -116,7 +113,9 @@ public function create(Components\CustomerSessionCreate $request): Operations\Cu } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/Customers.php b/src/Customers.php index 410638b..f1c2b07 100644 --- a/src/Customers.php +++ b/src/Customers.php @@ -11,6 +11,7 @@ use Polar\Hooks\HookContext; use Polar\Models\Components; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class Customers @@ -53,42 +54,38 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\CustomersCreateResponse * @throws \Polar\Models\Errors\APIException */ - public function create(Components\CustomerCreate $request): Operations\CustomersCreateResponse + public function create(Components\CustomerCreate $request, ?Options $options = null): Operations\CustomersCreateResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/customers/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); $hookContext = new HookContext('customers:create', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 201) { + if (Utils\Utils::matchStatusCodes($statusCode, ['201'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -105,7 +102,7 @@ public function create(Components\CustomerCreate $request): Operations\Customers } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -116,7 +113,9 @@ public function create(Components\CustomerCreate $request): Operations\Customers } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -134,7 +133,7 @@ public function create(Components\CustomerCreate $request): Operations\Customers * @return Operations\CustomersDeleteResponse * @throws \Polar\Models\Errors\APIException */ - public function delete(string $id): Operations\CustomersDeleteResponse + public function delete(string $id, ?Options $options = null): Operations\CustomersDeleteResponse { $request = new Operations\CustomersDeleteRequest( id: $id, @@ -142,32 +141,28 @@ public function delete(string $id): Operations\CustomersDeleteResponse $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/customers/{id}', Operations\CustomersDeleteRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('DELETE', $url); $hookContext = new HookContext('customers:delete', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 204) { + if (Utils\Utils::matchStatusCodes($statusCode, ['204'])) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); return new Operations\CustomersDeleteResponse( @@ -175,7 +170,7 @@ public function delete(string $id): Operations\CustomersDeleteResponse contentType: $contentType, rawResponse: $httpResponse ); - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -186,7 +181,7 @@ public function delete(string $id): Operations\CustomersDeleteResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -197,7 +192,9 @@ public function delete(string $id): Operations\CustomersDeleteResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -213,7 +210,7 @@ public function delete(string $id): Operations\CustomersDeleteResponse * @return Operations\CustomersGetResponse * @throws \Polar\Models\Errors\APIException */ - public function get(string $id): Operations\CustomersGetResponse + public function get(string $id, ?Options $options = null): Operations\CustomersGetResponse { $request = new Operations\CustomersGetRequest( id: $id, @@ -221,32 +218,28 @@ public function get(string $id): Operations\CustomersGetResponse $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/customers/{id}', Operations\CustomersGetRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('customers:get', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -263,7 +256,7 @@ public function get(string $id): Operations\CustomersGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -274,7 +267,7 @@ public function get(string $id): Operations\CustomersGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -285,7 +278,9 @@ public function get(string $id): Operations\CustomersGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -301,40 +296,36 @@ public function get(string $id): Operations\CustomersGetResponse * @return Operations\CustomersListResponse * @throws \Polar\Models\Errors\APIException */ - private function listIndividual(?Operations\CustomersListRequest $request = null): Operations\CustomersListResponse + private function listIndividual(?Operations\CustomersListRequest $request = null, ?Options $options = null): Operations\CustomersListResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/customers/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $qp = Utils\Utils::getQueryParams(Operations\CustomersListRequest::class, $request, $urlOverride); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('customers:list', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -376,10 +367,12 @@ private function listIndividual(?Operations\CustomersListRequest $request = null return $sdk->listIndividual( request: new Operations\CustomersListRequest( organizationId: $request != null ? $request->organizationId : null, + email: $request != null ? $request->email : null, query: $request != null ? $request->query : null, page: $nextPage, limit: $request != null ? $request->limit : null, sorting: $request != null ? $request->sorting : null, + metadata: $request != null ? $request->metadata : null, ), ); }; @@ -389,7 +382,7 @@ private function listIndividual(?Operations\CustomersListRequest $request = null } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -400,7 +393,9 @@ private function listIndividual(?Operations\CustomersListRequest $request = null } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -415,9 +410,9 @@ private function listIndividual(?Operations\CustomersListRequest $request = null * @return \Generator * @throws \Polar\Models\Errors\APIException */ - public function list(?Operations\CustomersListRequest $request = null): \Generator + public function list(?Operations\CustomersListRequest $request = null, ?Options $options = null): \Generator { - $res = $this->listIndividual($request); + $res = $this->listIndividual($request, $options); while ($res !== null) { yield $res; $res = $res->next($res); @@ -434,7 +429,7 @@ public function list(?Operations\CustomersListRequest $request = null): \Generat * @return Operations\CustomersUpdateResponse * @throws \Polar\Models\Errors\APIException */ - public function update(Components\CustomerUpdate $customerUpdate, string $id): Operations\CustomersUpdateResponse + public function update(Components\CustomerUpdate $customerUpdate, string $id, ?Options $options = null): Operations\CustomersUpdateResponse { $request = new Operations\CustomersUpdateRequest( id: $id, @@ -443,37 +438,33 @@ public function update(Components\CustomerUpdate $customerUpdate, string $id): O $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/customers/{id}', Operations\CustomersUpdateRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'customerUpdate', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); $hookContext = new HookContext('customers:update', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -490,7 +481,7 @@ public function update(Components\CustomerUpdate $customerUpdate, string $id): O } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -501,7 +492,7 @@ public function update(Components\CustomerUpdate $customerUpdate, string $id): O } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -512,7 +503,9 @@ public function update(Components\CustomerUpdate $customerUpdate, string $id): O } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/Discounts.php b/src/Discounts.php index 3f60299..fc79b12 100644 --- a/src/Discounts.php +++ b/src/Discounts.php @@ -11,6 +11,7 @@ use Polar\Hooks\HookContext; use Polar\Models\Components; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class Discounts @@ -53,42 +54,38 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\DiscountsCreateResponse * @throws \Polar\Models\Errors\APIException */ - public function create(Components\DiscountFixedOnceForeverDurationCreate|Components\DiscountFixedRepeatDurationCreate|Components\DiscountPercentageOnceForeverDurationCreate|Components\DiscountPercentageRepeatDurationCreate $request): Operations\DiscountsCreateResponse + public function create(Components\DiscountFixedOnceForeverDurationCreate|Components\DiscountFixedRepeatDurationCreate|Components\DiscountPercentageOnceForeverDurationCreate|Components\DiscountPercentageRepeatDurationCreate $request, ?Options $options = null): Operations\DiscountsCreateResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/discounts/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); $hookContext = new HookContext('discounts:create', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 201) { + if (Utils\Utils::matchStatusCodes($statusCode, ['201'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -105,7 +102,7 @@ public function create(Components\DiscountFixedOnceForeverDurationCreate|Compone } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -116,7 +113,9 @@ public function create(Components\DiscountFixedOnceForeverDurationCreate|Compone } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -132,7 +131,7 @@ public function create(Components\DiscountFixedOnceForeverDurationCreate|Compone * @return Operations\DiscountsDeleteResponse * @throws \Polar\Models\Errors\APIException */ - public function delete(string $id): Operations\DiscountsDeleteResponse + public function delete(string $id, ?Options $options = null): Operations\DiscountsDeleteResponse { $request = new Operations\DiscountsDeleteRequest( id: $id, @@ -140,32 +139,28 @@ public function delete(string $id): Operations\DiscountsDeleteResponse $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/discounts/{id}', Operations\DiscountsDeleteRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('DELETE', $url); $hookContext = new HookContext('discounts:delete', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 204) { + if (Utils\Utils::matchStatusCodes($statusCode, ['204'])) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); return new Operations\DiscountsDeleteResponse( @@ -173,7 +168,7 @@ public function delete(string $id): Operations\DiscountsDeleteResponse contentType: $contentType, rawResponse: $httpResponse ); - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -184,7 +179,7 @@ public function delete(string $id): Operations\DiscountsDeleteResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -195,7 +190,9 @@ public function delete(string $id): Operations\DiscountsDeleteResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -211,7 +208,7 @@ public function delete(string $id): Operations\DiscountsDeleteResponse * @return Operations\DiscountsGetResponse * @throws \Polar\Models\Errors\APIException */ - public function get(string $id): Operations\DiscountsGetResponse + public function get(string $id, ?Options $options = null): Operations\DiscountsGetResponse { $request = new Operations\DiscountsGetRequest( id: $id, @@ -219,32 +216,28 @@ public function get(string $id): Operations\DiscountsGetResponse $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/discounts/{id}', Operations\DiscountsGetRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('discounts:get', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -261,7 +254,7 @@ public function get(string $id): Operations\DiscountsGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -272,7 +265,7 @@ public function get(string $id): Operations\DiscountsGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -283,7 +276,9 @@ public function get(string $id): Operations\DiscountsGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -299,40 +294,36 @@ public function get(string $id): Operations\DiscountsGetResponse * @return Operations\DiscountsListResponse * @throws \Polar\Models\Errors\APIException */ - private function listIndividual(?Operations\DiscountsListRequest $request = null): Operations\DiscountsListResponse + private function listIndividual(?Operations\DiscountsListRequest $request = null, ?Options $options = null): Operations\DiscountsListResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/discounts/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $qp = Utils\Utils::getQueryParams(Operations\DiscountsListRequest::class, $request, $urlOverride); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('discounts:list', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -387,7 +378,7 @@ private function listIndividual(?Operations\DiscountsListRequest $request = null } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -398,7 +389,9 @@ private function listIndividual(?Operations\DiscountsListRequest $request = null } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -413,9 +406,9 @@ private function listIndividual(?Operations\DiscountsListRequest $request = null * @return \Generator * @throws \Polar\Models\Errors\APIException */ - public function list(?Operations\DiscountsListRequest $request = null): \Generator + public function list(?Operations\DiscountsListRequest $request = null, ?Options $options = null): \Generator { - $res = $this->listIndividual($request); + $res = $this->listIndividual($request, $options); while ($res !== null) { yield $res; $res = $res->next($res); @@ -432,7 +425,7 @@ public function list(?Operations\DiscountsListRequest $request = null): \Generat * @return Operations\DiscountsUpdateResponse * @throws \Polar\Models\Errors\APIException */ - public function update(Components\DiscountUpdate $discountUpdate, string $id): Operations\DiscountsUpdateResponse + public function update(Components\DiscountUpdate $discountUpdate, string $id, ?Options $options = null): Operations\DiscountsUpdateResponse { $request = new Operations\DiscountsUpdateRequest( id: $id, @@ -441,37 +434,33 @@ public function update(Components\DiscountUpdate $discountUpdate, string $id): O $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/discounts/{id}', Operations\DiscountsUpdateRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'discountUpdate', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); $hookContext = new HookContext('discounts:update', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -488,7 +477,7 @@ public function update(Components\DiscountUpdate $discountUpdate, string $id): O } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -499,7 +488,7 @@ public function update(Components\DiscountUpdate $discountUpdate, string $id): O } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -510,7 +499,9 @@ public function update(Components\DiscountUpdate $discountUpdate, string $id): O } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/Downloadables.php b/src/Downloadables.php index 0705bb4..e321bb1 100644 --- a/src/Downloadables.php +++ b/src/Downloadables.php @@ -10,6 +10,7 @@ use Polar\Hooks\HookContext; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class Downloadables @@ -50,7 +51,7 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\CustomerPortalDownloadablesCustomerPortalDownloadablesGetResponse * @throws \Polar\Models\Errors\APIException */ - public function get(string $token): Operations\CustomerPortalDownloadablesCustomerPortalDownloadablesGetResponse + public function get(string $token, ?Options $options = null): Operations\CustomerPortalDownloadablesCustomerPortalDownloadablesGetResponse { $request = new Operations\CustomerPortalDownloadablesCustomerPortalDownloadablesGetRequest( token: $token, @@ -58,32 +59,28 @@ public function get(string $token): Operations\CustomerPortalDownloadablesCustom $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/customer-portal/downloadables/{token}', Operations\CustomerPortalDownloadablesCustomerPortalDownloadablesGetRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('customer_portal:downloadables:customer_portal.downloadables.get', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 400 || $statusCode == 404 || $statusCode == 410 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '404', '410', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -100,7 +97,7 @@ public function get(string $token): Operations\CustomerPortalDownloadablesCustom } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 302) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['302'])) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); return new Operations\CustomerPortalDownloadablesCustomerPortalDownloadablesGetResponse( @@ -108,9 +105,7 @@ public function get(string $token): Operations\CustomerPortalDownloadablesCustom contentType: $contentType, rawResponse: $httpResponse ); - } elseif ($statusCode == 400 || $statusCode == 404 || $statusCode == 410 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { - throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -121,6 +116,10 @@ public function get(string $token): Operations\CustomerPortalDownloadablesCustom } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '404', '410', '4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } @@ -136,7 +135,7 @@ public function get(string $token): Operations\CustomerPortalDownloadablesCustom * @return Operations\CustomerPortalDownloadablesListResponse * @throws \Polar\Models\Errors\APIException */ - private function listIndividual(string|array|null $organizationId = null, string|array|null $benefitId = null, ?int $page = null, ?int $limit = null): Operations\CustomerPortalDownloadablesListResponse + private function listIndividual(string|array|null $organizationId = null, string|array|null $benefitId = null, ?int $page = null, ?int $limit = null, ?Options $options = null): Operations\CustomerPortalDownloadablesListResponse { $request = new Operations\CustomerPortalDownloadablesListRequest( organizationId: $organizationId, @@ -147,35 +146,31 @@ private function listIndividual(string|array|null $organizationId = null, string $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/customer-portal/downloadables/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $qp = Utils\Utils::getQueryParams(Operations\CustomerPortalDownloadablesListRequest::class, $request, $urlOverride); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('customer_portal:downloadables:list', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -227,7 +222,7 @@ private function listIndividual(string|array|null $organizationId = null, string } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -238,7 +233,9 @@ private function listIndividual(string|array|null $organizationId = null, string } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -254,9 +251,9 @@ private function listIndividual(string|array|null $organizationId = null, string * @return \Generator * @throws \Polar\Models\Errors\APIException */ - public function list(string|array|null $organizationId = null, string|array|null $benefitId = null, ?int $page = null, ?int $limit = null): \Generator + public function list(string|array|null $organizationId = null, string|array|null $benefitId = null, ?int $page = null, ?int $limit = null, ?Options $options = null): \Generator { - $res = $this->listIndividual($organizationId, $benefitId, $page, $limit); + $res = $this->listIndividual($organizationId, $benefitId, $page, $limit, $options); while ($res !== null) { yield $res; $res = $res->next($res); diff --git a/src/Events.php b/src/Events.php new file mode 100644 index 0000000..86fce0a --- /dev/null +++ b/src/Events.php @@ -0,0 +1,346 @@ +sdkConfiguration = $sdkConfig; + } + /** + * @param string $baseUrl + * @param array $urlVariables + * + * @return string + */ + public function getUrl(string $baseUrl, array $urlVariables): string + { + $serverDetails = $this->sdkConfiguration->getServerDetails(); + + if ($baseUrl == null) { + $baseUrl = $serverDetails->baseUrl; + } + + if ($urlVariables == null) { + $urlVariables = $serverDetails->options; + } + + return Utils\Utils::templateUrl($baseUrl, $urlVariables); + } + + /** + * Get Event + * + * Get an event by ID. + * + * @param string $id + * @return Operations\EventsGetResponse + * @throws \Polar\Models\Errors\APIException + */ + public function get(string $id, ?Options $options = null): Operations\EventsGetResponse + { + $request = new Operations\EventsGetRequest( + id: $id, + ); + $baseUrl = $this->sdkConfiguration->getServerUrl(); + $url = Utils\Utils::generateUrl($baseUrl, '/v1/events/{id}', Operations\EventsGetRequest::class, $request); + $urlOverride = null; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('events:get', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + $httpResponse = $res; + } + $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; + + $statusCode = $httpResponse->getStatusCode(); + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + $httpResponse = $res; + } + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Components\Event', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\EventsGetResponse( + statusCode: $statusCode, + contentType: $contentType, + rawResponse: $httpResponse, + event: $obj); + + return $response; + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\ResourceNotFound', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\HTTPValidationError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } + + /** + * Ingest Events + * + * Ingest batch of events. + * + * @param Components\EventsIngest $request + * @return Operations\EventsIngestResponse + * @throws \Polar\Models\Errors\APIException + */ + public function ingest(Components\EventsIngest $request, ?Options $options = null): Operations\EventsIngestResponse + { + $baseUrl = $this->sdkConfiguration->getServerUrl(); + $url = Utils\Utils::generateUrl($baseUrl, '/v1/events/ingest'); + $urlOverride = null; + $httpOptions = ['http_errors' => false]; + $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); + if ($body === null) { + throw new \Exception('Request body is required'); + } + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('events:ingest', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + $httpResponse = $res; + } + $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; + + $statusCode = $httpResponse->getStatusCode(); + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + $httpResponse = $res; + } + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Components\EventsIngestResponse', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\EventsIngestResponse( + statusCode: $statusCode, + contentType: $contentType, + rawResponse: $httpResponse, + eventsIngestResponse: $obj); + + return $response; + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\HTTPValidationError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } + + /** + * List Events + * + * List events. + * + * @param ?Operations\EventsListRequest $request + * @return Operations\EventsListResponse + * @throws \Polar\Models\Errors\APIException + */ + private function listIndividual(?Operations\EventsListRequest $request = null, ?Options $options = null): Operations\EventsListResponse + { + $baseUrl = $this->sdkConfiguration->getServerUrl(); + $url = Utils\Utils::generateUrl($baseUrl, '/v1/events/'); + $urlOverride = null; + $httpOptions = ['http_errors' => false]; + + $qp = Utils\Utils::getQueryParams(Operations\EventsListRequest::class, $request, $urlOverride); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('events:list', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + $httpResponse = $res; + } + $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; + + $statusCode = $httpResponse->getStatusCode(); + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + $httpResponse = $res; + } + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Components\ListResourceEvent', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\EventsListResponse( + statusCode: $statusCode, + contentType: $contentType, + rawResponse: $httpResponse, + listResourceEvent: $obj); + $sdk = $this; + + $response->next = function () use ($sdk, $request, $responseData): ?Operations\EventsListResponse { + $page = $request != null ? $request->page : 0; + $nextPage = $page + 1; + $jsonObject = new \JsonPath\JsonObject($responseData); + $numPages = $jsonObject->get('$.pagination.max_page'); + if ($numPages == null || $numPages[0] <= $page) { + return null; + } + if (! $responseData) { + return null; + } + $jsonObject = new \JsonPath\JsonObject($responseData); + $results = $jsonObject->get('$.items'); + + if (is_array($results)) { + $results = $results[0]; + } + if (count($results) === 0) { + return null; + } + $limit = $request != null ? $request->limit : 0; + if (count($results) < $limit) { + return null; + } + + return $sdk->listIndividual( + request: new Operations\EventsListRequest( + startTimestamp: $request != null ? $request->startTimestamp : null, + endTimestamp: $request != null ? $request->endTimestamp : null, + organizationId: $request != null ? $request->organizationId : null, + customerId: $request != null ? $request->customerId : null, + externalCustomerId: $request != null ? $request->externalCustomerId : null, + source: $request != null ? $request->source : null, + page: $nextPage, + limit: $request != null ? $request->limit : null, + sorting: $request != null ? $request->sorting : null, + metadata: $request != null ? $request->metadata : null, + ), + ); + }; + + + return $response; + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\HTTPValidationError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } + /** + * List Events + * + * List events. + * + * @param ?Operations\EventsListRequest $request + * @return \Generator + * @throws \Polar\Models\Errors\APIException + */ + public function list(?Operations\EventsListRequest $request = null, ?Options $options = null): \Generator + { + $res = $this->listIndividual($request, $options); + while ($res !== null) { + yield $res; + $res = $res->next($res); + } + } + +} \ No newline at end of file diff --git a/src/ExternalOrganizations.php b/src/ExternalOrganizations.php index 0447d75..097f0e9 100644 --- a/src/ExternalOrganizations.php +++ b/src/ExternalOrganizations.php @@ -9,8 +9,8 @@ namespace Polar; use Polar\Hooks\HookContext; -use Polar\Models\Components; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class ExternalOrganizations @@ -53,40 +53,36 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\ExternalOrganizationsListResponse * @throws \Polar\Models\Errors\APIException */ - private function listIndividual(?Operations\ExternalOrganizationsListRequest $request = null): Operations\ExternalOrganizationsListResponse + private function listIndividual(?Operations\ExternalOrganizationsListRequest $request = null, ?Options $options = null): Operations\ExternalOrganizationsListResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/external_organizations/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $qp = Utils\Utils::getQueryParams(Operations\ExternalOrganizationsListRequest::class, $request, $urlOverride); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('external_organizations:list', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -142,7 +138,7 @@ private function listIndividual(?Operations\ExternalOrganizationsListRequest $re } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -153,7 +149,9 @@ private function listIndividual(?Operations\ExternalOrganizationsListRequest $re } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -168,9 +166,9 @@ private function listIndividual(?Operations\ExternalOrganizationsListRequest $re * @return \Generator * @throws \Polar\Models\Errors\APIException */ - public function list(?Operations\ExternalOrganizationsListRequest $request = null): \Generator + public function list(?Operations\ExternalOrganizationsListRequest $request = null, ?Options $options = null): \Generator { - $res = $this->listIndividual($request); + $res = $this->listIndividual($request, $options); while ($res !== null) { yield $res; $res = $res->next($res); diff --git a/src/Files.php b/src/Files.php index a6a63a0..6c10ae8 100644 --- a/src/Files.php +++ b/src/Files.php @@ -11,6 +11,7 @@ use Polar\Hooks\HookContext; use Polar\Models\Components; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class Files @@ -53,42 +54,38 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\FilesCreateResponse * @throws \Polar\Models\Errors\APIException */ - public function create(Components\DownloadableFileCreate|Components\ProductMediaFileCreate|Components\OrganizationAvatarFileCreate $request): Operations\FilesCreateResponse + public function create(Components\DownloadableFileCreate|Components\ProductMediaFileCreate|Components\OrganizationAvatarFileCreate $request, ?Options $options = null): Operations\FilesCreateResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/files/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); $hookContext = new HookContext('files:create', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 201) { + if (Utils\Utils::matchStatusCodes($statusCode, ['201'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -105,7 +102,7 @@ public function create(Components\DownloadableFileCreate|Components\ProductMedia } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -116,7 +113,9 @@ public function create(Components\DownloadableFileCreate|Components\ProductMedia } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -132,7 +131,7 @@ public function create(Components\DownloadableFileCreate|Components\ProductMedia * @return Operations\FilesDeleteResponse * @throws \Polar\Models\Errors\APIException */ - public function delete(string $id): Operations\FilesDeleteResponse + public function delete(string $id, ?Options $options = null): Operations\FilesDeleteResponse { $request = new Operations\FilesDeleteRequest( id: $id, @@ -140,32 +139,28 @@ public function delete(string $id): Operations\FilesDeleteResponse $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/files/{id}', Operations\FilesDeleteRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('DELETE', $url); $hookContext = new HookContext('files:delete', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 403 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 204) { + if (Utils\Utils::matchStatusCodes($statusCode, ['204'])) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); return new Operations\FilesDeleteResponse( @@ -173,7 +168,7 @@ public function delete(string $id): Operations\FilesDeleteResponse contentType: $contentType, rawResponse: $httpResponse ); - } elseif ($statusCode == 403) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -184,7 +179,7 @@ public function delete(string $id): Operations\FilesDeleteResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -195,7 +190,7 @@ public function delete(string $id): Operations\FilesDeleteResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -206,7 +201,9 @@ public function delete(string $id): Operations\FilesDeleteResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -225,7 +222,7 @@ public function delete(string $id): Operations\FilesDeleteResponse * @return Operations\FilesListResponse * @throws \Polar\Models\Errors\APIException */ - private function listIndividual(?string $organizationId = null, ?array $ids = null, ?int $page = null, ?int $limit = null): Operations\FilesListResponse + private function listIndividual(?string $organizationId = null, ?array $ids = null, ?int $page = null, ?int $limit = null, ?Options $options = null): Operations\FilesListResponse { $request = new Operations\FilesListRequest( organizationId: $organizationId, @@ -236,35 +233,31 @@ private function listIndividual(?string $organizationId = null, ?array $ids = nu $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/files/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $qp = Utils\Utils::getQueryParams(Operations\FilesListRequest::class, $request, $urlOverride); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('files:list', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -316,7 +309,7 @@ private function listIndividual(?string $organizationId = null, ?array $ids = nu } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -327,7 +320,9 @@ private function listIndividual(?string $organizationId = null, ?array $ids = nu } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -345,9 +340,9 @@ private function listIndividual(?string $organizationId = null, ?array $ids = nu * @return \Generator * @throws \Polar\Models\Errors\APIException */ - public function list(?string $organizationId = null, ?array $ids = null, ?int $page = null, ?int $limit = null): \Generator + public function list(?string $organizationId = null, ?array $ids = null, ?int $page = null, ?int $limit = null, ?Options $options = null): \Generator { - $res = $this->listIndividual($organizationId, $ids, $page, $limit); + $res = $this->listIndividual($organizationId, $ids, $page, $limit, $options); while ($res !== null) { yield $res; $res = $res->next($res); @@ -364,7 +359,7 @@ public function list(?string $organizationId = null, ?array $ids = null, ?int $p * @return Operations\FilesUpdateResponse * @throws \Polar\Models\Errors\APIException */ - public function update(Components\FilePatch $filePatch, string $id): Operations\FilesUpdateResponse + public function update(Components\FilePatch $filePatch, string $id, ?Options $options = null): Operations\FilesUpdateResponse { $request = new Operations\FilesUpdateRequest( id: $id, @@ -373,37 +368,33 @@ public function update(Components\FilePatch $filePatch, string $id): Operations\ $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/files/{id}', Operations\FilesUpdateRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'filePatch', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); $hookContext = new HookContext('files:update', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 403 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -420,7 +411,7 @@ public function update(Components\FilePatch $filePatch, string $id): Operations\ } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 403) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -431,7 +422,7 @@ public function update(Components\FilePatch $filePatch, string $id): Operations\ } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -442,7 +433,7 @@ public function update(Components\FilePatch $filePatch, string $id): Operations\ } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -453,7 +444,9 @@ public function update(Components\FilePatch $filePatch, string $id): Operations\ } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -470,7 +463,7 @@ public function update(Components\FilePatch $filePatch, string $id): Operations\ * @return Operations\FilesUploadedResponse * @throws \Polar\Models\Errors\APIException */ - public function uploaded(Components\FileUploadCompleted $fileUploadCompleted, string $id): Operations\FilesUploadedResponse + public function uploaded(Components\FileUploadCompleted $fileUploadCompleted, string $id, ?Options $options = null): Operations\FilesUploadedResponse { $request = new Operations\FilesUploadedRequest( id: $id, @@ -479,37 +472,33 @@ public function uploaded(Components\FileUploadCompleted $fileUploadCompleted, st $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/files/{id}/uploaded', Operations\FilesUploadedRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'fileUploadCompleted', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); $hookContext = new HookContext('files:uploaded', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 403 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -526,7 +515,7 @@ public function uploaded(Components\FileUploadCompleted $fileUploadCompleted, st } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 403) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -537,7 +526,7 @@ public function uploaded(Components\FileUploadCompleted $fileUploadCompleted, st } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -548,7 +537,7 @@ public function uploaded(Components\FileUploadCompleted $fileUploadCompleted, st } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -559,7 +548,9 @@ public function uploaded(Components\FileUploadCompleted $fileUploadCompleted, st } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/LicenseKeys.php b/src/LicenseKeys.php index ae34eb1..38830d8 100644 --- a/src/LicenseKeys.php +++ b/src/LicenseKeys.php @@ -11,6 +11,7 @@ use Polar\Hooks\HookContext; use Polar\Models\Components; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class LicenseKeys @@ -53,7 +54,7 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\LicenseKeysGetResponse * @throws \Polar\Models\Errors\APIException */ - public function get(string $id): Operations\LicenseKeysGetResponse + public function get(string $id, ?Options $options = null): Operations\LicenseKeysGetResponse { $request = new Operations\LicenseKeysGetRequest( id: $id, @@ -61,32 +62,28 @@ public function get(string $id): Operations\LicenseKeysGetResponse $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/license-keys/{id}', Operations\LicenseKeysGetRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('license_keys:get', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 401 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['401', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -103,7 +100,7 @@ public function get(string $id): Operations\LicenseKeysGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 401) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -114,7 +111,7 @@ public function get(string $id): Operations\LicenseKeysGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -125,7 +122,7 @@ public function get(string $id): Operations\LicenseKeysGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -136,7 +133,9 @@ public function get(string $id): Operations\LicenseKeysGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -153,7 +152,7 @@ public function get(string $id): Operations\LicenseKeysGetResponse * @return Operations\LicenseKeysGetActivationResponse * @throws \Polar\Models\Errors\APIException */ - public function getActivation(string $id, string $activationId): Operations\LicenseKeysGetActivationResponse + public function getActivation(string $id, string $activationId, ?Options $options = null): Operations\LicenseKeysGetActivationResponse { $request = new Operations\LicenseKeysGetActivationRequest( id: $id, @@ -162,32 +161,28 @@ public function getActivation(string $id, string $activationId): Operations\Lice $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/license-keys/{id}/activations/{activation_id}', Operations\LicenseKeysGetActivationRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('license_keys:get_activation', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 401 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['401', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -204,7 +199,7 @@ public function getActivation(string $id, string $activationId): Operations\Lice } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 401) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -215,7 +210,7 @@ public function getActivation(string $id, string $activationId): Operations\Lice } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -226,7 +221,7 @@ public function getActivation(string $id, string $activationId): Operations\Lice } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -237,7 +232,9 @@ public function getActivation(string $id, string $activationId): Operations\Lice } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -256,7 +253,7 @@ public function getActivation(string $id, string $activationId): Operations\Lice * @return Operations\LicenseKeysListResponse * @throws \Polar\Models\Errors\APIException */ - private function listIndividual(string|array|null $organizationId = null, string|array|null $benefitId = null, ?int $page = null, ?int $limit = null): Operations\LicenseKeysListResponse + private function listIndividual(string|array|null $organizationId = null, string|array|null $benefitId = null, ?int $page = null, ?int $limit = null, ?Options $options = null): Operations\LicenseKeysListResponse { $request = new Operations\LicenseKeysListRequest( organizationId: $organizationId, @@ -267,35 +264,31 @@ private function listIndividual(string|array|null $organizationId = null, string $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/license-keys'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $qp = Utils\Utils::getQueryParams(Operations\LicenseKeysListRequest::class, $request, $urlOverride); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('license_keys:list', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 401 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['401', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -347,7 +340,7 @@ private function listIndividual(string|array|null $organizationId = null, string } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 401) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -358,7 +351,7 @@ private function listIndividual(string|array|null $organizationId = null, string } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -369,7 +362,7 @@ private function listIndividual(string|array|null $organizationId = null, string } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -380,7 +373,9 @@ private function listIndividual(string|array|null $organizationId = null, string } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -398,9 +393,9 @@ private function listIndividual(string|array|null $organizationId = null, string * @return \Generator * @throws \Polar\Models\Errors\APIException */ - public function list(string|array|null $organizationId = null, string|array|null $benefitId = null, ?int $page = null, ?int $limit = null): \Generator + public function list(string|array|null $organizationId = null, string|array|null $benefitId = null, ?int $page = null, ?int $limit = null, ?Options $options = null): \Generator { - $res = $this->listIndividual($organizationId, $benefitId, $page, $limit); + $res = $this->listIndividual($organizationId, $benefitId, $page, $limit, $options); while ($res !== null) { yield $res; $res = $res->next($res); @@ -417,7 +412,7 @@ public function list(string|array|null $organizationId = null, string|array|null * @return Operations\LicenseKeysUpdateResponse * @throws \Polar\Models\Errors\APIException */ - public function update(Components\LicenseKeyUpdate $licenseKeyUpdate, string $id): Operations\LicenseKeysUpdateResponse + public function update(Components\LicenseKeyUpdate $licenseKeyUpdate, string $id, ?Options $options = null): Operations\LicenseKeysUpdateResponse { $request = new Operations\LicenseKeysUpdateRequest( id: $id, @@ -426,37 +421,33 @@ public function update(Components\LicenseKeyUpdate $licenseKeyUpdate, string $id $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/license-keys/{id}', Operations\LicenseKeysUpdateRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'licenseKeyUpdate', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); $hookContext = new HookContext('license_keys:update', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 401 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['401', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -473,7 +464,7 @@ public function update(Components\LicenseKeyUpdate $licenseKeyUpdate, string $id } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 401) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -484,7 +475,7 @@ public function update(Components\LicenseKeyUpdate $licenseKeyUpdate, string $id } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -495,7 +486,7 @@ public function update(Components\LicenseKeyUpdate $licenseKeyUpdate, string $id } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -506,7 +497,9 @@ public function update(Components\LicenseKeyUpdate $licenseKeyUpdate, string $id } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/Meters.php b/src/Meters.php new file mode 100644 index 0000000..a0066c5 --- /dev/null +++ b/src/Meters.php @@ -0,0 +1,667 @@ +sdkConfiguration = $sdkConfig; + } + /** + * @param string $baseUrl + * @param array $urlVariables + * + * @return string + */ + public function getUrl(string $baseUrl, array $urlVariables): string + { + $serverDetails = $this->sdkConfiguration->getServerDetails(); + + if ($baseUrl == null) { + $baseUrl = $serverDetails->baseUrl; + } + + if ($urlVariables == null) { + $urlVariables = $serverDetails->options; + } + + return Utils\Utils::templateUrl($baseUrl, $urlVariables); + } + + /** + * Create Meter + * + * Create a meter. + * + * @param Components\MeterCreate $request + * @return Operations\MetersCreateResponse + * @throws \Polar\Models\Errors\APIException + */ + public function create(Components\MeterCreate $request, ?Options $options = null): Operations\MetersCreateResponse + { + $baseUrl = $this->sdkConfiguration->getServerUrl(); + $url = Utils\Utils::generateUrl($baseUrl, '/v1/meters/'); + $urlOverride = null; + $httpOptions = ['http_errors' => false]; + $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); + if ($body === null) { + throw new \Exception('Request body is required'); + } + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('meters:create', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + $httpResponse = $res; + } + $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; + + $statusCode = $httpResponse->getStatusCode(); + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + $httpResponse = $res; + } + if (Utils\Utils::matchStatusCodes($statusCode, ['201'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Components\Meter', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\MetersCreateResponse( + statusCode: $statusCode, + contentType: $contentType, + rawResponse: $httpResponse, + meter: $obj); + + return $response; + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\HTTPValidationError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } + + /** + * Get Meter Events + * + * Get events matching the filter of a meter. + * + * @param string $id + * @param ?int $page + * @param ?int $limit + * @return Operations\MetersEventsResponse + * @throws \Polar\Models\Errors\APIException + */ + private function eventsIndividual(string $id, ?int $page = null, ?int $limit = null, ?Options $options = null): Operations\MetersEventsResponse + { + $request = new Operations\MetersEventsRequest( + id: $id, + page: $page, + limit: $limit, + ); + $baseUrl = $this->sdkConfiguration->getServerUrl(); + $url = Utils\Utils::generateUrl($baseUrl, '/v1/meters/{id}/events', Operations\MetersEventsRequest::class, $request); + $urlOverride = null; + $httpOptions = ['http_errors' => false]; + + $qp = Utils\Utils::getQueryParams(Operations\MetersEventsRequest::class, $request, $urlOverride); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('meters:events', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + $httpResponse = $res; + } + $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; + + $statusCode = $httpResponse->getStatusCode(); + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + $httpResponse = $res; + } + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Components\ListResourceEvent', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\MetersEventsResponse( + statusCode: $statusCode, + contentType: $contentType, + rawResponse: $httpResponse, + listResourceEvent: $obj); + $sdk = $this; + + $response->next = function () use ($sdk, $request, $responseData, $id, $limit): ?Operations\MetersEventsResponse { + $page = $request != null ? $request->page : 0; + $nextPage = $page + 1; + $jsonObject = new \JsonPath\JsonObject($responseData); + $numPages = $jsonObject->get('$.pagination.max_page'); + if ($numPages == null || $numPages[0] <= $page) { + return null; + } + if (! $responseData) { + return null; + } + $jsonObject = new \JsonPath\JsonObject($responseData); + $results = $jsonObject->get('$.items'); + + if (is_array($results)) { + $results = $results[0]; + } + if (count($results) === 0) { + return null; + } + $limit = $request != null ? $request->limit : 0; + if (count($results) < $limit) { + return null; + } + + return $sdk->eventsIndividual( + id: $id, + page: $nextPage, + limit: $limit, + ); + }; + + + return $response; + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\ResourceNotFound', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\HTTPValidationError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } + /** + * Get Meter Events + * + * Get events matching the filter of a meter. + * + * @param string $id + * @param ?int $page + * @param ?int $limit + * @return \Generator + * @throws \Polar\Models\Errors\APIException + */ + public function events(string $id, ?int $page = null, ?int $limit = null, ?Options $options = null): \Generator + { + $res = $this->eventsIndividual($id, $page, $limit, $options); + while ($res !== null) { + yield $res; + $res = $res->next($res); + } + } + + /** + * Get Meter + * + * Get a meter by ID. + * + * @param string $id + * @return Operations\MetersGetResponse + * @throws \Polar\Models\Errors\APIException + */ + public function get(string $id, ?Options $options = null): Operations\MetersGetResponse + { + $request = new Operations\MetersGetRequest( + id: $id, + ); + $baseUrl = $this->sdkConfiguration->getServerUrl(); + $url = Utils\Utils::generateUrl($baseUrl, '/v1/meters/{id}', Operations\MetersGetRequest::class, $request); + $urlOverride = null; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('meters:get', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + $httpResponse = $res; + } + $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; + + $statusCode = $httpResponse->getStatusCode(); + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + $httpResponse = $res; + } + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Components\Meter', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\MetersGetResponse( + statusCode: $statusCode, + contentType: $contentType, + rawResponse: $httpResponse, + meter: $obj); + + return $response; + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\ResourceNotFound', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\HTTPValidationError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } + + /** + * List Meters + * + * List meters. + * + * @param ?Operations\MetersListRequest $request + * @return Operations\MetersListResponse + * @throws \Polar\Models\Errors\APIException + */ + private function listIndividual(?Operations\MetersListRequest $request = null, ?Options $options = null): Operations\MetersListResponse + { + $baseUrl = $this->sdkConfiguration->getServerUrl(); + $url = Utils\Utils::generateUrl($baseUrl, '/v1/meters/'); + $urlOverride = null; + $httpOptions = ['http_errors' => false]; + + $qp = Utils\Utils::getQueryParams(Operations\MetersListRequest::class, $request, $urlOverride); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('meters:list', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + $httpResponse = $res; + } + $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; + + $statusCode = $httpResponse->getStatusCode(); + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + $httpResponse = $res; + } + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Components\ListResourceMeter', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\MetersListResponse( + statusCode: $statusCode, + contentType: $contentType, + rawResponse: $httpResponse, + listResourceMeter: $obj); + $sdk = $this; + + $response->next = function () use ($sdk, $request, $responseData): ?Operations\MetersListResponse { + $page = $request != null ? $request->page : 0; + $nextPage = $page + 1; + $jsonObject = new \JsonPath\JsonObject($responseData); + $numPages = $jsonObject->get('$.pagination.max_page'); + if ($numPages == null || $numPages[0] <= $page) { + return null; + } + if (! $responseData) { + return null; + } + $jsonObject = new \JsonPath\JsonObject($responseData); + $results = $jsonObject->get('$.items'); + + if (is_array($results)) { + $results = $results[0]; + } + if (count($results) === 0) { + return null; + } + $limit = $request != null ? $request->limit : 0; + if (count($results) < $limit) { + return null; + } + + return $sdk->listIndividual( + request: new Operations\MetersListRequest( + organizationId: $request != null ? $request->organizationId : null, + query: $request != null ? $request->query : null, + page: $nextPage, + limit: $request != null ? $request->limit : null, + sorting: $request != null ? $request->sorting : null, + metadata: $request != null ? $request->metadata : null, + ), + ); + }; + + + return $response; + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\HTTPValidationError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } + /** + * List Meters + * + * List meters. + * + * @param ?Operations\MetersListRequest $request + * @return \Generator + * @throws \Polar\Models\Errors\APIException + */ + public function list(?Operations\MetersListRequest $request = null, ?Options $options = null): \Generator + { + $res = $this->listIndividual($request, $options); + while ($res !== null) { + yield $res; + $res = $res->next($res); + } + } + + /** + * Get Meter Quantities + * + * Get quantities of a meter over a time period. + * + * @param Operations\MetersQuantitiesRequest $request + * @return Operations\MetersQuantitiesResponse + * @throws \Polar\Models\Errors\APIException + */ + public function quantities(Operations\MetersQuantitiesRequest $request, ?Options $options = null): Operations\MetersQuantitiesResponse + { + $baseUrl = $this->sdkConfiguration->getServerUrl(); + $url = Utils\Utils::generateUrl($baseUrl, '/v1/meters/{id}/quantities', Operations\MetersQuantitiesRequest::class, $request); + $urlOverride = null; + $httpOptions = ['http_errors' => false]; + + $qp = Utils\Utils::getQueryParams(Operations\MetersQuantitiesRequest::class, $request, $urlOverride); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('meters:quantities', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + $httpResponse = $res; + } + $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; + + $statusCode = $httpResponse->getStatusCode(); + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + $httpResponse = $res; + } + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Components\MeterQuantities', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\MetersQuantitiesResponse( + statusCode: $statusCode, + contentType: $contentType, + rawResponse: $httpResponse, + meterQuantities: $obj); + + return $response; + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\ResourceNotFound', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\HTTPValidationError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } + + /** + * Update Meter + * + * Update a meter. + * + * @param Components\MeterUpdate $meterUpdate + * @param string $id + * @return Operations\MetersUpdateResponse + * @throws \Polar\Models\Errors\APIException + */ + public function update(Components\MeterUpdate $meterUpdate, string $id, ?Options $options = null): Operations\MetersUpdateResponse + { + $request = new Operations\MetersUpdateRequest( + id: $id, + meterUpdate: $meterUpdate, + ); + $baseUrl = $this->sdkConfiguration->getServerUrl(); + $url = Utils\Utils::generateUrl($baseUrl, '/v1/meters/{id}', Operations\MetersUpdateRequest::class, $request); + $urlOverride = null; + $httpOptions = ['http_errors' => false]; + $body = Utils\Utils::serializeRequestBody($request, 'meterUpdate', 'json'); + if ($body === null) { + throw new \Exception('Request body is required'); + } + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); + $hookContext = new HookContext('meters:update', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + $httpResponse = $res; + } + $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; + + $statusCode = $httpResponse->getStatusCode(); + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + $httpResponse = $res; + } + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Components\Meter', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\MetersUpdateResponse( + statusCode: $statusCode, + contentType: $contentType, + rawResponse: $httpResponse, + meter: $obj); + + return $response; + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\ResourceNotFound', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\HTTPValidationError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } + +} \ No newline at end of file diff --git a/src/Metrics.php b/src/Metrics.php index da3eb24..162d4fe 100644 --- a/src/Metrics.php +++ b/src/Metrics.php @@ -10,6 +10,7 @@ use Polar\Hooks\HookContext; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class Metrics @@ -52,40 +53,36 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\MetricsGetResponse * @throws \Polar\Models\Errors\APIException */ - public function get(Operations\MetricsGetRequest $request): Operations\MetricsGetResponse + public function get(Operations\MetricsGetRequest $request, ?Options $options = null): Operations\MetricsGetResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/metrics/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $qp = Utils\Utils::getQueryParams(Operations\MetricsGetRequest::class, $request, $urlOverride); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('metrics:get', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -102,7 +99,7 @@ public function get(Operations\MetricsGetRequest $request): Operations\MetricsGe } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -113,7 +110,9 @@ public function get(Operations\MetricsGetRequest $request): Operations\MetricsGe } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -128,37 +127,33 @@ public function get(Operations\MetricsGetRequest $request): Operations\MetricsGe * @return Operations\MetricsLimitsResponse * @throws \Polar\Models\Errors\APIException */ - public function limits(): Operations\MetricsLimitsResponse + public function limits(?Options $options = null): Operations\MetricsLimitsResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/metrics/limits'); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('metrics:limits', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -175,7 +170,9 @@ public function limits(): Operations\MetricsLimitsResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/Models/Components/Address.php b/src/Models/Components/Address.php index dff3d0a..41d480f 100644 --- a/src/Models/Components/Address.php +++ b/src/Models/Components/Address.php @@ -65,6 +65,7 @@ class Address * @param ?string $postalCode * @param ?string $city * @param ?string $state + * @phpstan-pure */ public function __construct(string $country, ?string $line1 = null, ?string $line2 = null, ?string $postalCode = null, ?string $city = null, ?string $state = null) { diff --git a/src/Models/Components/AdvertisementCampaign.php b/src/Models/Components/AdvertisementCampaign.php index 97f2c99..4f1382c 100644 --- a/src/Models/Components/AdvertisementCampaign.php +++ b/src/Models/Components/AdvertisementCampaign.php @@ -70,6 +70,7 @@ class AdvertisementCampaign * @param string $linkUrl * @param ?\DateTime $modifiedAt * @param ?string $imageUrlDark + * @phpstan-pure */ public function __construct(\DateTime $createdAt, string $id, string $imageUrl, string $text, string $linkUrl, ?\DateTime $modifiedAt = null, ?string $imageUrlDark = null) { diff --git a/src/Models/Components/AdvertisementCampaignListResource.php b/src/Models/Components/AdvertisementCampaignListResource.php index f564caa..160aab4 100644 --- a/src/Models/Components/AdvertisementCampaignListResource.php +++ b/src/Models/Components/AdvertisementCampaignListResource.php @@ -41,6 +41,7 @@ class AdvertisementCampaignListResource * @param array $items * @param Pagination $pagination * @param array $dimensions + * @phpstan-pure */ public function __construct(array $items, Pagination $pagination, array $dimensions) { diff --git a/src/Models/Components/Assignee.php b/src/Models/Components/Assignee.php index 7487ec0..4717170 100644 --- a/src/Models/Components/Assignee.php +++ b/src/Models/Components/Assignee.php @@ -44,6 +44,7 @@ class Assignee * @param string $login * @param string $htmlUrl * @param string $avatarUrl + * @phpstan-pure */ public function __construct(int $id, string $login, string $htmlUrl, string $avatarUrl) { diff --git a/src/Models/Components/AttachedCustomField.php b/src/Models/Components/AttachedCustomField.php index 2255101..a873bb0 100644 --- a/src/Models/Components/AttachedCustomField.php +++ b/src/Models/Components/AttachedCustomField.php @@ -50,6 +50,7 @@ class AttachedCustomField * @param CustomFieldText|CustomFieldNumber|CustomFieldDate|CustomFieldCheckbox|CustomFieldSelect $customField * @param int $order * @param bool $required + * @phpstan-pure */ public function __construct(string $customFieldId, CustomFieldText|CustomFieldNumber|CustomFieldDate|CustomFieldCheckbox|CustomFieldSelect $customField, int $order, bool $required) { diff --git a/src/Models/Components/AttachedCustomFieldCreate.php b/src/Models/Components/AttachedCustomFieldCreate.php index c436021..6fb380d 100644 --- a/src/Models/Components/AttachedCustomFieldCreate.php +++ b/src/Models/Components/AttachedCustomFieldCreate.php @@ -31,6 +31,7 @@ class AttachedCustomFieldCreate /** * @param string $customFieldId * @param bool $required + * @phpstan-pure */ public function __construct(string $customFieldId, bool $required) { diff --git a/src/Models/Components/Author.php b/src/Models/Components/Author.php index cb4fe87..1363814 100644 --- a/src/Models/Components/Author.php +++ b/src/Models/Components/Author.php @@ -44,6 +44,7 @@ class Author * @param string $login * @param string $htmlUrl * @param string $avatarUrl + * @phpstan-pure */ public function __construct(int $id, string $login, string $htmlUrl, string $avatarUrl) { diff --git a/src/Models/Components/AuthorizeOrganization.php b/src/Models/Components/AuthorizeOrganization.php index a27d199..09a8dbd 100644 --- a/src/Models/Components/AuthorizeOrganization.php +++ b/src/Models/Components/AuthorizeOrganization.php @@ -36,6 +36,7 @@ class AuthorizeOrganization * @param string $id * @param string $slug * @param ?string $avatarUrl + * @phpstan-pure */ public function __construct(string $id, string $slug, ?string $avatarUrl = null) { diff --git a/src/Models/Components/AuthorizeResponseOrganization.php b/src/Models/Components/AuthorizeResponseOrganization.php index add2fca..ca0f856 100644 --- a/src/Models/Components/AuthorizeResponseOrganization.php +++ b/src/Models/Components/AuthorizeResponseOrganization.php @@ -47,20 +47,20 @@ class AuthorizeResponseOrganization /** * - * @var AuthorizeResponseOrganizationSubType $subType + * @var string $subType */ #[\Speakeasy\Serializer\Annotation\SerializedName('sub_type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\AuthorizeResponseOrganizationSubType')] - public AuthorizeResponseOrganizationSubType $subType; + public string $subType; /** * @param OAuth2ClientPublic $client - * @param AuthorizeResponseOrganizationSubType $subType + * @param string $subType * @param array $scopes * @param array $organizations * @param ?AuthorizeOrganization $sub + * @phpstan-pure */ - public function __construct(OAuth2ClientPublic $client, array $scopes, array $organizations, ?AuthorizeOrganization $sub = null, AuthorizeResponseOrganizationSubType $subType = AuthorizeResponseOrganizationSubType::Organization) + public function __construct(OAuth2ClientPublic $client, array $scopes, array $organizations, ?AuthorizeOrganization $sub = null, string $subType = 'organization') { $this->client = $client; $this->scopes = $scopes; diff --git a/src/Models/Components/AuthorizeResponseUser.php b/src/Models/Components/AuthorizeResponseUser.php index a20469a..a0260f7 100644 --- a/src/Models/Components/AuthorizeResponseUser.php +++ b/src/Models/Components/AuthorizeResponseUser.php @@ -38,19 +38,19 @@ class AuthorizeResponseUser /** * - * @var AuthorizeResponseUserSubType $subType + * @var string $subType */ #[\Speakeasy\Serializer\Annotation\SerializedName('sub_type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\AuthorizeResponseUserSubType')] - public AuthorizeResponseUserSubType $subType; + public string $subType; /** * @param OAuth2ClientPublic $client - * @param AuthorizeResponseUserSubType $subType + * @param string $subType * @param array $scopes * @param ?AuthorizeUser $sub + * @phpstan-pure */ - public function __construct(OAuth2ClientPublic $client, array $scopes, ?AuthorizeUser $sub = null, AuthorizeResponseUserSubType $subType = AuthorizeResponseUserSubType::User) + public function __construct(OAuth2ClientPublic $client, array $scopes, ?AuthorizeUser $sub = null, string $subType = 'user') { $this->client = $client; $this->scopes = $scopes; diff --git a/src/Models/Components/AuthorizeUser.php b/src/Models/Components/AuthorizeUser.php index c611ad6..f7d691b 100644 --- a/src/Models/Components/AuthorizeUser.php +++ b/src/Models/Components/AuthorizeUser.php @@ -36,6 +36,7 @@ class AuthorizeUser * @param string $id * @param string $email * @param ?string $avatarUrl + * @phpstan-pure */ public function __construct(string $id, string $email, ?string $avatarUrl = null) { diff --git a/src/Models/Components/BenefitAds.php b/src/Models/Components/BenefitAds.php index 3a447c8..070be9d 100644 --- a/src/Models/Components/BenefitAds.php +++ b/src/Models/Components/BenefitAds.php @@ -84,24 +84,24 @@ class BenefitAds /** * - * @var BenefitAdsType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\BenefitAdsType')] - public BenefitAdsType $type; + public string $type; /** * @param \DateTime $createdAt * @param string $id - * @param BenefitAdsType $type + * @param string $type * @param string $description * @param bool $selectable * @param bool $deletable * @param string $organizationId * @param BenefitAdsProperties $properties * @param ?\DateTime $modifiedAt + * @phpstan-pure */ - public function __construct(\DateTime $createdAt, string $id, string $description, bool $selectable, bool $deletable, string $organizationId, BenefitAdsProperties $properties, ?\DateTime $modifiedAt = null, BenefitAdsType $type = BenefitAdsType::Ads) + public function __construct(\DateTime $createdAt, string $id, string $description, bool $selectable, bool $deletable, string $organizationId, BenefitAdsProperties $properties, ?\DateTime $modifiedAt = null, string $type = 'ads') { $this->createdAt = $createdAt; $this->id = $id; diff --git a/src/Models/Components/BenefitAdsCreate.php b/src/Models/Components/BenefitAdsCreate.php index 5dabe0b..07dd53d 100644 --- a/src/Models/Components/BenefitAdsCreate.php +++ b/src/Models/Components/BenefitAdsCreate.php @@ -39,19 +39,19 @@ class BenefitAdsCreate /** * - * @var BenefitAdsCreateType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\BenefitAdsCreateType')] - public BenefitAdsCreateType $type; + public string $type; /** - * @param BenefitAdsCreateType $type + * @param string $type * @param string $description * @param BenefitAdsProperties $properties * @param ?string $organizationId + * @phpstan-pure */ - public function __construct(string $description, BenefitAdsProperties $properties, ?string $organizationId = null, BenefitAdsCreateType $type = BenefitAdsCreateType::Ads) + public function __construct(string $description, BenefitAdsProperties $properties, ?string $organizationId = null, string $type = 'ads') { $this->description = $description; $this->properties = $properties; diff --git a/src/Models/Components/BenefitAdsProperties.php b/src/Models/Components/BenefitAdsProperties.php index 839188c..2b29a70 100644 --- a/src/Models/Components/BenefitAdsProperties.php +++ b/src/Models/Components/BenefitAdsProperties.php @@ -33,6 +33,7 @@ class BenefitAdsProperties /** * @param ?int $imageHeight * @param ?int $imageWidth + * @phpstan-pure */ public function __construct(?int $imageHeight = 400, ?int $imageWidth = 400) { diff --git a/src/Models/Components/BenefitAdsSubscriber.php b/src/Models/Components/BenefitAdsSubscriber.php index 2e9c070..033a13a 100644 --- a/src/Models/Components/BenefitAdsSubscriber.php +++ b/src/Models/Components/BenefitAdsSubscriber.php @@ -86,16 +86,15 @@ class BenefitAdsSubscriber /** * - * @var BenefitAdsSubscriberType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\BenefitAdsSubscriberType')] - public BenefitAdsSubscriberType $type; + public string $type; /** * @param \DateTime $createdAt * @param string $id - * @param BenefitAdsSubscriberType $type + * @param string $type * @param string $description * @param bool $selectable * @param bool $deletable @@ -103,8 +102,9 @@ class BenefitAdsSubscriber * @param Organization $organization * @param BenefitAdsProperties $properties * @param ?\DateTime $modifiedAt + * @phpstan-pure */ - public function __construct(\DateTime $createdAt, string $id, string $description, bool $selectable, bool $deletable, string $organizationId, Organization $organization, BenefitAdsProperties $properties, ?\DateTime $modifiedAt = null, BenefitAdsSubscriberType $type = BenefitAdsSubscriberType::Ads) + public function __construct(\DateTime $createdAt, string $id, string $description, bool $selectable, bool $deletable, string $organizationId, Organization $organization, BenefitAdsProperties $properties, ?\DateTime $modifiedAt = null, string $type = 'ads') { $this->createdAt = $createdAt; $this->id = $id; diff --git a/src/Models/Components/BenefitAdsType.php b/src/Models/Components/BenefitAdsType.php deleted file mode 100644 index 3067e1c..0000000 --- a/src/Models/Components/BenefitAdsType.php +++ /dev/null @@ -1,15 +0,0 @@ -description = $description; $this->properties = $properties; diff --git a/src/Models/Components/BenefitBase.php b/src/Models/Components/BenefitBase.php index b1a5c3e..913acc0 100644 --- a/src/Models/Components/BenefitBase.php +++ b/src/Models/Components/BenefitBase.php @@ -84,6 +84,7 @@ class BenefitBase * @param bool $deletable * @param string $organizationId * @param ?\DateTime $modifiedAt + * @phpstan-pure */ public function __construct(\DateTime $createdAt, string $id, BenefitType $type, string $description, bool $selectable, bool $deletable, string $organizationId, ?\DateTime $modifiedAt = null) { diff --git a/src/Models/Components/BenefitCustom.php b/src/Models/Components/BenefitCustom.php index 52c324f..e84bb6c 100644 --- a/src/Models/Components/BenefitCustom.php +++ b/src/Models/Components/BenefitCustom.php @@ -92,16 +92,15 @@ class BenefitCustom /** * - * @var BenefitCustomType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\BenefitCustomType')] - public BenefitCustomType $type; + public string $type; /** * @param \DateTime $createdAt * @param string $id - * @param BenefitCustomType $type + * @param string $type * @param string $description * @param bool $selectable * @param bool $deletable @@ -109,8 +108,9 @@ class BenefitCustom * @param BenefitCustomProperties $properties * @param bool $isTaxApplicable * @param ?\DateTime $modifiedAt + * @phpstan-pure */ - public function __construct(\DateTime $createdAt, string $id, string $description, bool $selectable, bool $deletable, string $organizationId, BenefitCustomProperties $properties, bool $isTaxApplicable, ?\DateTime $modifiedAt = null, BenefitCustomType $type = BenefitCustomType::Custom) + public function __construct(\DateTime $createdAt, string $id, string $description, bool $selectable, bool $deletable, string $organizationId, BenefitCustomProperties $properties, bool $isTaxApplicable, ?\DateTime $modifiedAt = null, string $type = 'custom') { $this->createdAt = $createdAt; $this->id = $id; diff --git a/src/Models/Components/BenefitCustomCreate.php b/src/Models/Components/BenefitCustomCreate.php index f6bc022..4fe04f3 100644 --- a/src/Models/Components/BenefitCustomCreate.php +++ b/src/Models/Components/BenefitCustomCreate.php @@ -40,19 +40,19 @@ class BenefitCustomCreate /** * - * @var BenefitCustomCreateType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\BenefitCustomCreateType')] - public BenefitCustomCreateType $type; + public string $type; /** - * @param BenefitCustomCreateType $type + * @param string $type * @param string $description * @param BenefitCustomCreateProperties $properties * @param ?string $organizationId + * @phpstan-pure */ - public function __construct(string $description, BenefitCustomCreateProperties $properties, ?string $organizationId = null, BenefitCustomCreateType $type = BenefitCustomCreateType::Custom) + public function __construct(string $description, BenefitCustomCreateProperties $properties, ?string $organizationId = null, string $type = 'custom') { $this->description = $description; $this->properties = $properties; diff --git a/src/Models/Components/BenefitCustomCreateProperties.php b/src/Models/Components/BenefitCustomCreateProperties.php index 510bbbd..1e034fb 100644 --- a/src/Models/Components/BenefitCustomCreateProperties.php +++ b/src/Models/Components/BenefitCustomCreateProperties.php @@ -22,6 +22,7 @@ class BenefitCustomCreateProperties /** * @param ?string $note + * @phpstan-pure */ public function __construct(?string $note = null) { diff --git a/src/Models/Components/BenefitCustomCreateType.php b/src/Models/Components/BenefitCustomCreateType.php deleted file mode 100644 index e95388c..0000000 --- a/src/Models/Components/BenefitCustomCreateType.php +++ /dev/null @@ -1,15 +0,0 @@ -createdAt = $createdAt; $this->id = $id; diff --git a/src/Models/Components/BenefitCustomSubscriberProperties.php b/src/Models/Components/BenefitCustomSubscriberProperties.php index 5fcf249..beeeb3d 100644 --- a/src/Models/Components/BenefitCustomSubscriberProperties.php +++ b/src/Models/Components/BenefitCustomSubscriberProperties.php @@ -21,6 +21,7 @@ class BenefitCustomSubscriberProperties /** * @param ?string $note + * @phpstan-pure */ public function __construct(?string $note = null) { diff --git a/src/Models/Components/BenefitCustomSubscriberType.php b/src/Models/Components/BenefitCustomSubscriberType.php deleted file mode 100644 index 49ccc26..0000000 --- a/src/Models/Components/BenefitCustomSubscriberType.php +++ /dev/null @@ -1,15 +0,0 @@ -description = $description; $this->properties = $properties; diff --git a/src/Models/Components/BenefitCustomUpdateType.php b/src/Models/Components/BenefitCustomUpdateType.php deleted file mode 100644 index 42fa187..0000000 --- a/src/Models/Components/BenefitCustomUpdateType.php +++ /dev/null @@ -1,15 +0,0 @@ -createdAt = $createdAt; $this->id = $id; diff --git a/src/Models/Components/BenefitDiscordCreate.php b/src/Models/Components/BenefitDiscordCreate.php index cdf0c6b..ff978ff 100644 --- a/src/Models/Components/BenefitDiscordCreate.php +++ b/src/Models/Components/BenefitDiscordCreate.php @@ -39,19 +39,19 @@ class BenefitDiscordCreate /** * - * @var BenefitDiscordCreateType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\BenefitDiscordCreateType')] - public BenefitDiscordCreateType $type; + public string $type; /** - * @param BenefitDiscordCreateType $type + * @param string $type * @param string $description * @param BenefitDiscordCreateProperties $properties * @param ?string $organizationId + * @phpstan-pure */ - public function __construct(string $description, BenefitDiscordCreateProperties $properties, ?string $organizationId = null, BenefitDiscordCreateType $type = BenefitDiscordCreateType::Discord) + public function __construct(string $description, BenefitDiscordCreateProperties $properties, ?string $organizationId = null, string $type = 'discord') { $this->description = $description; $this->properties = $properties; diff --git a/src/Models/Components/BenefitDiscordCreateProperties.php b/src/Models/Components/BenefitDiscordCreateProperties.php index 64503b3..76b61af 100644 --- a/src/Models/Components/BenefitDiscordCreateProperties.php +++ b/src/Models/Components/BenefitDiscordCreateProperties.php @@ -30,6 +30,7 @@ class BenefitDiscordCreateProperties /** * @param string $guildToken * @param string $roleId + * @phpstan-pure */ public function __construct(string $guildToken, string $roleId) { diff --git a/src/Models/Components/BenefitDiscordCreateType.php b/src/Models/Components/BenefitDiscordCreateType.php deleted file mode 100644 index 196aa88..0000000 --- a/src/Models/Components/BenefitDiscordCreateType.php +++ /dev/null @@ -1,15 +0,0 @@ -createdAt = $createdAt; $this->id = $id; diff --git a/src/Models/Components/BenefitDiscordSubscriberProperties.php b/src/Models/Components/BenefitDiscordSubscriberProperties.php index 90109e2..5b36443 100644 --- a/src/Models/Components/BenefitDiscordSubscriberProperties.php +++ b/src/Models/Components/BenefitDiscordSubscriberProperties.php @@ -22,6 +22,7 @@ class BenefitDiscordSubscriberProperties /** * @param string $guildId + * @phpstan-pure */ public function __construct(string $guildId) { diff --git a/src/Models/Components/BenefitDiscordSubscriberType.php b/src/Models/Components/BenefitDiscordSubscriberType.php deleted file mode 100644 index 4848797..0000000 --- a/src/Models/Components/BenefitDiscordSubscriberType.php +++ /dev/null @@ -1,15 +0,0 @@ -description = $description; $this->properties = $properties; diff --git a/src/Models/Components/BenefitDiscordUpdateType.php b/src/Models/Components/BenefitDiscordUpdateType.php deleted file mode 100644 index 9e5fc0e..0000000 --- a/src/Models/Components/BenefitDiscordUpdateType.php +++ /dev/null @@ -1,15 +0,0 @@ -createdAt = $createdAt; $this->id = $id; diff --git a/src/Models/Components/BenefitDownloadablesCreate.php b/src/Models/Components/BenefitDownloadablesCreate.php index a3948fe..3a69777 100644 --- a/src/Models/Components/BenefitDownloadablesCreate.php +++ b/src/Models/Components/BenefitDownloadablesCreate.php @@ -38,19 +38,19 @@ class BenefitDownloadablesCreate /** * - * @var BenefitDownloadablesCreateType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\BenefitDownloadablesCreateType')] - public BenefitDownloadablesCreateType $type; + public string $type; /** - * @param BenefitDownloadablesCreateType $type + * @param string $type * @param string $description * @param BenefitDownloadablesCreateProperties $properties * @param ?string $organizationId + * @phpstan-pure */ - public function __construct(string $description, BenefitDownloadablesCreateProperties $properties, ?string $organizationId = null, BenefitDownloadablesCreateType $type = BenefitDownloadablesCreateType::Downloadables) + public function __construct(string $description, BenefitDownloadablesCreateProperties $properties, ?string $organizationId = null, string $type = 'downloadables') { $this->description = $description; $this->properties = $properties; diff --git a/src/Models/Components/BenefitDownloadablesCreateProperties.php b/src/Models/Components/BenefitDownloadablesCreateProperties.php index a932a52..23c9d03 100644 --- a/src/Models/Components/BenefitDownloadablesCreateProperties.php +++ b/src/Models/Components/BenefitDownloadablesCreateProperties.php @@ -33,6 +33,7 @@ class BenefitDownloadablesCreateProperties /** * @param array $files * @param ?array $archived + * @phpstan-pure */ public function __construct(array $files, ?array $archived = null) { diff --git a/src/Models/Components/BenefitDownloadablesCreateType.php b/src/Models/Components/BenefitDownloadablesCreateType.php deleted file mode 100644 index 0456001..0000000 --- a/src/Models/Components/BenefitDownloadablesCreateType.php +++ /dev/null @@ -1,15 +0,0 @@ - $archived * @param array $files + * @phpstan-pure */ public function __construct(array $archived, array $files) { diff --git a/src/Models/Components/BenefitDownloadablesSubscriber.php b/src/Models/Components/BenefitDownloadablesSubscriber.php index 108962a..4739702 100644 --- a/src/Models/Components/BenefitDownloadablesSubscriber.php +++ b/src/Models/Components/BenefitDownloadablesSubscriber.php @@ -85,16 +85,15 @@ class BenefitDownloadablesSubscriber /** * - * @var BenefitDownloadablesSubscriberType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\BenefitDownloadablesSubscriberType')] - public BenefitDownloadablesSubscriberType $type; + public string $type; /** * @param \DateTime $createdAt * @param string $id - * @param BenefitDownloadablesSubscriberType $type + * @param string $type * @param string $description * @param bool $selectable * @param bool $deletable @@ -102,8 +101,9 @@ class BenefitDownloadablesSubscriber * @param Organization $organization * @param BenefitDownloadablesSubscriberProperties $properties * @param ?\DateTime $modifiedAt + * @phpstan-pure */ - public function __construct(\DateTime $createdAt, string $id, string $description, bool $selectable, bool $deletable, string $organizationId, Organization $organization, BenefitDownloadablesSubscriberProperties $properties, ?\DateTime $modifiedAt = null, BenefitDownloadablesSubscriberType $type = BenefitDownloadablesSubscriberType::Downloadables) + public function __construct(\DateTime $createdAt, string $id, string $description, bool $selectable, bool $deletable, string $organizationId, Organization $organization, BenefitDownloadablesSubscriberProperties $properties, ?\DateTime $modifiedAt = null, string $type = 'downloadables') { $this->createdAt = $createdAt; $this->id = $id; diff --git a/src/Models/Components/BenefitDownloadablesSubscriberProperties.php b/src/Models/Components/BenefitDownloadablesSubscriberProperties.php index 1f20647..8411fdb 100644 --- a/src/Models/Components/BenefitDownloadablesSubscriberProperties.php +++ b/src/Models/Components/BenefitDownloadablesSubscriberProperties.php @@ -22,6 +22,7 @@ class BenefitDownloadablesSubscriberProperties /** * @param array $activeFiles + * @phpstan-pure */ public function __construct(array $activeFiles) { diff --git a/src/Models/Components/BenefitDownloadablesSubscriberType.php b/src/Models/Components/BenefitDownloadablesSubscriberType.php deleted file mode 100644 index a55fe16..0000000 --- a/src/Models/Components/BenefitDownloadablesSubscriberType.php +++ /dev/null @@ -1,15 +0,0 @@ -description = $description; $this->properties = $properties; diff --git a/src/Models/Components/BenefitDownloadablesUpdateType.php b/src/Models/Components/BenefitDownloadablesUpdateType.php deleted file mode 100644 index ce947c2..0000000 --- a/src/Models/Components/BenefitDownloadablesUpdateType.php +++ /dev/null @@ -1,15 +0,0 @@ -createdAt = $createdAt; $this->id = $id; diff --git a/src/Models/Components/BenefitGitHubRepositoryCreate.php b/src/Models/Components/BenefitGitHubRepositoryCreate.php index e9bbdf4..a5be0e1 100644 --- a/src/Models/Components/BenefitGitHubRepositoryCreate.php +++ b/src/Models/Components/BenefitGitHubRepositoryCreate.php @@ -39,19 +39,19 @@ class BenefitGitHubRepositoryCreate /** * - * @var BenefitGitHubRepositoryCreateType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\BenefitGitHubRepositoryCreateType')] - public BenefitGitHubRepositoryCreateType $type; + public string $type; /** - * @param BenefitGitHubRepositoryCreateType $type + * @param string $type * @param string $description * @param BenefitGitHubRepositoryCreateProperties $properties * @param ?string $organizationId + * @phpstan-pure */ - public function __construct(string $description, BenefitGitHubRepositoryCreateProperties $properties, ?string $organizationId = null, BenefitGitHubRepositoryCreateType $type = BenefitGitHubRepositoryCreateType::GithubRepository) + public function __construct(string $description, BenefitGitHubRepositoryCreateProperties $properties, ?string $organizationId = null, string $type = 'github_repository') { $this->description = $description; $this->properties = $properties; diff --git a/src/Models/Components/BenefitGitHubRepositoryCreateProperties.php b/src/Models/Components/BenefitGitHubRepositoryCreateProperties.php index e8c067b..5998abd 100644 --- a/src/Models/Components/BenefitGitHubRepositoryCreateProperties.php +++ b/src/Models/Components/BenefitGitHubRepositoryCreateProperties.php @@ -41,6 +41,7 @@ class BenefitGitHubRepositoryCreateProperties * @param string $repositoryOwner * @param string $repositoryName * @param BenefitGitHubRepositoryCreatePropertiesPermission $permission + * @phpstan-pure */ public function __construct(string $repositoryOwner, string $repositoryName, BenefitGitHubRepositoryCreatePropertiesPermission $permission) { diff --git a/src/Models/Components/BenefitGitHubRepositoryCreateType.php b/src/Models/Components/BenefitGitHubRepositoryCreateType.php deleted file mode 100644 index e5cec41..0000000 --- a/src/Models/Components/BenefitGitHubRepositoryCreateType.php +++ /dev/null @@ -1,15 +0,0 @@ -createdAt = $createdAt; $this->id = $id; diff --git a/src/Models/Components/BenefitGitHubRepositorySubscriberProperties.php b/src/Models/Components/BenefitGitHubRepositorySubscriberProperties.php index 277c35b..7b60074 100644 --- a/src/Models/Components/BenefitGitHubRepositorySubscriberProperties.php +++ b/src/Models/Components/BenefitGitHubRepositorySubscriberProperties.php @@ -31,6 +31,7 @@ class BenefitGitHubRepositorySubscriberProperties /** * @param string $repositoryOwner * @param string $repositoryName + * @phpstan-pure */ public function __construct(string $repositoryOwner, string $repositoryName) { diff --git a/src/Models/Components/BenefitGitHubRepositorySubscriberType.php b/src/Models/Components/BenefitGitHubRepositorySubscriberType.php deleted file mode 100644 index ced3e6c..0000000 --- a/src/Models/Components/BenefitGitHubRepositorySubscriberType.php +++ /dev/null @@ -1,15 +0,0 @@ -description = $description; $this->properties = $properties; diff --git a/src/Models/Components/BenefitGitHubRepositoryUpdateType.php b/src/Models/Components/BenefitGitHubRepositoryUpdateType.php deleted file mode 100644 index 8f10d92..0000000 --- a/src/Models/Components/BenefitGitHubRepositoryUpdateType.php +++ /dev/null @@ -1,15 +0,0 @@ -createdAt = $createdAt; $this->id = $id; @@ -141,6 +152,7 @@ public function __construct(\DateTime $createdAt, string $id, bool $isGranted, b $this->customerId = $customerId; $this->userId = $userId; $this->benefitId = $benefitId; + $this->customer = $customer; $this->properties = $properties; $this->modifiedAt = $modifiedAt; $this->subscriptionId = $subscriptionId; diff --git a/src/Models/Components/BenefitGrantAdsProperties.php b/src/Models/Components/BenefitGrantAdsProperties.php index ea6b758..8d0535b 100644 --- a/src/Models/Components/BenefitGrantAdsProperties.php +++ b/src/Models/Components/BenefitGrantAdsProperties.php @@ -20,6 +20,7 @@ class BenefitGrantAdsProperties /** * @param string $advertisementCampaignId + * @phpstan-pure */ public function __construct(string $advertisementCampaignId) { diff --git a/src/Models/Components/BenefitGrantDiscordProperties.php b/src/Models/Components/BenefitGrantDiscordProperties.php index 3fc0cde..1690bb2 100644 --- a/src/Models/Components/BenefitGrantDiscordProperties.php +++ b/src/Models/Components/BenefitGrantDiscordProperties.php @@ -39,6 +39,7 @@ class BenefitGrantDiscordProperties * @param ?string $accountId * @param ?string $guildId * @param ?string $roleId + * @phpstan-pure */ public function __construct(?string $accountId = null, ?string $guildId = null, ?string $roleId = null) { diff --git a/src/Models/Components/BenefitGrantDownloadablesProperties.php b/src/Models/Components/BenefitGrantDownloadablesProperties.php index ea151d2..2252737 100644 --- a/src/Models/Components/BenefitGrantDownloadablesProperties.php +++ b/src/Models/Components/BenefitGrantDownloadablesProperties.php @@ -23,6 +23,7 @@ class BenefitGrantDownloadablesProperties /** * @param ?array $files + * @phpstan-pure */ public function __construct(?array $files = null) { diff --git a/src/Models/Components/BenefitGrantGitHubRepositoryProperties.php b/src/Models/Components/BenefitGrantGitHubRepositoryProperties.php index e18e2c9..0a81251 100644 --- a/src/Models/Components/BenefitGrantGitHubRepositoryProperties.php +++ b/src/Models/Components/BenefitGrantGitHubRepositoryProperties.php @@ -49,6 +49,7 @@ class BenefitGrantGitHubRepositoryProperties * @param ?string $repositoryOwner * @param ?string $repositoryName * @param ?BenefitGrantGitHubRepositoryPropertiesPermission $permission + * @phpstan-pure */ public function __construct(?string $accountId = null, ?string $repositoryOwner = null, ?string $repositoryName = null, ?BenefitGrantGitHubRepositoryPropertiesPermission $permission = null) { diff --git a/src/Models/Components/BenefitGrantLicenseKeysProperties.php b/src/Models/Components/BenefitGrantLicenseKeysProperties.php index eedf62d..b9e88c9 100644 --- a/src/Models/Components/BenefitGrantLicenseKeysProperties.php +++ b/src/Models/Components/BenefitGrantLicenseKeysProperties.php @@ -30,6 +30,7 @@ class BenefitGrantLicenseKeysProperties /** * @param ?string $licenseKeyId * @param ?string $displayKey + * @phpstan-pure */ public function __construct(?string $licenseKeyId = null, ?string $displayKey = null) { diff --git a/src/Models/Components/BenefitGrantWebhook.php b/src/Models/Components/BenefitGrantWebhook.php index 9e23db6..4921677 100644 --- a/src/Models/Components/BenefitGrantWebhook.php +++ b/src/Models/Components/BenefitGrantWebhook.php @@ -67,6 +67,15 @@ class BenefitGrantWebhook #[\Speakeasy\Serializer\Annotation\SerializedName('benefit_id')] public string $benefitId; + /** + * A customer in an organization. + * + * @var Customer $customer + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('customer')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\Customer')] + public Customer $customer; + /** * * @var BenefitGrantDiscordProperties|BenefitGrantGitHubRepositoryProperties|BenefitGrantDownloadablesProperties|BenefitGrantLicenseKeysProperties|BenefitGrantAdsProperties|BenefitGrantCustomProperties $properties @@ -130,7 +139,7 @@ class BenefitGrantWebhook * @var BenefitGrantDiscordProperties|BenefitGrantGitHubRepositoryProperties|BenefitGrantDownloadablesProperties|BenefitGrantLicenseKeysProperties|BenefitGrantAdsProperties|BenefitGrantCustomProperties|null $previousProperties */ #[\Speakeasy\Serializer\Annotation\SerializedName('previous_properties')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\BenefitGrantDiscordProperties|\Polar\Models\Components\BenefitGrantGitHubRepositoryProperties|\Polar\Models\Components\BenefitGrantDownloadablesProperties|\Polar\Models\Components\BenefitGrantLicenseKeysProperties|\Polar\Models\Components\BenefitGrantAdsProperties|\Polar\Models\Components\BenefitGrantCustomProperties')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\BenefitGrantDiscordProperties|\Polar\Models\Components\BenefitGrantGitHubRepositoryProperties|\Polar\Models\Components\BenefitGrantDownloadablesProperties|\Polar\Models\Components\BenefitGrantLicenseKeysProperties|\Polar\Models\Components\BenefitGrantAdsProperties|\Polar\Models\Components\BenefitGrantCustomProperties|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public BenefitGrantDiscordProperties|BenefitGrantGitHubRepositoryProperties|BenefitGrantDownloadablesProperties|BenefitGrantLicenseKeysProperties|BenefitGrantAdsProperties|BenefitGrantCustomProperties|null $previousProperties = null; @@ -142,6 +151,7 @@ class BenefitGrantWebhook * @param string $customerId * @param string $userId * @param string $benefitId + * @param Customer $customer * @param BenefitGrantDiscordProperties|BenefitGrantGitHubRepositoryProperties|BenefitGrantDownloadablesProperties|BenefitGrantLicenseKeysProperties|BenefitGrantAdsProperties|BenefitGrantCustomProperties $properties * @param BenefitAds|BenefitCustom|BenefitDiscord|BenefitGitHubRepository|BenefitDownloadables|BenefitLicenseKeys $benefit * @param ?\DateTime $modifiedAt @@ -150,8 +160,9 @@ class BenefitGrantWebhook * @param ?\DateTime $grantedAt * @param ?\DateTime $revokedAt * @param BenefitGrantDiscordProperties|BenefitGrantGitHubRepositoryProperties|BenefitGrantDownloadablesProperties|BenefitGrantLicenseKeysProperties|BenefitGrantAdsProperties|BenefitGrantCustomProperties|null $previousProperties + * @phpstan-pure */ - public function __construct(\DateTime $createdAt, string $id, bool $isGranted, bool $isRevoked, string $customerId, string $userId, string $benefitId, BenefitGrantDiscordProperties|BenefitGrantGitHubRepositoryProperties|BenefitGrantDownloadablesProperties|BenefitGrantLicenseKeysProperties|BenefitGrantAdsProperties|BenefitGrantCustomProperties $properties, BenefitAds|BenefitCustom|BenefitDiscord|BenefitGitHubRepository|BenefitDownloadables|BenefitLicenseKeys $benefit, ?\DateTime $modifiedAt = null, ?string $subscriptionId = null, ?string $orderId = null, ?\DateTime $grantedAt = null, ?\DateTime $revokedAt = null, BenefitGrantDiscordProperties|BenefitGrantGitHubRepositoryProperties|BenefitGrantDownloadablesProperties|BenefitGrantLicenseKeysProperties|BenefitGrantAdsProperties|BenefitGrantCustomProperties|null $previousProperties = null) + public function __construct(\DateTime $createdAt, string $id, bool $isGranted, bool $isRevoked, string $customerId, string $userId, string $benefitId, Customer $customer, BenefitGrantDiscordProperties|BenefitGrantGitHubRepositoryProperties|BenefitGrantDownloadablesProperties|BenefitGrantLicenseKeysProperties|BenefitGrantAdsProperties|BenefitGrantCustomProperties $properties, BenefitAds|BenefitCustom|BenefitDiscord|BenefitGitHubRepository|BenefitDownloadables|BenefitLicenseKeys $benefit, ?\DateTime $modifiedAt = null, ?string $subscriptionId = null, ?string $orderId = null, ?\DateTime $grantedAt = null, ?\DateTime $revokedAt = null, BenefitGrantDiscordProperties|BenefitGrantGitHubRepositoryProperties|BenefitGrantDownloadablesProperties|BenefitGrantLicenseKeysProperties|BenefitGrantAdsProperties|BenefitGrantCustomProperties|null $previousProperties = null) { $this->createdAt = $createdAt; $this->id = $id; @@ -160,6 +171,7 @@ public function __construct(\DateTime $createdAt, string $id, bool $isGranted, b $this->customerId = $customerId; $this->userId = $userId; $this->benefitId = $benefitId; + $this->customer = $customer; $this->properties = $properties; $this->benefit = $benefit; $this->modifiedAt = $modifiedAt; diff --git a/src/Models/Components/BenefitLicenseKeyActivationProperties.php b/src/Models/Components/BenefitLicenseKeyActivationProperties.php index 6181091..18934aa 100644 --- a/src/Models/Components/BenefitLicenseKeyActivationProperties.php +++ b/src/Models/Components/BenefitLicenseKeyActivationProperties.php @@ -28,6 +28,7 @@ class BenefitLicenseKeyActivationProperties /** * @param int $limit * @param bool $enableCustomerAdmin + * @phpstan-pure */ public function __construct(int $limit, bool $enableCustomerAdmin) { diff --git a/src/Models/Components/BenefitLicenseKeyExpirationProperties.php b/src/Models/Components/BenefitLicenseKeyExpirationProperties.php index 37550c1..a30ea96 100644 --- a/src/Models/Components/BenefitLicenseKeyExpirationProperties.php +++ b/src/Models/Components/BenefitLicenseKeyExpirationProperties.php @@ -29,6 +29,7 @@ class BenefitLicenseKeyExpirationProperties /** * @param int $ttl * @param Timeframe $timeframe + * @phpstan-pure */ public function __construct(int $ttl, Timeframe $timeframe) { diff --git a/src/Models/Components/BenefitLicenseKeys.php b/src/Models/Components/BenefitLicenseKeys.php index d8c8eb6..f63e5cd 100644 --- a/src/Models/Components/BenefitLicenseKeys.php +++ b/src/Models/Components/BenefitLicenseKeys.php @@ -77,24 +77,24 @@ class BenefitLicenseKeys /** * - * @var BenefitLicenseKeysType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\BenefitLicenseKeysType')] - public BenefitLicenseKeysType $type; + public string $type; /** * @param \DateTime $createdAt * @param string $id - * @param BenefitLicenseKeysType $type + * @param string $type * @param string $description * @param bool $selectable * @param bool $deletable * @param string $organizationId * @param BenefitLicenseKeysProperties $properties * @param ?\DateTime $modifiedAt + * @phpstan-pure */ - public function __construct(\DateTime $createdAt, string $id, string $description, bool $selectable, bool $deletable, string $organizationId, BenefitLicenseKeysProperties $properties, ?\DateTime $modifiedAt = null, BenefitLicenseKeysType $type = BenefitLicenseKeysType::LicenseKeys) + public function __construct(\DateTime $createdAt, string $id, string $description, bool $selectable, bool $deletable, string $organizationId, BenefitLicenseKeysProperties $properties, ?\DateTime $modifiedAt = null, string $type = 'license_keys') { $this->createdAt = $createdAt; $this->id = $id; diff --git a/src/Models/Components/BenefitLicenseKeysCreate.php b/src/Models/Components/BenefitLicenseKeysCreate.php index 58dbe90..7e44d07 100644 --- a/src/Models/Components/BenefitLicenseKeysCreate.php +++ b/src/Models/Components/BenefitLicenseKeysCreate.php @@ -38,19 +38,19 @@ class BenefitLicenseKeysCreate /** * - * @var BenefitLicenseKeysCreateType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\BenefitLicenseKeysCreateType')] - public BenefitLicenseKeysCreateType $type; + public string $type; /** - * @param BenefitLicenseKeysCreateType $type + * @param string $type * @param string $description * @param BenefitLicenseKeysCreateProperties $properties * @param ?string $organizationId + * @phpstan-pure */ - public function __construct(string $description, BenefitLicenseKeysCreateProperties $properties, ?string $organizationId = null, BenefitLicenseKeysCreateType $type = BenefitLicenseKeysCreateType::LicenseKeys) + public function __construct(string $description, BenefitLicenseKeysCreateProperties $properties, ?string $organizationId = null, string $type = 'license_keys') { $this->description = $description; $this->properties = $properties; diff --git a/src/Models/Components/BenefitLicenseKeysCreateProperties.php b/src/Models/Components/BenefitLicenseKeysCreateProperties.php index bfa7d83..f61b03a 100644 --- a/src/Models/Components/BenefitLicenseKeysCreateProperties.php +++ b/src/Models/Components/BenefitLicenseKeysCreateProperties.php @@ -50,6 +50,7 @@ class BenefitLicenseKeysCreateProperties * @param ?BenefitLicenseKeyExpirationProperties $expires * @param ?BenefitLicenseKeyActivationProperties $activations * @param ?int $limitUsage + * @phpstan-pure */ public function __construct(?string $prefix = null, ?BenefitLicenseKeyExpirationProperties $expires = null, ?BenefitLicenseKeyActivationProperties $activations = null, ?int $limitUsage = null) { diff --git a/src/Models/Components/BenefitLicenseKeysCreateType.php b/src/Models/Components/BenefitLicenseKeysCreateType.php deleted file mode 100644 index 1088b85..0000000 --- a/src/Models/Components/BenefitLicenseKeysCreateType.php +++ /dev/null @@ -1,15 +0,0 @@ -createdAt = $createdAt; $this->id = $id; diff --git a/src/Models/Components/BenefitLicenseKeysSubscriberProperties.php b/src/Models/Components/BenefitLicenseKeysSubscriberProperties.php index a6ad95b..89d73d6 100644 --- a/src/Models/Components/BenefitLicenseKeysSubscriberProperties.php +++ b/src/Models/Components/BenefitLicenseKeysSubscriberProperties.php @@ -46,6 +46,7 @@ class BenefitLicenseKeysSubscriberProperties * @param ?BenefitLicenseKeyExpirationProperties $expires * @param ?BenefitLicenseKeyActivationProperties $activations * @param ?int $limitUsage + * @phpstan-pure */ public function __construct(?string $prefix = null, ?BenefitLicenseKeyExpirationProperties $expires = null, ?BenefitLicenseKeyActivationProperties $activations = null, ?int $limitUsage = null) { diff --git a/src/Models/Components/BenefitLicenseKeysSubscriberType.php b/src/Models/Components/BenefitLicenseKeysSubscriberType.php deleted file mode 100644 index 7812c64..0000000 --- a/src/Models/Components/BenefitLicenseKeysSubscriberType.php +++ /dev/null @@ -1,15 +0,0 @@ -description = $description; $this->properties = $properties; diff --git a/src/Models/Components/BenefitLicenseKeysUpdateType.php b/src/Models/Components/BenefitLicenseKeysUpdateType.php deleted file mode 100644 index a2b862d..0000000 --- a/src/Models/Components/BenefitLicenseKeysUpdateType.php +++ /dev/null @@ -1,15 +0,0 @@ - $paymentProcessorMetadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('payment_processor_metadata')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\PaymentProcessorMetadata')] - public PaymentProcessorMetadata $paymentProcessorMetadata; + #[\Speakeasy\Serializer\Annotation\Type('array')] + public array $paymentProcessorMetadata; /** * $metadata * - * @var array $metadata + * @var array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $metadata; /** @@ -178,10 +187,10 @@ class Checkout /** * $customerMetadata * - * @var array $customerMetadata + * @var array $customerMetadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('customer_metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $customerMetadata; /** @@ -195,12 +204,12 @@ class Checkout /** * Key-value object storing custom field values. * - * @var ?CheckoutCustomFieldData $customFieldData + * @var ?array $customFieldData */ #[\Speakeasy\Serializer\Annotation\SerializedName('custom_field_data')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CheckoutCustomFieldData|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?CheckoutCustomFieldData $customFieldData = null; + public ?array $customFieldData = null; /** * When checkout is embedded, represents the Origin of the page embedding the checkout. Used as a security measure to send messages only to the embedding page. @@ -265,6 +274,7 @@ class Checkout public ?string $customerId; /** + * Name of the customer. * * @var ?string $customerName */ @@ -272,6 +282,7 @@ class Checkout public ?string $customerName; /** + * Email address of the customer. * * @var ?string $customerEmail */ @@ -305,7 +316,7 @@ class Checkout * @var CheckoutDiscountFixedOnceForeverDuration|CheckoutDiscountFixedRepeatDuration|CheckoutDiscountPercentageOnceForeverDuration|CheckoutDiscountPercentageRepeatDuration|null $discount */ #[\Speakeasy\Serializer\Annotation\SerializedName('discount')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CheckoutDiscountFixedOnceForeverDuration|\Polar\Models\Components\CheckoutDiscountFixedRepeatDuration|\Polar\Models\Components\CheckoutDiscountPercentageOnceForeverDuration|\Polar\Models\Components\CheckoutDiscountPercentageRepeatDuration')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CheckoutDiscountFixedOnceForeverDuration|\Polar\Models\Components\CheckoutDiscountFixedRepeatDuration|\Polar\Models\Components\CheckoutDiscountPercentageOnceForeverDuration|\Polar\Models\Components\CheckoutDiscountPercentageRepeatDuration|null')] public CheckoutDiscountFixedOnceForeverDuration|CheckoutDiscountFixedRepeatDuration|CheckoutDiscountPercentageOnceForeverDuration|CheckoutDiscountPercentageRepeatDuration|null $discount; /** @@ -315,14 +326,6 @@ class Checkout #[\Speakeasy\Serializer\Annotation\SerializedName('subscription_id')] public ?string $subscriptionId; - /** - * - * @var PaymentProcessor $paymentProcessor - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('payment_processor')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\PaymentProcessor')] - public PaymentProcessor $paymentProcessor; - /** * @param \DateTime $createdAt * @param string $id @@ -340,14 +343,14 @@ class Checkout * @param bool $isPaymentRequired * @param bool $isPaymentSetupRequired * @param bool $isPaymentFormRequired - * @param PaymentProcessorMetadata $paymentProcessorMetadata - * @param array $metadata + * @param array $paymentProcessorMetadata + * @param array $metadata * @param CheckoutProduct $product * @param ProductPriceRecurringFixed|ProductPriceRecurringCustom|ProductPriceRecurringFree|ProductPriceOneTimeFixed|ProductPriceOneTimeCustom|ProductPriceOneTimeFree $productPrice * @param array $attachedCustomFields - * @param array $customerMetadata + * @param array $customerMetadata * @param ?\DateTime $modifiedAt - * @param ?CheckoutCustomFieldData $customFieldData + * @param ?array $customFieldData * @param ?string $embedOrigin * @param ?int $amount * @param ?int $taxAmount @@ -363,11 +366,13 @@ class Checkout * @param ?string $customerTaxId * @param CheckoutDiscountFixedOnceForeverDuration|CheckoutDiscountFixedRepeatDuration|CheckoutDiscountPercentageOnceForeverDuration|CheckoutDiscountPercentageRepeatDuration|null $discount * @param ?string $subscriptionId + * @phpstan-pure */ - public function __construct(\DateTime $createdAt, string $id, CheckoutStatus $status, string $clientSecret, string $url, \DateTime $expiresAt, string $successUrl, string $productId, string $productPriceId, bool $allowDiscountCodes, bool $isDiscountApplicable, bool $isFreeProductPrice, bool $isPaymentRequired, bool $isPaymentSetupRequired, bool $isPaymentFormRequired, PaymentProcessorMetadata $paymentProcessorMetadata, array $metadata, CheckoutProduct $product, ProductPriceRecurringFixed|ProductPriceRecurringCustom|ProductPriceRecurringFree|ProductPriceOneTimeFixed|ProductPriceOneTimeCustom|ProductPriceOneTimeFree $productPrice, array $attachedCustomFields, array $customerMetadata, ?\DateTime $modifiedAt = null, ?CheckoutCustomFieldData $customFieldData = null, ?string $embedOrigin = null, ?int $amount = null, ?int $taxAmount = null, ?string $currency = null, ?int $subtotalAmount = null, ?int $totalAmount = null, ?string $discountId = null, ?string $customerId = null, ?string $customerName = null, ?string $customerEmail = null, ?string $customerIpAddress = null, ?Address $customerBillingAddress = null, ?string $customerTaxId = null, CheckoutDiscountFixedOnceForeverDuration|CheckoutDiscountFixedRepeatDuration|CheckoutDiscountPercentageOnceForeverDuration|CheckoutDiscountPercentageRepeatDuration|null $discount = null, ?string $subscriptionId = null, PaymentProcessor $paymentProcessor = PaymentProcessor::Stripe) + public function __construct(\DateTime $createdAt, string $id, PaymentProcessor $paymentProcessor, CheckoutStatus $status, string $clientSecret, string $url, \DateTime $expiresAt, string $successUrl, string $productId, string $productPriceId, bool $allowDiscountCodes, bool $isDiscountApplicable, bool $isFreeProductPrice, bool $isPaymentRequired, bool $isPaymentSetupRequired, bool $isPaymentFormRequired, array $paymentProcessorMetadata, array $metadata, CheckoutProduct $product, ProductPriceRecurringFixed|ProductPriceRecurringCustom|ProductPriceRecurringFree|ProductPriceOneTimeFixed|ProductPriceOneTimeCustom|ProductPriceOneTimeFree $productPrice, array $attachedCustomFields, array $customerMetadata, ?\DateTime $modifiedAt = null, ?array $customFieldData = null, ?string $embedOrigin = null, ?int $amount = null, ?int $taxAmount = null, ?string $currency = null, ?int $subtotalAmount = null, ?int $totalAmount = null, ?string $discountId = null, ?string $customerId = null, ?string $customerName = null, ?string $customerEmail = null, ?string $customerIpAddress = null, ?Address $customerBillingAddress = null, ?string $customerTaxId = null, CheckoutDiscountFixedOnceForeverDuration|CheckoutDiscountFixedRepeatDuration|CheckoutDiscountPercentageOnceForeverDuration|CheckoutDiscountPercentageRepeatDuration|null $discount = null, ?string $subscriptionId = null) { $this->createdAt = $createdAt; $this->id = $id; + $this->paymentProcessor = $paymentProcessor; $this->status = $status; $this->clientSecret = $clientSecret; $this->url = $url; @@ -404,6 +409,5 @@ public function __construct(\DateTime $createdAt, string $id, CheckoutStatus $st $this->customerTaxId = $customerTaxId; $this->discount = $discount; $this->subscriptionId = $subscriptionId; - $this->paymentProcessor = $paymentProcessor; } } \ No newline at end of file diff --git a/src/Models/Components/CheckoutConfirmStripe.php b/src/Models/Components/CheckoutConfirmStripe.php index f4e2971..1865c59 100644 --- a/src/Models/Components/CheckoutConfirmStripe.php +++ b/src/Models/Components/CheckoutConfirmStripe.php @@ -15,12 +15,12 @@ class CheckoutConfirmStripe /** * Key-value object storing custom field values. * - * @var ?CheckoutConfirmStripeCustomFieldData $customFieldData + * @var ?array $customFieldData */ #[\Speakeasy\Serializer\Annotation\SerializedName('custom_field_data')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CheckoutConfirmStripeCustomFieldData|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?CheckoutConfirmStripeCustomFieldData $customFieldData = null; + public ?array $customFieldData = null; /** * ID of the product price to checkout. Must correspond to a price linked to the same product. @@ -91,7 +91,7 @@ class CheckoutConfirmStripe public ?string $confirmationTokenId = null; /** - * @param ?CheckoutConfirmStripeCustomFieldData $customFieldData + * @param ?array $customFieldData * @param ?string $productPriceId * @param ?int $amount * @param ?string $customerName @@ -100,8 +100,9 @@ class CheckoutConfirmStripe * @param ?string $customerTaxId * @param ?string $discountCode * @param ?string $confirmationTokenId + * @phpstan-pure */ - public function __construct(?CheckoutConfirmStripeCustomFieldData $customFieldData = null, ?string $productPriceId = null, ?int $amount = null, ?string $customerName = null, ?string $customerEmail = null, ?Address $customerBillingAddress = null, ?string $customerTaxId = null, ?string $discountCode = null, ?string $confirmationTokenId = null) + public function __construct(?array $customFieldData = null, ?string $productPriceId = null, ?int $amount = null, ?string $customerName = null, ?string $customerEmail = null, ?Address $customerBillingAddress = null, ?string $customerTaxId = null, ?string $discountCode = null, ?string $confirmationTokenId = null) { $this->customFieldData = $customFieldData; $this->productPriceId = $productPriceId; diff --git a/src/Models/Components/CheckoutConfirmStripeCustomFieldData.php b/src/Models/Components/CheckoutConfirmStripeCustomFieldData.php deleted file mode 100644 index 4a50958..0000000 --- a/src/Models/Components/CheckoutConfirmStripeCustomFieldData.php +++ /dev/null @@ -1,18 +0,0 @@ - $metadata + * @var array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $metadata; + /** + * + * @var PaymentProcessor $paymentProcessor + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('payment_processor')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\PaymentProcessor')] + public PaymentProcessor $paymentProcessor; + /** * Client secret used to access the checkout link. * @@ -122,7 +130,7 @@ class CheckoutLink * @var ProductPriceRecurringFixed|ProductPriceRecurringCustom|ProductPriceRecurringFree|ProductPriceOneTimeFixed|ProductPriceOneTimeCustom|ProductPriceOneTimeFree|null $productPrice */ #[\Speakeasy\Serializer\Annotation\SerializedName('product_price')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\ProductPriceRecurringFixed|\Polar\Models\Components\ProductPriceRecurringCustom|\Polar\Models\Components\ProductPriceRecurringFree|\Polar\Models\Components\ProductPriceOneTimeFixed|\Polar\Models\Components\ProductPriceOneTimeCustom|\Polar\Models\Components\ProductPriceOneTimeFree')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\ProductPriceRecurringFixed|\Polar\Models\Components\ProductPriceRecurringCustom|\Polar\Models\Components\ProductPriceRecurringFree|\Polar\Models\Components\ProductPriceOneTimeFixed|\Polar\Models\Components\ProductPriceOneTimeCustom|\Polar\Models\Components\ProductPriceOneTimeFree|null')] public ProductPriceRecurringFixed|ProductPriceRecurringCustom|ProductPriceRecurringFree|ProductPriceOneTimeFixed|ProductPriceOneTimeCustom|ProductPriceOneTimeFree|null $productPrice; /** @@ -130,21 +138,13 @@ class CheckoutLink * @var DiscountFixedOnceForeverDurationBase|DiscountFixedRepeatDurationBase|DiscountPercentageOnceForeverDurationBase|DiscountPercentageRepeatDurationBase|null $discount */ #[\Speakeasy\Serializer\Annotation\SerializedName('discount')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\DiscountFixedOnceForeverDurationBase|\Polar\Models\Components\DiscountFixedRepeatDurationBase|\Polar\Models\Components\DiscountPercentageOnceForeverDurationBase|\Polar\Models\Components\DiscountPercentageRepeatDurationBase')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\DiscountFixedOnceForeverDurationBase|\Polar\Models\Components\DiscountFixedRepeatDurationBase|\Polar\Models\Components\DiscountPercentageOnceForeverDurationBase|\Polar\Models\Components\DiscountPercentageRepeatDurationBase|null')] public DiscountFixedOnceForeverDurationBase|DiscountFixedRepeatDurationBase|DiscountPercentageOnceForeverDurationBase|DiscountPercentageRepeatDurationBase|null $discount; - /** - * - * @var PaymentProcessor $paymentProcessor - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('payment_processor')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\PaymentProcessor')] - public PaymentProcessor $paymentProcessor; - /** * @param \DateTime $createdAt * @param string $id - * @param array $metadata + * @param array $metadata * @param PaymentProcessor $paymentProcessor * @param string $clientSecret * @param bool $allowDiscountCodes @@ -158,12 +158,14 @@ class CheckoutLink * @param ?string $discountId * @param ProductPriceRecurringFixed|ProductPriceRecurringCustom|ProductPriceRecurringFree|ProductPriceOneTimeFixed|ProductPriceOneTimeCustom|ProductPriceOneTimeFree|null $productPrice * @param DiscountFixedOnceForeverDurationBase|DiscountFixedRepeatDurationBase|DiscountPercentageOnceForeverDurationBase|DiscountPercentageRepeatDurationBase|null $discount + * @phpstan-pure */ - public function __construct(\DateTime $createdAt, string $id, array $metadata, string $clientSecret, bool $allowDiscountCodes, string $productId, CheckoutLinkProduct $product, string $url, ?\DateTime $modifiedAt = null, ?string $successUrl = null, ?string $label = null, ?string $productPriceId = null, ?string $discountId = null, ProductPriceRecurringFixed|ProductPriceRecurringCustom|ProductPriceRecurringFree|ProductPriceOneTimeFixed|ProductPriceOneTimeCustom|ProductPriceOneTimeFree|null $productPrice = null, DiscountFixedOnceForeverDurationBase|DiscountFixedRepeatDurationBase|DiscountPercentageOnceForeverDurationBase|DiscountPercentageRepeatDurationBase|null $discount = null, PaymentProcessor $paymentProcessor = PaymentProcessor::Stripe) + public function __construct(\DateTime $createdAt, string $id, array $metadata, PaymentProcessor $paymentProcessor, string $clientSecret, bool $allowDiscountCodes, string $productId, CheckoutLinkProduct $product, string $url, ?\DateTime $modifiedAt = null, ?string $successUrl = null, ?string $label = null, ?string $productPriceId = null, ?string $discountId = null, ProductPriceRecurringFixed|ProductPriceRecurringCustom|ProductPriceRecurringFree|ProductPriceOneTimeFixed|ProductPriceOneTimeCustom|ProductPriceOneTimeFree|null $productPrice = null, DiscountFixedOnceForeverDurationBase|DiscountFixedRepeatDurationBase|DiscountPercentageOnceForeverDurationBase|DiscountPercentageRepeatDurationBase|null $discount = null) { $this->createdAt = $createdAt; $this->id = $id; $this->metadata = $metadata; + $this->paymentProcessor = $paymentProcessor; $this->clientSecret = $clientSecret; $this->allowDiscountCodes = $allowDiscountCodes; $this->productId = $productId; @@ -176,6 +178,5 @@ public function __construct(\DateTime $createdAt, string $id, array $metadata, s $this->discountId = $discountId; $this->productPrice = $productPrice; $this->discount = $discount; - $this->paymentProcessor = $paymentProcessor; } } \ No newline at end of file diff --git a/src/Models/Components/CheckoutLinkPriceCreate.php b/src/Models/Components/CheckoutLinkPriceCreate.php index 9303716..c84a8f9 100644 --- a/src/Models/Components/CheckoutLinkPriceCreate.php +++ b/src/Models/Components/CheckoutLinkPriceCreate.php @@ -32,10 +32,10 @@ class CheckoutLinkPriceCreate * * You can store up to **50 key-value pairs**. * - * @var ?array $metadata + * @var ?array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $metadata = null; @@ -69,11 +69,10 @@ class CheckoutLinkPriceCreate /** * Payment processor to use. Currently only Stripe is supported. * - * @var CheckoutLinkPriceCreatePaymentProcessor $paymentProcessor + * @var string $paymentProcessor */ #[\Speakeasy\Serializer\Annotation\SerializedName('payment_processor')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CheckoutLinkPriceCreatePaymentProcessor')] - public CheckoutLinkPriceCreatePaymentProcessor $paymentProcessor; + public string $paymentProcessor; /** * Whether to allow the customer to apply discount codes. If you apply a discount through `discount_id`, it'll still be applied, but the customer won't be able to change it. @@ -85,15 +84,16 @@ class CheckoutLinkPriceCreate public ?bool $allowDiscountCodes = null; /** - * @param CheckoutLinkPriceCreatePaymentProcessor $paymentProcessor + * @param string $paymentProcessor * @param string $productPriceId - * @param ?array $metadata + * @param ?array $metadata * @param ?bool $allowDiscountCodes * @param ?string $label * @param ?string $discountId * @param ?string $successUrl + * @phpstan-pure */ - public function __construct(string $productPriceId, ?array $metadata = null, ?string $label = null, ?string $discountId = null, ?string $successUrl = null, CheckoutLinkPriceCreatePaymentProcessor $paymentProcessor = CheckoutLinkPriceCreatePaymentProcessor::Stripe, ?bool $allowDiscountCodes = true) + public function __construct(string $productPriceId, ?array $metadata = null, ?string $label = null, ?string $discountId = null, ?string $successUrl = null, string $paymentProcessor = 'stripe', ?bool $allowDiscountCodes = true) { $this->productPriceId = $productPriceId; $this->metadata = $metadata; diff --git a/src/Models/Components/CheckoutLinkPriceCreatePaymentProcessor.php b/src/Models/Components/CheckoutLinkPriceCreatePaymentProcessor.php deleted file mode 100644 index 95e0f6b..0000000 --- a/src/Models/Components/CheckoutLinkPriceCreatePaymentProcessor.php +++ /dev/null @@ -1,16 +0,0 @@ - $prices + * @var array $prices */ #[\Speakeasy\Serializer\Annotation\SerializedName('prices')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Polar\Models\Components\ProductPriceRecurringFixed|\Polar\Models\Components\ProductPriceRecurringCustom|\Polar\Models\Components\ProductPriceRecurringFree|\Polar\Models\Components\ProductPriceOneTimeFixed|\Polar\Models\Components\ProductPriceOneTimeCustom|\Polar\Models\Components\ProductPriceOneTimeFree>')] public array $prices; /** @@ -110,11 +110,12 @@ class CheckoutLinkProduct * @param bool $isRecurring * @param bool $isArchived * @param string $organizationId - * @param array $prices + * @param array $prices * @param array $benefits * @param array $medias * @param ?\DateTime $modifiedAt * @param ?string $description + * @phpstan-pure */ public function __construct(\DateTime $createdAt, string $id, string $name, bool $isRecurring, bool $isArchived, string $organizationId, array $prices, array $benefits, array $medias, ?\DateTime $modifiedAt = null, ?string $description = null) { diff --git a/src/Models/Components/CheckoutLinkProductCreate.php b/src/Models/Components/CheckoutLinkProductCreate.php index 29e4f00..3846e05 100644 --- a/src/Models/Components/CheckoutLinkProductCreate.php +++ b/src/Models/Components/CheckoutLinkProductCreate.php @@ -32,10 +32,10 @@ class CheckoutLinkProductCreate * * You can store up to **50 key-value pairs**. * - * @var ?array $metadata + * @var ?array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $metadata = null; @@ -69,11 +69,10 @@ class CheckoutLinkProductCreate /** * Payment processor to use. Currently only Stripe is supported. * - * @var CheckoutLinkProductCreatePaymentProcessor $paymentProcessor + * @var string $paymentProcessor */ #[\Speakeasy\Serializer\Annotation\SerializedName('payment_processor')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CheckoutLinkProductCreatePaymentProcessor')] - public CheckoutLinkProductCreatePaymentProcessor $paymentProcessor; + public string $paymentProcessor; /** * Whether to allow the customer to apply discount codes. If you apply a discount through `discount_id`, it'll still be applied, but the customer won't be able to change it. @@ -85,15 +84,16 @@ class CheckoutLinkProductCreate public ?bool $allowDiscountCodes = null; /** - * @param CheckoutLinkProductCreatePaymentProcessor $paymentProcessor + * @param string $paymentProcessor * @param string $productId - * @param ?array $metadata + * @param ?array $metadata * @param ?bool $allowDiscountCodes * @param ?string $label * @param ?string $discountId * @param ?string $successUrl + * @phpstan-pure */ - public function __construct(string $productId, ?array $metadata = null, ?string $label = null, ?string $discountId = null, ?string $successUrl = null, CheckoutLinkProductCreatePaymentProcessor $paymentProcessor = CheckoutLinkProductCreatePaymentProcessor::Stripe, ?bool $allowDiscountCodes = true) + public function __construct(string $productId, ?array $metadata = null, ?string $label = null, ?string $discountId = null, ?string $successUrl = null, string $paymentProcessor = 'stripe', ?bool $allowDiscountCodes = true) { $this->productId = $productId; $this->metadata = $metadata; diff --git a/src/Models/Components/CheckoutLinkProductCreatePaymentProcessor.php b/src/Models/Components/CheckoutLinkProductCreatePaymentProcessor.php deleted file mode 100644 index 9525a00..0000000 --- a/src/Models/Components/CheckoutLinkProductCreatePaymentProcessor.php +++ /dev/null @@ -1,16 +0,0 @@ - $metadata + * @var ?array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $metadata = null; @@ -66,12 +66,13 @@ class CheckoutLinkUpdate public ?string $successUrl = null; /** - * @param ?array $metadata + * @param ?array $metadata * @param ?string $label * @param ?bool $allowDiscountCodes * @param ?string $productPriceId * @param ?string $discountId * @param ?string $successUrl + * @phpstan-pure */ public function __construct(?array $metadata = null, ?string $label = null, ?bool $allowDiscountCodes = null, ?string $productPriceId = null, ?string $discountId = null, ?string $successUrl = null) { diff --git a/src/Models/Components/CheckoutPriceCreate.php b/src/Models/Components/CheckoutPriceCreate.php index 561cac6..494cf4d 100644 --- a/src/Models/Components/CheckoutPriceCreate.php +++ b/src/Models/Components/CheckoutPriceCreate.php @@ -39,22 +39,22 @@ class CheckoutPriceCreate * * You can store up to **50 key-value pairs**. * - * @var ?array $metadata + * @var ?array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $metadata = null; /** * Key-value object storing custom field values. * - * @var ?CheckoutPriceCreateCustomFieldData $customFieldData + * @var ?array $customFieldData */ #[\Speakeasy\Serializer\Annotation\SerializedName('custom_field_data')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CheckoutPriceCreateCustomFieldData|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?CheckoutPriceCreateCustomFieldData $customFieldData = null; + public ?array $customFieldData = null; /** * Key-value object allowing you to store additional information that'll be copied to the created customer. @@ -69,10 +69,10 @@ class CheckoutPriceCreate * * You can store up to **50 key-value pairs**. * - * @var ?array $customerMetadata + * @var ?array $customerMetadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('customer_metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $customerMetadata = null; @@ -170,15 +170,6 @@ class CheckoutPriceCreate #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $embedOrigin = null; - /** - * Payment processor to use. Currently only Stripe is supported. - * - * @var CheckoutPriceCreatePaymentProcessor $paymentProcessor - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('payment_processor')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CheckoutPriceCreatePaymentProcessor')] - public CheckoutPriceCreatePaymentProcessor $paymentProcessor; - /** * Whether to allow the customer to apply discount codes. If you apply a discount through `discount_id`, it'll still be applied, but the customer won't be able to change it. * @@ -189,12 +180,11 @@ class CheckoutPriceCreate public ?bool $allowDiscountCodes = null; /** - * @param CheckoutPriceCreatePaymentProcessor $paymentProcessor * @param string $productPriceId - * @param ?array $metadata - * @param ?CheckoutPriceCreateCustomFieldData $customFieldData + * @param ?array $metadata + * @param ?array $customFieldData * @param ?bool $allowDiscountCodes - * @param ?array $customerMetadata + * @param ?array $customerMetadata * @param ?string $discountId * @param ?int $amount * @param ?string $customerId @@ -206,8 +196,9 @@ class CheckoutPriceCreate * @param ?string $subscriptionId * @param ?string $successUrl * @param ?string $embedOrigin + * @phpstan-pure */ - public function __construct(string $productPriceId, ?array $metadata = null, ?CheckoutPriceCreateCustomFieldData $customFieldData = null, ?array $customerMetadata = null, ?string $discountId = null, ?int $amount = null, ?string $customerId = null, ?string $customerName = null, ?string $customerEmail = null, ?string $customerIpAddress = null, ?Address $customerBillingAddress = null, ?string $customerTaxId = null, ?string $subscriptionId = null, ?string $successUrl = null, ?string $embedOrigin = null, CheckoutPriceCreatePaymentProcessor $paymentProcessor = CheckoutPriceCreatePaymentProcessor::Stripe, ?bool $allowDiscountCodes = true) + public function __construct(string $productPriceId, ?array $metadata = null, ?array $customFieldData = null, ?array $customerMetadata = null, ?string $discountId = null, ?int $amount = null, ?string $customerId = null, ?string $customerName = null, ?string $customerEmail = null, ?string $customerIpAddress = null, ?Address $customerBillingAddress = null, ?string $customerTaxId = null, ?string $subscriptionId = null, ?string $successUrl = null, ?string $embedOrigin = null, ?bool $allowDiscountCodes = true) { $this->productPriceId = $productPriceId; $this->metadata = $metadata; @@ -224,7 +215,6 @@ public function __construct(string $productPriceId, ?array $metadata = null, ?Ch $this->subscriptionId = $subscriptionId; $this->successUrl = $successUrl; $this->embedOrigin = $embedOrigin; - $this->paymentProcessor = $paymentProcessor; $this->allowDiscountCodes = $allowDiscountCodes; } } \ No newline at end of file diff --git a/src/Models/Components/CheckoutPriceCreateCustomFieldData.php b/src/Models/Components/CheckoutPriceCreateCustomFieldData.php deleted file mode 100644 index 719e827..0000000 --- a/src/Models/Components/CheckoutPriceCreateCustomFieldData.php +++ /dev/null @@ -1,19 +0,0 @@ - $prices + * @var array $prices */ #[\Speakeasy\Serializer\Annotation\SerializedName('prices')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Polar\Models\Components\ProductPriceRecurringFixed|\Polar\Models\Components\ProductPriceRecurringCustom|\Polar\Models\Components\ProductPriceRecurringFree|\Polar\Models\Components\ProductPriceOneTimeFixed|\Polar\Models\Components\ProductPriceOneTimeCustom|\Polar\Models\Components\ProductPriceOneTimeFree>')] public array $prices; /** @@ -110,11 +110,12 @@ class CheckoutProduct * @param bool $isRecurring * @param bool $isArchived * @param string $organizationId - * @param array $prices + * @param array $prices * @param array $benefits * @param array $medias * @param ?\DateTime $modifiedAt * @param ?string $description + * @phpstan-pure */ public function __construct(\DateTime $createdAt, string $id, string $name, bool $isRecurring, bool $isArchived, string $organizationId, array $prices, array $benefits, array $medias, ?\DateTime $modifiedAt = null, ?string $description = null) { diff --git a/src/Models/Components/CheckoutProductCreate.php b/src/Models/Components/CheckoutProductCreate.php index 1240f72..20806c7 100644 --- a/src/Models/Components/CheckoutProductCreate.php +++ b/src/Models/Components/CheckoutProductCreate.php @@ -39,22 +39,22 @@ class CheckoutProductCreate * * You can store up to **50 key-value pairs**. * - * @var ?array $metadata + * @var ?array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $metadata = null; /** * Key-value object storing custom field values. * - * @var ?CheckoutProductCreateCustomFieldData $customFieldData + * @var ?array $customFieldData */ #[\Speakeasy\Serializer\Annotation\SerializedName('custom_field_data')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CheckoutProductCreateCustomFieldData|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?CheckoutProductCreateCustomFieldData $customFieldData = null; + public ?array $customFieldData = null; /** * Key-value object allowing you to store additional information that'll be copied to the created customer. @@ -69,10 +69,10 @@ class CheckoutProductCreate * * You can store up to **50 key-value pairs**. * - * @var ?array $customerMetadata + * @var ?array $customerMetadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('customer_metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $customerMetadata = null; @@ -170,15 +170,6 @@ class CheckoutProductCreate #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $embedOrigin = null; - /** - * Payment processor to use. Currently only Stripe is supported. - * - * @var CheckoutProductCreatePaymentProcessor $paymentProcessor - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('payment_processor')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CheckoutProductCreatePaymentProcessor')] - public CheckoutProductCreatePaymentProcessor $paymentProcessor; - /** * Whether to allow the customer to apply discount codes. If you apply a discount through `discount_id`, it'll still be applied, but the customer won't be able to change it. * @@ -189,12 +180,11 @@ class CheckoutProductCreate public ?bool $allowDiscountCodes = null; /** - * @param CheckoutProductCreatePaymentProcessor $paymentProcessor * @param string $productId - * @param ?array $metadata - * @param ?CheckoutProductCreateCustomFieldData $customFieldData + * @param ?array $metadata + * @param ?array $customFieldData * @param ?bool $allowDiscountCodes - * @param ?array $customerMetadata + * @param ?array $customerMetadata * @param ?string $discountId * @param ?int $amount * @param ?string $customerId @@ -206,8 +196,9 @@ class CheckoutProductCreate * @param ?string $subscriptionId * @param ?string $successUrl * @param ?string $embedOrigin + * @phpstan-pure */ - public function __construct(string $productId, ?array $metadata = null, ?CheckoutProductCreateCustomFieldData $customFieldData = null, ?array $customerMetadata = null, ?string $discountId = null, ?int $amount = null, ?string $customerId = null, ?string $customerName = null, ?string $customerEmail = null, ?string $customerIpAddress = null, ?Address $customerBillingAddress = null, ?string $customerTaxId = null, ?string $subscriptionId = null, ?string $successUrl = null, ?string $embedOrigin = null, CheckoutProductCreatePaymentProcessor $paymentProcessor = CheckoutProductCreatePaymentProcessor::Stripe, ?bool $allowDiscountCodes = true) + public function __construct(string $productId, ?array $metadata = null, ?array $customFieldData = null, ?array $customerMetadata = null, ?string $discountId = null, ?int $amount = null, ?string $customerId = null, ?string $customerName = null, ?string $customerEmail = null, ?string $customerIpAddress = null, ?Address $customerBillingAddress = null, ?string $customerTaxId = null, ?string $subscriptionId = null, ?string $successUrl = null, ?string $embedOrigin = null, ?bool $allowDiscountCodes = true) { $this->productId = $productId; $this->metadata = $metadata; @@ -224,7 +215,6 @@ public function __construct(string $productId, ?array $metadata = null, ?Checkou $this->subscriptionId = $subscriptionId; $this->successUrl = $successUrl; $this->embedOrigin = $embedOrigin; - $this->paymentProcessor = $paymentProcessor; $this->allowDiscountCodes = $allowDiscountCodes; } } \ No newline at end of file diff --git a/src/Models/Components/CheckoutProductCreateCustomFieldData.php b/src/Models/Components/CheckoutProductCreateCustomFieldData.php deleted file mode 100644 index 7264fd6..0000000 --- a/src/Models/Components/CheckoutProductCreateCustomFieldData.php +++ /dev/null @@ -1,19 +0,0 @@ - $paymentProcessorMetadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('payment_processor_metadata')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CheckoutPublicPaymentProcessorMetadata')] - public CheckoutPublicPaymentProcessorMetadata $paymentProcessorMetadata; + #[\Speakeasy\Serializer\Annotation\Type('array')] + public array $paymentProcessorMetadata; /** * Product data for a checkout session. @@ -185,12 +194,12 @@ class CheckoutPublic /** * Key-value object storing custom field values. * - * @var ?CheckoutPublicCustomFieldData $customFieldData + * @var ?array $customFieldData */ #[\Speakeasy\Serializer\Annotation\SerializedName('custom_field_data')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CheckoutPublicCustomFieldData|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?CheckoutPublicCustomFieldData $customFieldData = null; + public ?array $customFieldData = null; /** * When checkout is embedded, represents the Origin of the page embedding the checkout. Used as a security measure to send messages only to the embedding page. @@ -255,6 +264,7 @@ class CheckoutPublic public ?string $customerId; /** + * Name of the customer. * * @var ?string $customerName */ @@ -262,6 +272,7 @@ class CheckoutPublic public ?string $customerName; /** + * Email address of the customer. * * @var ?string $customerEmail */ @@ -295,17 +306,9 @@ class CheckoutPublic * @var CheckoutDiscountFixedOnceForeverDuration|CheckoutDiscountFixedRepeatDuration|CheckoutDiscountPercentageOnceForeverDuration|CheckoutDiscountPercentageRepeatDuration|null $discount */ #[\Speakeasy\Serializer\Annotation\SerializedName('discount')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CheckoutDiscountFixedOnceForeverDuration|\Polar\Models\Components\CheckoutDiscountFixedRepeatDuration|\Polar\Models\Components\CheckoutDiscountPercentageOnceForeverDuration|\Polar\Models\Components\CheckoutDiscountPercentageRepeatDuration')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CheckoutDiscountFixedOnceForeverDuration|\Polar\Models\Components\CheckoutDiscountFixedRepeatDuration|\Polar\Models\Components\CheckoutDiscountPercentageOnceForeverDuration|\Polar\Models\Components\CheckoutDiscountPercentageRepeatDuration|null')] public CheckoutDiscountFixedOnceForeverDuration|CheckoutDiscountFixedRepeatDuration|CheckoutDiscountPercentageOnceForeverDuration|CheckoutDiscountPercentageRepeatDuration|null $discount; - /** - * - * @var PaymentProcessor $paymentProcessor - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('payment_processor')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\PaymentProcessor')] - public PaymentProcessor $paymentProcessor; - /** * @param \DateTime $createdAt * @param string $id @@ -323,13 +326,13 @@ class CheckoutPublic * @param bool $isPaymentRequired * @param bool $isPaymentSetupRequired * @param bool $isPaymentFormRequired - * @param CheckoutPublicPaymentProcessorMetadata $paymentProcessorMetadata + * @param array $paymentProcessorMetadata * @param CheckoutProduct $product * @param ProductPriceRecurringFixed|ProductPriceRecurringCustom|ProductPriceRecurringFree|ProductPriceOneTimeFixed|ProductPriceOneTimeCustom|ProductPriceOneTimeFree $productPrice * @param Organization $organization * @param array $attachedCustomFields * @param ?\DateTime $modifiedAt - * @param ?CheckoutPublicCustomFieldData $customFieldData + * @param ?array $customFieldData * @param ?string $embedOrigin * @param ?int $amount * @param ?int $taxAmount @@ -344,11 +347,13 @@ class CheckoutPublic * @param ?Address $customerBillingAddress * @param ?string $customerTaxId * @param CheckoutDiscountFixedOnceForeverDuration|CheckoutDiscountFixedRepeatDuration|CheckoutDiscountPercentageOnceForeverDuration|CheckoutDiscountPercentageRepeatDuration|null $discount + * @phpstan-pure */ - public function __construct(\DateTime $createdAt, string $id, CheckoutStatus $status, string $clientSecret, string $url, \DateTime $expiresAt, string $successUrl, string $productId, string $productPriceId, bool $allowDiscountCodes, bool $isDiscountApplicable, bool $isFreeProductPrice, bool $isPaymentRequired, bool $isPaymentSetupRequired, bool $isPaymentFormRequired, CheckoutPublicPaymentProcessorMetadata $paymentProcessorMetadata, CheckoutProduct $product, ProductPriceRecurringFixed|ProductPriceRecurringCustom|ProductPriceRecurringFree|ProductPriceOneTimeFixed|ProductPriceOneTimeCustom|ProductPriceOneTimeFree $productPrice, Organization $organization, array $attachedCustomFields, ?\DateTime $modifiedAt = null, ?CheckoutPublicCustomFieldData $customFieldData = null, ?string $embedOrigin = null, ?int $amount = null, ?int $taxAmount = null, ?string $currency = null, ?int $subtotalAmount = null, ?int $totalAmount = null, ?string $discountId = null, ?string $customerId = null, ?string $customerName = null, ?string $customerEmail = null, ?string $customerIpAddress = null, ?Address $customerBillingAddress = null, ?string $customerTaxId = null, CheckoutDiscountFixedOnceForeverDuration|CheckoutDiscountFixedRepeatDuration|CheckoutDiscountPercentageOnceForeverDuration|CheckoutDiscountPercentageRepeatDuration|null $discount = null, PaymentProcessor $paymentProcessor = PaymentProcessor::Stripe) + public function __construct(\DateTime $createdAt, string $id, PaymentProcessor $paymentProcessor, CheckoutStatus $status, string $clientSecret, string $url, \DateTime $expiresAt, string $successUrl, string $productId, string $productPriceId, bool $allowDiscountCodes, bool $isDiscountApplicable, bool $isFreeProductPrice, bool $isPaymentRequired, bool $isPaymentSetupRequired, bool $isPaymentFormRequired, array $paymentProcessorMetadata, CheckoutProduct $product, ProductPriceRecurringFixed|ProductPriceRecurringCustom|ProductPriceRecurringFree|ProductPriceOneTimeFixed|ProductPriceOneTimeCustom|ProductPriceOneTimeFree $productPrice, Organization $organization, array $attachedCustomFields, ?\DateTime $modifiedAt = null, ?array $customFieldData = null, ?string $embedOrigin = null, ?int $amount = null, ?int $taxAmount = null, ?string $currency = null, ?int $subtotalAmount = null, ?int $totalAmount = null, ?string $discountId = null, ?string $customerId = null, ?string $customerName = null, ?string $customerEmail = null, ?string $customerIpAddress = null, ?Address $customerBillingAddress = null, ?string $customerTaxId = null, CheckoutDiscountFixedOnceForeverDuration|CheckoutDiscountFixedRepeatDuration|CheckoutDiscountPercentageOnceForeverDuration|CheckoutDiscountPercentageRepeatDuration|null $discount = null) { $this->createdAt = $createdAt; $this->id = $id; + $this->paymentProcessor = $paymentProcessor; $this->status = $status; $this->clientSecret = $clientSecret; $this->url = $url; @@ -383,6 +388,5 @@ public function __construct(\DateTime $createdAt, string $id, CheckoutStatus $st $this->customerBillingAddress = $customerBillingAddress; $this->customerTaxId = $customerTaxId; $this->discount = $discount; - $this->paymentProcessor = $paymentProcessor; } } \ No newline at end of file diff --git a/src/Models/Components/CheckoutPublicConfirmed.php b/src/Models/Components/CheckoutPublicConfirmed.php index 33e58e4..e3a5fba 100644 --- a/src/Models/Components/CheckoutPublicConfirmed.php +++ b/src/Models/Components/CheckoutPublicConfirmed.php @@ -34,6 +34,14 @@ class CheckoutPublicConfirmed #[\Speakeasy\Serializer\Annotation\SerializedName('id')] public string $id; + /** + * + * @var PaymentProcessor $paymentProcessor + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('payment_processor')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\PaymentProcessor')] + public PaymentProcessor $paymentProcessor; + /** * Client secret used to update and complete the checkout session from the client. * @@ -131,12 +139,13 @@ class CheckoutPublicConfirmed public bool $isPaymentFormRequired; /** + * $paymentProcessorMetadata * - * @var CheckoutPublicConfirmedPaymentProcessorMetadata $paymentProcessorMetadata + * @var array $paymentProcessorMetadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('payment_processor_metadata')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CheckoutPublicConfirmedPaymentProcessorMetadata')] - public CheckoutPublicConfirmedPaymentProcessorMetadata $paymentProcessorMetadata; + #[\Speakeasy\Serializer\Annotation\Type('array')] + public array $paymentProcessorMetadata; /** * Product data for a checkout session. @@ -190,12 +199,12 @@ class CheckoutPublicConfirmed /** * Key-value object storing custom field values. * - * @var ?CheckoutPublicConfirmedCustomFieldData $customFieldData + * @var ?array $customFieldData */ #[\Speakeasy\Serializer\Annotation\SerializedName('custom_field_data')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CheckoutPublicConfirmedCustomFieldData|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?CheckoutPublicConfirmedCustomFieldData $customFieldData = null; + public ?array $customFieldData = null; /** * When checkout is embedded, represents the Origin of the page embedding the checkout. Used as a security measure to send messages only to the embedding page. @@ -260,6 +269,7 @@ class CheckoutPublicConfirmed public ?string $customerId; /** + * Name of the customer. * * @var ?string $customerName */ @@ -267,6 +277,7 @@ class CheckoutPublicConfirmed public ?string $customerName; /** + * Email address of the customer. * * @var ?string $customerEmail */ @@ -300,30 +311,21 @@ class CheckoutPublicConfirmed * @var CheckoutDiscountFixedOnceForeverDuration|CheckoutDiscountFixedRepeatDuration|CheckoutDiscountPercentageOnceForeverDuration|CheckoutDiscountPercentageRepeatDuration|null $discount */ #[\Speakeasy\Serializer\Annotation\SerializedName('discount')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CheckoutDiscountFixedOnceForeverDuration|\Polar\Models\Components\CheckoutDiscountFixedRepeatDuration|\Polar\Models\Components\CheckoutDiscountPercentageOnceForeverDuration|\Polar\Models\Components\CheckoutDiscountPercentageRepeatDuration')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CheckoutDiscountFixedOnceForeverDuration|\Polar\Models\Components\CheckoutDiscountFixedRepeatDuration|\Polar\Models\Components\CheckoutDiscountPercentageOnceForeverDuration|\Polar\Models\Components\CheckoutDiscountPercentageRepeatDuration|null')] public CheckoutDiscountFixedOnceForeverDuration|CheckoutDiscountFixedRepeatDuration|CheckoutDiscountPercentageOnceForeverDuration|CheckoutDiscountPercentageRepeatDuration|null $discount; /** * - * @var PaymentProcessor $paymentProcessor - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('payment_processor')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\PaymentProcessor')] - public PaymentProcessor $paymentProcessor; - - /** - * - * @var Status $status + * @var string $status */ #[\Speakeasy\Serializer\Annotation\SerializedName('status')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\Status')] - public Status $status; + public string $status; /** * @param \DateTime $createdAt * @param string $id * @param PaymentProcessor $paymentProcessor - * @param Status $status + * @param string $status * @param string $clientSecret * @param string $url * @param \DateTime $expiresAt @@ -336,14 +338,14 @@ class CheckoutPublicConfirmed * @param bool $isPaymentRequired * @param bool $isPaymentSetupRequired * @param bool $isPaymentFormRequired - * @param CheckoutPublicConfirmedPaymentProcessorMetadata $paymentProcessorMetadata + * @param array $paymentProcessorMetadata * @param CheckoutProduct $product * @param ProductPriceRecurringFixed|ProductPriceRecurringCustom|ProductPriceRecurringFree|ProductPriceOneTimeFixed|ProductPriceOneTimeCustom|ProductPriceOneTimeFree $productPrice * @param Organization $organization * @param array $attachedCustomFields * @param string $customerSessionToken * @param ?\DateTime $modifiedAt - * @param ?CheckoutPublicConfirmedCustomFieldData $customFieldData + * @param ?array $customFieldData * @param ?string $embedOrigin * @param ?int $amount * @param ?int $taxAmount @@ -358,11 +360,13 @@ class CheckoutPublicConfirmed * @param ?Address $customerBillingAddress * @param ?string $customerTaxId * @param CheckoutDiscountFixedOnceForeverDuration|CheckoutDiscountFixedRepeatDuration|CheckoutDiscountPercentageOnceForeverDuration|CheckoutDiscountPercentageRepeatDuration|null $discount + * @phpstan-pure */ - public function __construct(\DateTime $createdAt, string $id, string $clientSecret, string $url, \DateTime $expiresAt, string $successUrl, string $productId, string $productPriceId, bool $allowDiscountCodes, bool $isDiscountApplicable, bool $isFreeProductPrice, bool $isPaymentRequired, bool $isPaymentSetupRequired, bool $isPaymentFormRequired, CheckoutPublicConfirmedPaymentProcessorMetadata $paymentProcessorMetadata, CheckoutProduct $product, ProductPriceRecurringFixed|ProductPriceRecurringCustom|ProductPriceRecurringFree|ProductPriceOneTimeFixed|ProductPriceOneTimeCustom|ProductPriceOneTimeFree $productPrice, Organization $organization, array $attachedCustomFields, string $customerSessionToken, ?\DateTime $modifiedAt = null, ?CheckoutPublicConfirmedCustomFieldData $customFieldData = null, ?string $embedOrigin = null, ?int $amount = null, ?int $taxAmount = null, ?string $currency = null, ?int $subtotalAmount = null, ?int $totalAmount = null, ?string $discountId = null, ?string $customerId = null, ?string $customerName = null, ?string $customerEmail = null, ?string $customerIpAddress = null, ?Address $customerBillingAddress = null, ?string $customerTaxId = null, CheckoutDiscountFixedOnceForeverDuration|CheckoutDiscountFixedRepeatDuration|CheckoutDiscountPercentageOnceForeverDuration|CheckoutDiscountPercentageRepeatDuration|null $discount = null, PaymentProcessor $paymentProcessor = PaymentProcessor::Stripe, Status $status = Status::Confirmed) + public function __construct(\DateTime $createdAt, string $id, PaymentProcessor $paymentProcessor, string $clientSecret, string $url, \DateTime $expiresAt, string $successUrl, string $productId, string $productPriceId, bool $allowDiscountCodes, bool $isDiscountApplicable, bool $isFreeProductPrice, bool $isPaymentRequired, bool $isPaymentSetupRequired, bool $isPaymentFormRequired, array $paymentProcessorMetadata, CheckoutProduct $product, ProductPriceRecurringFixed|ProductPriceRecurringCustom|ProductPriceRecurringFree|ProductPriceOneTimeFixed|ProductPriceOneTimeCustom|ProductPriceOneTimeFree $productPrice, Organization $organization, array $attachedCustomFields, string $customerSessionToken, ?\DateTime $modifiedAt = null, ?array $customFieldData = null, ?string $embedOrigin = null, ?int $amount = null, ?int $taxAmount = null, ?string $currency = null, ?int $subtotalAmount = null, ?int $totalAmount = null, ?string $discountId = null, ?string $customerId = null, ?string $customerName = null, ?string $customerEmail = null, ?string $customerIpAddress = null, ?Address $customerBillingAddress = null, ?string $customerTaxId = null, CheckoutDiscountFixedOnceForeverDuration|CheckoutDiscountFixedRepeatDuration|CheckoutDiscountPercentageOnceForeverDuration|CheckoutDiscountPercentageRepeatDuration|null $discount = null, string $status = 'confirmed') { $this->createdAt = $createdAt; $this->id = $id; + $this->paymentProcessor = $paymentProcessor; $this->clientSecret = $clientSecret; $this->url = $url; $this->expiresAt = $expiresAt; @@ -397,7 +401,6 @@ public function __construct(\DateTime $createdAt, string $id, string $clientSecr $this->customerBillingAddress = $customerBillingAddress; $this->customerTaxId = $customerTaxId; $this->discount = $discount; - $this->paymentProcessor = $paymentProcessor; $this->status = $status; } } \ No newline at end of file diff --git a/src/Models/Components/CheckoutPublicConfirmedCustomFieldData.php b/src/Models/Components/CheckoutPublicConfirmedCustomFieldData.php deleted file mode 100644 index 9f239b8..0000000 --- a/src/Models/Components/CheckoutPublicConfirmedCustomFieldData.php +++ /dev/null @@ -1,19 +0,0 @@ - $customFieldData */ #[\Speakeasy\Serializer\Annotation\SerializedName('custom_field_data')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomFieldData|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?CustomFieldData $customFieldData = null; + public ?array $customFieldData = null; /** * ID of the product price to checkout. Must correspond to a price linked to the same product. @@ -75,10 +75,10 @@ class CheckoutUpdate /** * $metadata * - * @var ?array $metadata + * @var ?array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $metadata = null; @@ -121,10 +121,10 @@ class CheckoutUpdate * * You can store up to **50 key-value pairs**. * - * @var ?array $customerMetadata + * @var ?array $customerMetadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('customer_metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $customerMetadata = null; @@ -147,22 +147,23 @@ class CheckoutUpdate public ?string $embedOrigin = null; /** - * @param ?CustomFieldData $customFieldData + * @param ?array $customFieldData * @param ?string $productPriceId * @param ?int $amount * @param ?string $customerName * @param ?string $customerEmail * @param ?Address $customerBillingAddress * @param ?string $customerTaxId - * @param ?array $metadata + * @param ?array $metadata * @param ?string $discountId * @param ?bool $allowDiscountCodes * @param ?string $customerIpAddress - * @param ?array $customerMetadata + * @param ?array $customerMetadata * @param ?string $successUrl * @param ?string $embedOrigin + * @phpstan-pure */ - public function __construct(?CustomFieldData $customFieldData = null, ?string $productPriceId = null, ?int $amount = null, ?string $customerName = null, ?string $customerEmail = null, ?Address $customerBillingAddress = null, ?string $customerTaxId = null, ?array $metadata = null, ?string $discountId = null, ?bool $allowDiscountCodes = null, ?string $customerIpAddress = null, ?array $customerMetadata = null, ?string $successUrl = null, ?string $embedOrigin = null) + public function __construct(?array $customFieldData = null, ?string $productPriceId = null, ?int $amount = null, ?string $customerName = null, ?string $customerEmail = null, ?Address $customerBillingAddress = null, ?string $customerTaxId = null, ?array $metadata = null, ?string $discountId = null, ?bool $allowDiscountCodes = null, ?string $customerIpAddress = null, ?array $customerMetadata = null, ?string $successUrl = null, ?string $embedOrigin = null) { $this->customFieldData = $customFieldData; $this->productPriceId = $productPriceId; diff --git a/src/Models/Components/CheckoutUpdatePublic.php b/src/Models/Components/CheckoutUpdatePublic.php index ac4de2d..5f2e3e4 100644 --- a/src/Models/Components/CheckoutUpdatePublic.php +++ b/src/Models/Components/CheckoutUpdatePublic.php @@ -15,12 +15,12 @@ class CheckoutUpdatePublic /** * Key-value object storing custom field values. * - * @var ?CheckoutUpdatePublicCustomFieldData $customFieldData + * @var ?array $customFieldData */ #[\Speakeasy\Serializer\Annotation\SerializedName('custom_field_data')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CheckoutUpdatePublicCustomFieldData|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?CheckoutUpdatePublicCustomFieldData $customFieldData = null; + public ?array $customFieldData = null; /** * ID of the product price to checkout. Must correspond to a price linked to the same product. @@ -82,7 +82,7 @@ class CheckoutUpdatePublic public ?string $discountCode = null; /** - * @param ?CheckoutUpdatePublicCustomFieldData $customFieldData + * @param ?array $customFieldData * @param ?string $productPriceId * @param ?int $amount * @param ?string $customerName @@ -90,8 +90,9 @@ class CheckoutUpdatePublic * @param ?Address $customerBillingAddress * @param ?string $customerTaxId * @param ?string $discountCode + * @phpstan-pure */ - public function __construct(?CheckoutUpdatePublicCustomFieldData $customFieldData = null, ?string $productPriceId = null, ?int $amount = null, ?string $customerName = null, ?string $customerEmail = null, ?Address $customerBillingAddress = null, ?string $customerTaxId = null, ?string $discountCode = null) + public function __construct(?array $customFieldData = null, ?string $productPriceId = null, ?int $amount = null, ?string $customerName = null, ?string $customerEmail = null, ?Address $customerBillingAddress = null, ?string $customerTaxId = null, ?string $discountCode = null) { $this->customFieldData = $customFieldData; $this->productPriceId = $productPriceId; diff --git a/src/Models/Components/CheckoutUpdatePublicCustomFieldData.php b/src/Models/Components/CheckoutUpdatePublicCustomFieldData.php deleted file mode 100644 index 12e3496..0000000 --- a/src/Models/Components/CheckoutUpdatePublicCustomFieldData.php +++ /dev/null @@ -1,18 +0,0 @@ -func = $func; + } +} \ No newline at end of file diff --git a/src/Models/Components/CurrencyAmount.php b/src/Models/Components/CurrencyAmount.php index 68225ff..293c901 100644 --- a/src/Models/Components/CurrencyAmount.php +++ b/src/Models/Components/CurrencyAmount.php @@ -30,6 +30,7 @@ class CurrencyAmount /** * @param string $currency * @param int $amount + * @phpstan-pure */ public function __construct(string $currency, int $amount) { diff --git a/src/Models/Components/CustomFieldCheckbox.php b/src/Models/Components/CustomFieldCheckbox.php index 94fbe0a..a3adf9f 100644 --- a/src/Models/Components/CustomFieldCheckbox.php +++ b/src/Models/Components/CustomFieldCheckbox.php @@ -31,10 +31,10 @@ class CustomFieldCheckbox /** * $metadata * - * @var array $metadata + * @var array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $metadata; /** @@ -79,24 +79,24 @@ class CustomFieldCheckbox /** * - * @var CustomFieldCheckboxType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomFieldCheckboxType')] - public CustomFieldCheckboxType $type; + public string $type; /** * @param \DateTime $createdAt * @param string $id - * @param array $metadata - * @param CustomFieldCheckboxType $type + * @param array $metadata + * @param string $type * @param string $slug * @param string $name * @param string $organizationId * @param CustomFieldCheckboxProperties $properties * @param ?\DateTime $modifiedAt + * @phpstan-pure */ - public function __construct(\DateTime $createdAt, string $id, array $metadata, string $slug, string $name, string $organizationId, CustomFieldCheckboxProperties $properties, ?\DateTime $modifiedAt = null, CustomFieldCheckboxType $type = CustomFieldCheckboxType::Checkbox) + public function __construct(\DateTime $createdAt, string $id, array $metadata, string $slug, string $name, string $organizationId, CustomFieldCheckboxProperties $properties, ?\DateTime $modifiedAt = null, string $type = 'checkbox') { $this->createdAt = $createdAt; $this->id = $id; diff --git a/src/Models/Components/CustomFieldCheckboxProperties.php b/src/Models/Components/CustomFieldCheckboxProperties.php index 489fae9..c35e2c9 100644 --- a/src/Models/Components/CustomFieldCheckboxProperties.php +++ b/src/Models/Components/CustomFieldCheckboxProperties.php @@ -39,6 +39,7 @@ class CustomFieldCheckboxProperties * @param ?string $formLabel * @param ?string $formHelpText * @param ?string $formPlaceholder + * @phpstan-pure */ public function __construct(?string $formLabel = null, ?string $formHelpText = null, ?string $formPlaceholder = null) { diff --git a/src/Models/Components/CustomFieldCheckboxType.php b/src/Models/Components/CustomFieldCheckboxType.php deleted file mode 100644 index 11e461e..0000000 --- a/src/Models/Components/CustomFieldCheckboxType.php +++ /dev/null @@ -1,15 +0,0 @@ - $metadata + * @var ?array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $metadata = null; @@ -67,21 +67,21 @@ class CustomFieldCreateCheckbox /** * - * @var CustomFieldCreateCheckboxType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomFieldCreateCheckboxType')] - public CustomFieldCreateCheckboxType $type; + public string $type; /** - * @param CustomFieldCreateCheckboxType $type + * @param string $type * @param string $slug * @param string $name * @param CustomFieldCheckboxProperties $properties - * @param ?array $metadata + * @param ?array $metadata * @param ?string $organizationId + * @phpstan-pure */ - public function __construct(string $slug, string $name, CustomFieldCheckboxProperties $properties, ?array $metadata = null, ?string $organizationId = null, CustomFieldCreateCheckboxType $type = CustomFieldCreateCheckboxType::Checkbox) + public function __construct(string $slug, string $name, CustomFieldCheckboxProperties $properties, ?array $metadata = null, ?string $organizationId = null, string $type = 'checkbox') { $this->slug = $slug; $this->name = $name; diff --git a/src/Models/Components/CustomFieldCreateCheckboxType.php b/src/Models/Components/CustomFieldCreateCheckboxType.php deleted file mode 100644 index 3360e57..0000000 --- a/src/Models/Components/CustomFieldCreateCheckboxType.php +++ /dev/null @@ -1,15 +0,0 @@ - $metadata + * @var ?array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $metadata = null; @@ -67,21 +67,21 @@ class CustomFieldCreateDate /** * - * @var CustomFieldCreateDateType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomFieldCreateDateType')] - public CustomFieldCreateDateType $type; + public string $type; /** - * @param CustomFieldCreateDateType $type + * @param string $type * @param string $slug * @param string $name * @param CustomFieldDateProperties $properties - * @param ?array $metadata + * @param ?array $metadata * @param ?string $organizationId + * @phpstan-pure */ - public function __construct(string $slug, string $name, CustomFieldDateProperties $properties, ?array $metadata = null, ?string $organizationId = null, CustomFieldCreateDateType $type = CustomFieldCreateDateType::Date) + public function __construct(string $slug, string $name, CustomFieldDateProperties $properties, ?array $metadata = null, ?string $organizationId = null, string $type = 'date') { $this->slug = $slug; $this->name = $name; diff --git a/src/Models/Components/CustomFieldCreateDateType.php b/src/Models/Components/CustomFieldCreateDateType.php deleted file mode 100644 index 582b3a8..0000000 --- a/src/Models/Components/CustomFieldCreateDateType.php +++ /dev/null @@ -1,15 +0,0 @@ - $metadata + * @var ?array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $metadata = null; @@ -67,21 +67,21 @@ class CustomFieldCreateNumber /** * - * @var CustomFieldCreateNumberType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomFieldCreateNumberType')] - public CustomFieldCreateNumberType $type; + public string $type; /** - * @param CustomFieldCreateNumberType $type + * @param string $type * @param string $slug * @param string $name * @param CustomFieldNumberProperties $properties - * @param ?array $metadata + * @param ?array $metadata * @param ?string $organizationId + * @phpstan-pure */ - public function __construct(string $slug, string $name, CustomFieldNumberProperties $properties, ?array $metadata = null, ?string $organizationId = null, CustomFieldCreateNumberType $type = CustomFieldCreateNumberType::Number) + public function __construct(string $slug, string $name, CustomFieldNumberProperties $properties, ?array $metadata = null, ?string $organizationId = null, string $type = 'number') { $this->slug = $slug; $this->name = $name; diff --git a/src/Models/Components/CustomFieldCreateNumberType.php b/src/Models/Components/CustomFieldCreateNumberType.php deleted file mode 100644 index 596b65c..0000000 --- a/src/Models/Components/CustomFieldCreateNumberType.php +++ /dev/null @@ -1,15 +0,0 @@ - $metadata + * @var ?array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $metadata = null; @@ -67,21 +67,21 @@ class CustomFieldCreateSelect /** * - * @var CustomFieldCreateSelectType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomFieldCreateSelectType')] - public CustomFieldCreateSelectType $type; + public string $type; /** - * @param CustomFieldCreateSelectType $type + * @param string $type * @param string $slug * @param string $name * @param CustomFieldSelectProperties $properties - * @param ?array $metadata + * @param ?array $metadata * @param ?string $organizationId + * @phpstan-pure */ - public function __construct(string $slug, string $name, CustomFieldSelectProperties $properties, ?array $metadata = null, ?string $organizationId = null, CustomFieldCreateSelectType $type = CustomFieldCreateSelectType::Select) + public function __construct(string $slug, string $name, CustomFieldSelectProperties $properties, ?array $metadata = null, ?string $organizationId = null, string $type = 'select') { $this->slug = $slug; $this->name = $name; diff --git a/src/Models/Components/CustomFieldCreateSelectType.php b/src/Models/Components/CustomFieldCreateSelectType.php deleted file mode 100644 index 6aaee10..0000000 --- a/src/Models/Components/CustomFieldCreateSelectType.php +++ /dev/null @@ -1,15 +0,0 @@ - $metadata + * @var ?array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $metadata = null; @@ -67,21 +67,21 @@ class CustomFieldCreateText /** * - * @var CustomFieldCreateTextType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomFieldCreateTextType')] - public CustomFieldCreateTextType $type; + public string $type; /** - * @param CustomFieldCreateTextType $type + * @param string $type * @param string $slug * @param string $name * @param CustomFieldTextProperties $properties - * @param ?array $metadata + * @param ?array $metadata * @param ?string $organizationId + * @phpstan-pure */ - public function __construct(string $slug, string $name, CustomFieldTextProperties $properties, ?array $metadata = null, ?string $organizationId = null, CustomFieldCreateTextType $type = CustomFieldCreateTextType::Text) + public function __construct(string $slug, string $name, CustomFieldTextProperties $properties, ?array $metadata = null, ?string $organizationId = null, string $type = 'text') { $this->slug = $slug; $this->name = $name; diff --git a/src/Models/Components/CustomFieldCreateTextType.php b/src/Models/Components/CustomFieldCreateTextType.php deleted file mode 100644 index b985c6f..0000000 --- a/src/Models/Components/CustomFieldCreateTextType.php +++ /dev/null @@ -1,15 +0,0 @@ - $metadata + * @var array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $metadata; /** @@ -79,24 +79,24 @@ class CustomFieldDate /** * - * @var CustomFieldDateType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomFieldDateType')] - public CustomFieldDateType $type; + public string $type; /** * @param \DateTime $createdAt * @param string $id - * @param array $metadata - * @param CustomFieldDateType $type + * @param array $metadata + * @param string $type * @param string $slug * @param string $name * @param string $organizationId * @param CustomFieldDateProperties $properties * @param ?\DateTime $modifiedAt + * @phpstan-pure */ - public function __construct(\DateTime $createdAt, string $id, array $metadata, string $slug, string $name, string $organizationId, CustomFieldDateProperties $properties, ?\DateTime $modifiedAt = null, CustomFieldDateType $type = CustomFieldDateType::Date) + public function __construct(\DateTime $createdAt, string $id, array $metadata, string $slug, string $name, string $organizationId, CustomFieldDateProperties $properties, ?\DateTime $modifiedAt = null, string $type = 'date') { $this->createdAt = $createdAt; $this->id = $id; diff --git a/src/Models/Components/CustomFieldDateProperties.php b/src/Models/Components/CustomFieldDateProperties.php index c9651c2..5a48b18 100644 --- a/src/Models/Components/CustomFieldDateProperties.php +++ b/src/Models/Components/CustomFieldDateProperties.php @@ -57,6 +57,7 @@ class CustomFieldDateProperties * @param ?string $formPlaceholder * @param ?int $ge * @param ?int $le + * @phpstan-pure */ public function __construct(?string $formLabel = null, ?string $formHelpText = null, ?string $formPlaceholder = null, ?int $ge = null, ?int $le = null) { diff --git a/src/Models/Components/CustomFieldDateType.php b/src/Models/Components/CustomFieldDateType.php deleted file mode 100644 index ba52d07..0000000 --- a/src/Models/Components/CustomFieldDateType.php +++ /dev/null @@ -1,15 +0,0 @@ - $metadata + * @var array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $metadata; /** @@ -79,24 +79,24 @@ class CustomFieldNumber /** * - * @var CustomFieldNumberType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomFieldNumberType')] - public CustomFieldNumberType $type; + public string $type; /** * @param \DateTime $createdAt * @param string $id - * @param array $metadata - * @param CustomFieldNumberType $type + * @param array $metadata + * @param string $type * @param string $slug * @param string $name * @param string $organizationId * @param CustomFieldNumberProperties $properties * @param ?\DateTime $modifiedAt + * @phpstan-pure */ - public function __construct(\DateTime $createdAt, string $id, array $metadata, string $slug, string $name, string $organizationId, CustomFieldNumberProperties $properties, ?\DateTime $modifiedAt = null, CustomFieldNumberType $type = CustomFieldNumberType::Number) + public function __construct(\DateTime $createdAt, string $id, array $metadata, string $slug, string $name, string $organizationId, CustomFieldNumberProperties $properties, ?\DateTime $modifiedAt = null, string $type = 'number') { $this->createdAt = $createdAt; $this->id = $id; diff --git a/src/Models/Components/CustomFieldNumberProperties.php b/src/Models/Components/CustomFieldNumberProperties.php index d51d6e5..15e940e 100644 --- a/src/Models/Components/CustomFieldNumberProperties.php +++ b/src/Models/Components/CustomFieldNumberProperties.php @@ -57,6 +57,7 @@ class CustomFieldNumberProperties * @param ?string $formPlaceholder * @param ?int $ge * @param ?int $le + * @phpstan-pure */ public function __construct(?string $formLabel = null, ?string $formHelpText = null, ?string $formPlaceholder = null, ?int $ge = null, ?int $le = null) { diff --git a/src/Models/Components/CustomFieldNumberType.php b/src/Models/Components/CustomFieldNumberType.php deleted file mode 100644 index 7307080..0000000 --- a/src/Models/Components/CustomFieldNumberType.php +++ /dev/null @@ -1,15 +0,0 @@ - $metadata + * @var array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $metadata; /** @@ -79,24 +79,24 @@ class CustomFieldSelect /** * - * @var CustomFieldSelectType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomFieldSelectType')] - public CustomFieldSelectType $type; + public string $type; /** * @param \DateTime $createdAt * @param string $id - * @param array $metadata - * @param CustomFieldSelectType $type + * @param array $metadata + * @param string $type * @param string $slug * @param string $name * @param string $organizationId * @param CustomFieldSelectProperties $properties * @param ?\DateTime $modifiedAt + * @phpstan-pure */ - public function __construct(\DateTime $createdAt, string $id, array $metadata, string $slug, string $name, string $organizationId, CustomFieldSelectProperties $properties, ?\DateTime $modifiedAt = null, CustomFieldSelectType $type = CustomFieldSelectType::Select) + public function __construct(\DateTime $createdAt, string $id, array $metadata, string $slug, string $name, string $organizationId, CustomFieldSelectProperties $properties, ?\DateTime $modifiedAt = null, string $type = 'select') { $this->createdAt = $createdAt; $this->id = $id; diff --git a/src/Models/Components/CustomFieldSelectOption.php b/src/Models/Components/CustomFieldSelectOption.php index 827416a..3ab036e 100644 --- a/src/Models/Components/CustomFieldSelectOption.php +++ b/src/Models/Components/CustomFieldSelectOption.php @@ -28,6 +28,7 @@ class CustomFieldSelectOption /** * @param string $value * @param string $label + * @phpstan-pure */ public function __construct(string $value, string $label) { diff --git a/src/Models/Components/CustomFieldSelectProperties.php b/src/Models/Components/CustomFieldSelectProperties.php index a0c978f..d8249f4 100644 --- a/src/Models/Components/CustomFieldSelectProperties.php +++ b/src/Models/Components/CustomFieldSelectProperties.php @@ -49,6 +49,7 @@ class CustomFieldSelectProperties * @param ?string $formLabel * @param ?string $formHelpText * @param ?string $formPlaceholder + * @phpstan-pure */ public function __construct(array $options, ?string $formLabel = null, ?string $formHelpText = null, ?string $formPlaceholder = null) { diff --git a/src/Models/Components/CustomFieldSelectType.php b/src/Models/Components/CustomFieldSelectType.php deleted file mode 100644 index 7e82fc5..0000000 --- a/src/Models/Components/CustomFieldSelectType.php +++ /dev/null @@ -1,15 +0,0 @@ - $metadata + * @var array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $metadata; /** @@ -79,24 +79,24 @@ class CustomFieldText /** * - * @var CustomFieldTextType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomFieldTextType')] - public CustomFieldTextType $type; + public string $type; /** * @param \DateTime $createdAt * @param string $id - * @param array $metadata - * @param CustomFieldTextType $type + * @param array $metadata + * @param string $type * @param string $slug * @param string $name * @param string $organizationId * @param CustomFieldTextProperties $properties * @param ?\DateTime $modifiedAt + * @phpstan-pure */ - public function __construct(\DateTime $createdAt, string $id, array $metadata, string $slug, string $name, string $organizationId, CustomFieldTextProperties $properties, ?\DateTime $modifiedAt = null, CustomFieldTextType $type = CustomFieldTextType::Text) + public function __construct(\DateTime $createdAt, string $id, array $metadata, string $slug, string $name, string $organizationId, CustomFieldTextProperties $properties, ?\DateTime $modifiedAt = null, string $type = 'text') { $this->createdAt = $createdAt; $this->id = $id; diff --git a/src/Models/Components/CustomFieldTextProperties.php b/src/Models/Components/CustomFieldTextProperties.php index 15f0ad7..06bc77f 100644 --- a/src/Models/Components/CustomFieldTextProperties.php +++ b/src/Models/Components/CustomFieldTextProperties.php @@ -66,6 +66,7 @@ class CustomFieldTextProperties * @param ?bool $textarea * @param ?int $minLength * @param ?int $maxLength + * @phpstan-pure */ public function __construct(?string $formLabel = null, ?string $formHelpText = null, ?string $formPlaceholder = null, ?bool $textarea = null, ?int $minLength = null, ?int $maxLength = null) { diff --git a/src/Models/Components/CustomFieldTextType.php b/src/Models/Components/CustomFieldTextType.php deleted file mode 100644 index 8b67d96..0000000 --- a/src/Models/Components/CustomFieldTextType.php +++ /dev/null @@ -1,15 +0,0 @@ - $metadata + * @var ?array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $metadata = null; @@ -49,20 +49,20 @@ class CustomFieldUpdateCheckbox /** * - * @var CustomFieldUpdateCheckboxType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomFieldUpdateCheckboxType')] - public CustomFieldUpdateCheckboxType $type; + public string $type; /** - * @param CustomFieldUpdateCheckboxType $type - * @param ?array $metadata + * @param string $type + * @param ?array $metadata * @param ?string $name * @param ?string $slug * @param ?CustomFieldCheckboxProperties $properties + * @phpstan-pure */ - public function __construct(?array $metadata = null, ?string $name = null, ?string $slug = null, ?CustomFieldCheckboxProperties $properties = null, CustomFieldUpdateCheckboxType $type = CustomFieldUpdateCheckboxType::Checkbox) + public function __construct(?array $metadata = null, ?string $name = null, ?string $slug = null, ?CustomFieldCheckboxProperties $properties = null, string $type = 'checkbox') { $this->metadata = $metadata; $this->name = $name; diff --git a/src/Models/Components/CustomFieldUpdateCheckboxType.php b/src/Models/Components/CustomFieldUpdateCheckboxType.php deleted file mode 100644 index 935c289..0000000 --- a/src/Models/Components/CustomFieldUpdateCheckboxType.php +++ /dev/null @@ -1,15 +0,0 @@ - $metadata + * @var ?array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $metadata = null; @@ -49,20 +49,20 @@ class CustomFieldUpdateDate /** * - * @var CustomFieldUpdateDateType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomFieldUpdateDateType')] - public CustomFieldUpdateDateType $type; + public string $type; /** - * @param CustomFieldUpdateDateType $type - * @param ?array $metadata + * @param string $type + * @param ?array $metadata * @param ?string $name * @param ?string $slug * @param ?CustomFieldDateProperties $properties + * @phpstan-pure */ - public function __construct(?array $metadata = null, ?string $name = null, ?string $slug = null, ?CustomFieldDateProperties $properties = null, CustomFieldUpdateDateType $type = CustomFieldUpdateDateType::Date) + public function __construct(?array $metadata = null, ?string $name = null, ?string $slug = null, ?CustomFieldDateProperties $properties = null, string $type = 'date') { $this->metadata = $metadata; $this->name = $name; diff --git a/src/Models/Components/CustomFieldUpdateDateType.php b/src/Models/Components/CustomFieldUpdateDateType.php deleted file mode 100644 index 3deb859..0000000 --- a/src/Models/Components/CustomFieldUpdateDateType.php +++ /dev/null @@ -1,15 +0,0 @@ - $metadata + * @var ?array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $metadata = null; @@ -49,20 +49,20 @@ class CustomFieldUpdateNumber /** * - * @var CustomFieldUpdateNumberType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomFieldUpdateNumberType')] - public CustomFieldUpdateNumberType $type; + public string $type; /** - * @param CustomFieldUpdateNumberType $type - * @param ?array $metadata + * @param string $type + * @param ?array $metadata * @param ?string $name * @param ?string $slug * @param ?CustomFieldNumberProperties $properties + * @phpstan-pure */ - public function __construct(?array $metadata = null, ?string $name = null, ?string $slug = null, ?CustomFieldNumberProperties $properties = null, CustomFieldUpdateNumberType $type = CustomFieldUpdateNumberType::Number) + public function __construct(?array $metadata = null, ?string $name = null, ?string $slug = null, ?CustomFieldNumberProperties $properties = null, string $type = 'number') { $this->metadata = $metadata; $this->name = $name; diff --git a/src/Models/Components/CustomFieldUpdateNumberType.php b/src/Models/Components/CustomFieldUpdateNumberType.php deleted file mode 100644 index acbe16f..0000000 --- a/src/Models/Components/CustomFieldUpdateNumberType.php +++ /dev/null @@ -1,15 +0,0 @@ - $metadata + * @var ?array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $metadata = null; @@ -49,20 +49,20 @@ class CustomFieldUpdateSelect /** * - * @var CustomFieldUpdateSelectType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomFieldUpdateSelectType')] - public CustomFieldUpdateSelectType $type; + public string $type; /** - * @param CustomFieldUpdateSelectType $type - * @param ?array $metadata + * @param string $type + * @param ?array $metadata * @param ?string $name * @param ?string $slug * @param ?CustomFieldSelectProperties $properties + * @phpstan-pure */ - public function __construct(?array $metadata = null, ?string $name = null, ?string $slug = null, ?CustomFieldSelectProperties $properties = null, CustomFieldUpdateSelectType $type = CustomFieldUpdateSelectType::Select) + public function __construct(?array $metadata = null, ?string $name = null, ?string $slug = null, ?CustomFieldSelectProperties $properties = null, string $type = 'select') { $this->metadata = $metadata; $this->name = $name; diff --git a/src/Models/Components/CustomFieldUpdateSelectType.php b/src/Models/Components/CustomFieldUpdateSelectType.php deleted file mode 100644 index 36407ce..0000000 --- a/src/Models/Components/CustomFieldUpdateSelectType.php +++ /dev/null @@ -1,15 +0,0 @@ - $metadata + * @var ?array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $metadata = null; @@ -49,20 +49,20 @@ class CustomFieldUpdateText /** * - * @var CustomFieldUpdateTextType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomFieldUpdateTextType')] - public CustomFieldUpdateTextType $type; + public string $type; /** - * @param CustomFieldUpdateTextType $type - * @param ?array $metadata + * @param string $type + * @param ?array $metadata * @param ?string $name * @param ?string $slug * @param ?CustomFieldTextProperties $properties + * @phpstan-pure */ - public function __construct(?array $metadata = null, ?string $name = null, ?string $slug = null, ?CustomFieldTextProperties $properties = null, CustomFieldUpdateTextType $type = CustomFieldUpdateTextType::Text) + public function __construct(?array $metadata = null, ?string $name = null, ?string $slug = null, ?CustomFieldTextProperties $properties = null, string $type = 'text') { $this->metadata = $metadata; $this->name = $name; diff --git a/src/Models/Components/CustomFieldUpdateTextType.php b/src/Models/Components/CustomFieldUpdateTextType.php deleted file mode 100644 index 6e4921c..0000000 --- a/src/Models/Components/CustomFieldUpdateTextType.php +++ /dev/null @@ -1,15 +0,0 @@ - $metadata + * @var array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $metadata; /** @@ -91,16 +91,16 @@ class Customer /** * $taxId * - * @var ?array $taxId + * @var ?array $taxId */ #[\Speakeasy\Serializer\Annotation\SerializedName('tax_id')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] public ?array $taxId; /** * @param \DateTime $createdAt * @param string $id - * @param array $metadata + * @param array $metadata * @param string $email * @param bool $emailVerified * @param string $organizationId @@ -108,7 +108,8 @@ class Customer * @param ?\DateTime $modifiedAt * @param ?string $name * @param ?Address $billingAddress - * @param ?array $taxId + * @param ?array $taxId + * @phpstan-pure */ public function __construct(\DateTime $createdAt, string $id, array $metadata, string $email, bool $emailVerified, string $organizationId, string $avatarUrl, ?\DateTime $modifiedAt = null, ?string $name = null, ?Address $billingAddress = null, ?array $taxId = null) { diff --git a/src/Models/Components/CustomerBenefitGrantAds.php b/src/Models/Components/CustomerBenefitGrantAds.php index c6890f6..0bb4c25 100644 --- a/src/Models/Components/CustomerBenefitGrantAds.php +++ b/src/Models/Components/CustomerBenefitGrantAds.php @@ -55,6 +55,14 @@ class CustomerBenefitGrantAds #[\Speakeasy\Serializer\Annotation\SerializedName('is_revoked')] public bool $isRevoked; + /** + * + * @var CustomerPortalCustomer $customer + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('customer')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomerPortalCustomer')] + public CustomerPortalCustomer $customer; + /** * * @var BenefitAdsSubscriber $benefit @@ -114,6 +122,7 @@ class CustomerBenefitGrantAds * @param string $benefitId * @param bool $isGranted * @param bool $isRevoked + * @param CustomerPortalCustomer $customer * @param BenefitAdsSubscriber $benefit * @param BenefitGrantAdsProperties $properties * @param ?\DateTime $modifiedAt @@ -121,8 +130,9 @@ class CustomerBenefitGrantAds * @param ?\DateTime $revokedAt * @param ?string $subscriptionId * @param ?string $orderId + * @phpstan-pure */ - public function __construct(\DateTime $createdAt, string $id, string $customerId, string $benefitId, bool $isGranted, bool $isRevoked, BenefitAdsSubscriber $benefit, BenefitGrantAdsProperties $properties, ?\DateTime $modifiedAt = null, ?\DateTime $grantedAt = null, ?\DateTime $revokedAt = null, ?string $subscriptionId = null, ?string $orderId = null) + public function __construct(\DateTime $createdAt, string $id, string $customerId, string $benefitId, bool $isGranted, bool $isRevoked, CustomerPortalCustomer $customer, BenefitAdsSubscriber $benefit, BenefitGrantAdsProperties $properties, ?\DateTime $modifiedAt = null, ?\DateTime $grantedAt = null, ?\DateTime $revokedAt = null, ?string $subscriptionId = null, ?string $orderId = null) { $this->createdAt = $createdAt; $this->id = $id; @@ -130,6 +140,7 @@ public function __construct(\DateTime $createdAt, string $id, string $customerId $this->benefitId = $benefitId; $this->isGranted = $isGranted; $this->isRevoked = $isRevoked; + $this->customer = $customer; $this->benefit = $benefit; $this->properties = $properties; $this->modifiedAt = $modifiedAt; diff --git a/src/Models/Components/CustomerBenefitGrantAdsUpdate.php b/src/Models/Components/CustomerBenefitGrantAdsUpdate.php index 955056b..3ae5df5 100644 --- a/src/Models/Components/CustomerBenefitGrantAdsUpdate.php +++ b/src/Models/Components/CustomerBenefitGrantAdsUpdate.php @@ -13,16 +13,16 @@ class CustomerBenefitGrantAdsUpdate { /** * - * @var CustomerBenefitGrantAdsUpdateBenefitType $benefitType + * @var string $benefitType */ #[\Speakeasy\Serializer\Annotation\SerializedName('benefit_type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomerBenefitGrantAdsUpdateBenefitType')] - public CustomerBenefitGrantAdsUpdateBenefitType $benefitType; + public string $benefitType; /** - * @param CustomerBenefitGrantAdsUpdateBenefitType $benefitType + * @param string $benefitType + * @phpstan-pure */ - public function __construct(CustomerBenefitGrantAdsUpdateBenefitType $benefitType = CustomerBenefitGrantAdsUpdateBenefitType::Ads) + public function __construct(string $benefitType = 'ads') { $this->benefitType = $benefitType; } diff --git a/src/Models/Components/CustomerBenefitGrantAdsUpdateBenefitType.php b/src/Models/Components/CustomerBenefitGrantAdsUpdateBenefitType.php deleted file mode 100644 index c769daf..0000000 --- a/src/Models/Components/CustomerBenefitGrantAdsUpdateBenefitType.php +++ /dev/null @@ -1,15 +0,0 @@ -createdAt = $createdAt; $this->id = $id; @@ -130,6 +140,7 @@ public function __construct(\DateTime $createdAt, string $id, string $customerId $this->benefitId = $benefitId; $this->isGranted = $isGranted; $this->isRevoked = $isRevoked; + $this->customer = $customer; $this->benefit = $benefit; $this->properties = $properties; $this->modifiedAt = $modifiedAt; diff --git a/src/Models/Components/CustomerBenefitGrantCustomUpdate.php b/src/Models/Components/CustomerBenefitGrantCustomUpdate.php index 16ab6e9..ba6ce99 100644 --- a/src/Models/Components/CustomerBenefitGrantCustomUpdate.php +++ b/src/Models/Components/CustomerBenefitGrantCustomUpdate.php @@ -13,16 +13,16 @@ class CustomerBenefitGrantCustomUpdate { /** * - * @var CustomerBenefitGrantCustomUpdateBenefitType $benefitType + * @var string $benefitType */ #[\Speakeasy\Serializer\Annotation\SerializedName('benefit_type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomerBenefitGrantCustomUpdateBenefitType')] - public CustomerBenefitGrantCustomUpdateBenefitType $benefitType; + public string $benefitType; /** - * @param CustomerBenefitGrantCustomUpdateBenefitType $benefitType + * @param string $benefitType + * @phpstan-pure */ - public function __construct(CustomerBenefitGrantCustomUpdateBenefitType $benefitType = CustomerBenefitGrantCustomUpdateBenefitType::Custom) + public function __construct(string $benefitType = 'custom') { $this->benefitType = $benefitType; } diff --git a/src/Models/Components/CustomerBenefitGrantCustomUpdateBenefitType.php b/src/Models/Components/CustomerBenefitGrantCustomUpdateBenefitType.php deleted file mode 100644 index 6f600a6..0000000 --- a/src/Models/Components/CustomerBenefitGrantCustomUpdateBenefitType.php +++ /dev/null @@ -1,15 +0,0 @@ -createdAt = $createdAt; $this->id = $id; @@ -130,6 +140,7 @@ public function __construct(\DateTime $createdAt, string $id, string $customerId $this->benefitId = $benefitId; $this->isGranted = $isGranted; $this->isRevoked = $isRevoked; + $this->customer = $customer; $this->benefit = $benefit; $this->properties = $properties; $this->modifiedAt = $modifiedAt; diff --git a/src/Models/Components/CustomerBenefitGrantDiscordPropertiesUpdate.php b/src/Models/Components/CustomerBenefitGrantDiscordPropertiesUpdate.php index 85cc9da..11ec612 100644 --- a/src/Models/Components/CustomerBenefitGrantDiscordPropertiesUpdate.php +++ b/src/Models/Components/CustomerBenefitGrantDiscordPropertiesUpdate.php @@ -20,6 +20,7 @@ class CustomerBenefitGrantDiscordPropertiesUpdate /** * @param string $accountId + * @phpstan-pure */ public function __construct(string $accountId) { diff --git a/src/Models/Components/CustomerBenefitGrantDiscordUpdate.php b/src/Models/Components/CustomerBenefitGrantDiscordUpdate.php index 305c1be..6de4153 100644 --- a/src/Models/Components/CustomerBenefitGrantDiscordUpdate.php +++ b/src/Models/Components/CustomerBenefitGrantDiscordUpdate.php @@ -21,17 +21,17 @@ class CustomerBenefitGrantDiscordUpdate /** * - * @var CustomerBenefitGrantDiscordUpdateBenefitType $benefitType + * @var string $benefitType */ #[\Speakeasy\Serializer\Annotation\SerializedName('benefit_type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomerBenefitGrantDiscordUpdateBenefitType')] - public CustomerBenefitGrantDiscordUpdateBenefitType $benefitType; + public string $benefitType; /** - * @param CustomerBenefitGrantDiscordUpdateBenefitType $benefitType + * @param string $benefitType * @param CustomerBenefitGrantDiscordPropertiesUpdate $properties + * @phpstan-pure */ - public function __construct(CustomerBenefitGrantDiscordPropertiesUpdate $properties, CustomerBenefitGrantDiscordUpdateBenefitType $benefitType = CustomerBenefitGrantDiscordUpdateBenefitType::Discord) + public function __construct(CustomerBenefitGrantDiscordPropertiesUpdate $properties, string $benefitType = 'discord') { $this->properties = $properties; $this->benefitType = $benefitType; diff --git a/src/Models/Components/CustomerBenefitGrantDiscordUpdateBenefitType.php b/src/Models/Components/CustomerBenefitGrantDiscordUpdateBenefitType.php deleted file mode 100644 index f4f6fd6..0000000 --- a/src/Models/Components/CustomerBenefitGrantDiscordUpdateBenefitType.php +++ /dev/null @@ -1,15 +0,0 @@ -createdAt = $createdAt; $this->id = $id; @@ -130,6 +140,7 @@ public function __construct(\DateTime $createdAt, string $id, string $customerId $this->benefitId = $benefitId; $this->isGranted = $isGranted; $this->isRevoked = $isRevoked; + $this->customer = $customer; $this->benefit = $benefit; $this->properties = $properties; $this->modifiedAt = $modifiedAt; diff --git a/src/Models/Components/CustomerBenefitGrantDownloadablesUpdate.php b/src/Models/Components/CustomerBenefitGrantDownloadablesUpdate.php index d604adc..9290816 100644 --- a/src/Models/Components/CustomerBenefitGrantDownloadablesUpdate.php +++ b/src/Models/Components/CustomerBenefitGrantDownloadablesUpdate.php @@ -13,16 +13,16 @@ class CustomerBenefitGrantDownloadablesUpdate { /** * - * @var CustomerBenefitGrantDownloadablesUpdateBenefitType $benefitType + * @var string $benefitType */ #[\Speakeasy\Serializer\Annotation\SerializedName('benefit_type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomerBenefitGrantDownloadablesUpdateBenefitType')] - public CustomerBenefitGrantDownloadablesUpdateBenefitType $benefitType; + public string $benefitType; /** - * @param CustomerBenefitGrantDownloadablesUpdateBenefitType $benefitType + * @param string $benefitType + * @phpstan-pure */ - public function __construct(CustomerBenefitGrantDownloadablesUpdateBenefitType $benefitType = CustomerBenefitGrantDownloadablesUpdateBenefitType::Downloadables) + public function __construct(string $benefitType = 'downloadables') { $this->benefitType = $benefitType; } diff --git a/src/Models/Components/CustomerBenefitGrantDownloadablesUpdateBenefitType.php b/src/Models/Components/CustomerBenefitGrantDownloadablesUpdateBenefitType.php deleted file mode 100644 index fcada66..0000000 --- a/src/Models/Components/CustomerBenefitGrantDownloadablesUpdateBenefitType.php +++ /dev/null @@ -1,15 +0,0 @@ -createdAt = $createdAt; $this->id = $id; @@ -130,6 +140,7 @@ public function __construct(\DateTime $createdAt, string $id, string $customerId $this->benefitId = $benefitId; $this->isGranted = $isGranted; $this->isRevoked = $isRevoked; + $this->customer = $customer; $this->benefit = $benefit; $this->properties = $properties; $this->modifiedAt = $modifiedAt; diff --git a/src/Models/Components/CustomerBenefitGrantGitHubRepositoryPropertiesUpdate.php b/src/Models/Components/CustomerBenefitGrantGitHubRepositoryPropertiesUpdate.php index 2e6aad3..5340de1 100644 --- a/src/Models/Components/CustomerBenefitGrantGitHubRepositoryPropertiesUpdate.php +++ b/src/Models/Components/CustomerBenefitGrantGitHubRepositoryPropertiesUpdate.php @@ -20,6 +20,7 @@ class CustomerBenefitGrantGitHubRepositoryPropertiesUpdate /** * @param string $accountId + * @phpstan-pure */ public function __construct(string $accountId) { diff --git a/src/Models/Components/CustomerBenefitGrantGitHubRepositoryUpdate.php b/src/Models/Components/CustomerBenefitGrantGitHubRepositoryUpdate.php index 9600403..0a2357e 100644 --- a/src/Models/Components/CustomerBenefitGrantGitHubRepositoryUpdate.php +++ b/src/Models/Components/CustomerBenefitGrantGitHubRepositoryUpdate.php @@ -21,17 +21,17 @@ class CustomerBenefitGrantGitHubRepositoryUpdate /** * - * @var CustomerBenefitGrantGitHubRepositoryUpdateBenefitType $benefitType + * @var string $benefitType */ #[\Speakeasy\Serializer\Annotation\SerializedName('benefit_type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomerBenefitGrantGitHubRepositoryUpdateBenefitType')] - public CustomerBenefitGrantGitHubRepositoryUpdateBenefitType $benefitType; + public string $benefitType; /** - * @param CustomerBenefitGrantGitHubRepositoryUpdateBenefitType $benefitType + * @param string $benefitType * @param CustomerBenefitGrantGitHubRepositoryPropertiesUpdate $properties + * @phpstan-pure */ - public function __construct(CustomerBenefitGrantGitHubRepositoryPropertiesUpdate $properties, CustomerBenefitGrantGitHubRepositoryUpdateBenefitType $benefitType = CustomerBenefitGrantGitHubRepositoryUpdateBenefitType::GithubRepository) + public function __construct(CustomerBenefitGrantGitHubRepositoryPropertiesUpdate $properties, string $benefitType = 'github_repository') { $this->properties = $properties; $this->benefitType = $benefitType; diff --git a/src/Models/Components/CustomerBenefitGrantGitHubRepositoryUpdateBenefitType.php b/src/Models/Components/CustomerBenefitGrantGitHubRepositoryUpdateBenefitType.php deleted file mode 100644 index 1543145..0000000 --- a/src/Models/Components/CustomerBenefitGrantGitHubRepositoryUpdateBenefitType.php +++ /dev/null @@ -1,15 +0,0 @@ -createdAt = $createdAt; $this->id = $id; @@ -130,6 +140,7 @@ public function __construct(\DateTime $createdAt, string $id, string $customerId $this->benefitId = $benefitId; $this->isGranted = $isGranted; $this->isRevoked = $isRevoked; + $this->customer = $customer; $this->benefit = $benefit; $this->properties = $properties; $this->modifiedAt = $modifiedAt; diff --git a/src/Models/Components/CustomerBenefitGrantLicenseKeysUpdate.php b/src/Models/Components/CustomerBenefitGrantLicenseKeysUpdate.php index 2a9f058..d715b9b 100644 --- a/src/Models/Components/CustomerBenefitGrantLicenseKeysUpdate.php +++ b/src/Models/Components/CustomerBenefitGrantLicenseKeysUpdate.php @@ -13,16 +13,16 @@ class CustomerBenefitGrantLicenseKeysUpdate { /** * - * @var CustomerBenefitGrantLicenseKeysUpdateBenefitType $benefitType + * @var string $benefitType */ #[\Speakeasy\Serializer\Annotation\SerializedName('benefit_type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomerBenefitGrantLicenseKeysUpdateBenefitType')] - public CustomerBenefitGrantLicenseKeysUpdateBenefitType $benefitType; + public string $benefitType; /** - * @param CustomerBenefitGrantLicenseKeysUpdateBenefitType $benefitType + * @param string $benefitType + * @phpstan-pure */ - public function __construct(CustomerBenefitGrantLicenseKeysUpdateBenefitType $benefitType = CustomerBenefitGrantLicenseKeysUpdateBenefitType::LicenseKeys) + public function __construct(string $benefitType = 'license_keys') { $this->benefitType = $benefitType; } diff --git a/src/Models/Components/CustomerBenefitGrantLicenseKeysUpdateBenefitType.php b/src/Models/Components/CustomerBenefitGrantLicenseKeysUpdateBenefitType.php deleted file mode 100644 index df31e15..0000000 --- a/src/Models/Components/CustomerBenefitGrantLicenseKeysUpdateBenefitType.php +++ /dev/null @@ -1,15 +0,0 @@ - $metadata + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?array $metadata = null; + /** * * @var ?string $name @@ -38,10 +58,10 @@ class CustomerCreate /** * $taxId * - * @var ?array $taxId + * @var ?array $taxId */ #[\Speakeasy\Serializer\Annotation\SerializedName('tax_id')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $taxId = null; @@ -56,14 +76,17 @@ class CustomerCreate /** * @param string $email + * @param ?array $metadata * @param ?string $name * @param ?Address $billingAddress - * @param ?array $taxId + * @param ?array $taxId * @param ?string $organizationId + * @phpstan-pure */ - public function __construct(string $email, ?string $name = null, ?Address $billingAddress = null, ?array $taxId = null, ?string $organizationId = null) + public function __construct(string $email, ?array $metadata = null, ?string $name = null, ?Address $billingAddress = null, ?array $taxId = null, ?string $organizationId = null) { $this->email = $email; + $this->metadata = $metadata; $this->name = $name; $this->billingAddress = $billingAddress; $this->taxId = $taxId; diff --git a/src/Models/Components/CustomerOrder.php b/src/Models/Components/CustomerOrder.php index 5c73b77..ff65276 100644 --- a/src/Models/Components/CustomerOrder.php +++ b/src/Models/Components/CustomerOrder.php @@ -130,6 +130,7 @@ class CustomerOrder * @param ?\DateTime $modifiedAt * @param ?string $subscriptionId * @param ?CustomerOrderSubscription $subscription + * @phpstan-pure */ public function __construct(\DateTime $createdAt, string $id, int $amount, int $taxAmount, string $currency, string $customerId, string $productId, string $productPriceId, string $userId, CustomerOrderProduct $product, ProductPriceRecurringFixed|ProductPriceRecurringCustom|ProductPriceRecurringFree|ProductPriceOneTimeFixed|ProductPriceOneTimeCustom|ProductPriceOneTimeFree $productPrice, ?\DateTime $modifiedAt = null, ?string $subscriptionId = null, ?CustomerOrderSubscription $subscription = null) { diff --git a/src/Models/Components/CustomerOrderInvoice.php b/src/Models/Components/CustomerOrderInvoice.php index c969d53..52b6b0f 100644 --- a/src/Models/Components/CustomerOrderInvoice.php +++ b/src/Models/Components/CustomerOrderInvoice.php @@ -22,6 +22,7 @@ class CustomerOrderInvoice /** * @param string $url + * @phpstan-pure */ public function __construct(string $url) { diff --git a/src/Models/Components/CustomerOrderProduct.php b/src/Models/Components/CustomerOrderProduct.php index e0bcd4d..e793357 100644 --- a/src/Models/Components/CustomerOrderProduct.php +++ b/src/Models/Components/CustomerOrderProduct.php @@ -62,10 +62,10 @@ class CustomerOrderProduct /** * List of prices for this product. * - * @var array $prices + * @var array $prices */ #[\Speakeasy\Serializer\Annotation\SerializedName('prices')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Polar\Models\Components\ProductPriceRecurringFixed|\Polar\Models\Components\ProductPriceRecurringCustom|\Polar\Models\Components\ProductPriceRecurringFree|\Polar\Models\Components\ProductPriceOneTimeFixed|\Polar\Models\Components\ProductPriceOneTimeCustom|\Polar\Models\Components\ProductPriceOneTimeFree>')] public array $prices; /** @@ -117,12 +117,13 @@ class CustomerOrderProduct * @param bool $isRecurring * @param bool $isArchived * @param string $organizationId - * @param array $prices + * @param array $prices * @param array $benefits * @param array $medias * @param Organization $organization * @param ?\DateTime $modifiedAt * @param ?string $description + * @phpstan-pure */ public function __construct(\DateTime $createdAt, string $id, string $name, bool $isRecurring, bool $isArchived, string $organizationId, array $prices, array $benefits, array $medias, Organization $organization, ?\DateTime $modifiedAt = null, ?string $description = null) { diff --git a/src/Models/Components/CustomerOrderSubscription.php b/src/Models/Components/CustomerOrderSubscription.php index 0d5eb37..7d7e1b8 100644 --- a/src/Models/Components/CustomerOrderSubscription.php +++ b/src/Models/Components/CustomerOrderSubscription.php @@ -107,6 +107,13 @@ class CustomerOrderSubscription #[\Speakeasy\Serializer\Annotation\SerializedName('current_period_end')] public ?\DateTime $currentPeriodEnd; + /** + * + * @var ?\DateTime $canceledAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('canceled_at')] + public ?\DateTime $canceledAt; + /** * * @var ?\DateTime $startedAt @@ -114,6 +121,13 @@ class CustomerOrderSubscription #[\Speakeasy\Serializer\Annotation\SerializedName('started_at')] public ?\DateTime $startedAt; + /** + * + * @var ?\DateTime $endsAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('ends_at')] + public ?\DateTime $endsAt; + /** * * @var ?\DateTime $endedAt @@ -135,6 +149,21 @@ class CustomerOrderSubscription #[\Speakeasy\Serializer\Annotation\SerializedName('checkout_id')] public ?string $checkoutId; + /** + * + * @var ?CustomerCancellationReason $customerCancellationReason + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('customer_cancellation_reason')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomerCancellationReason|null')] + public ?CustomerCancellationReason $customerCancellationReason; + + /** + * + * @var ?string $customerCancellationComment + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('customer_cancellation_comment')] + public ?string $customerCancellationComment; + /** * @param \DateTime $createdAt * @param string $id @@ -149,12 +178,17 @@ class CustomerOrderSubscription * @param ?int $amount * @param ?string $currency * @param ?\DateTime $currentPeriodEnd + * @param ?\DateTime $canceledAt * @param ?\DateTime $startedAt + * @param ?\DateTime $endsAt * @param ?\DateTime $endedAt * @param ?string $discountId * @param ?string $checkoutId + * @param ?CustomerCancellationReason $customerCancellationReason + * @param ?string $customerCancellationComment + * @phpstan-pure */ - public function __construct(\DateTime $createdAt, string $id, SubscriptionRecurringInterval $recurringInterval, SubscriptionStatus $status, \DateTime $currentPeriodStart, bool $cancelAtPeriodEnd, string $customerId, string $productId, string $priceId, ?\DateTime $modifiedAt = null, ?int $amount = null, ?string $currency = null, ?\DateTime $currentPeriodEnd = null, ?\DateTime $startedAt = null, ?\DateTime $endedAt = null, ?string $discountId = null, ?string $checkoutId = null) + public function __construct(\DateTime $createdAt, string $id, SubscriptionRecurringInterval $recurringInterval, SubscriptionStatus $status, \DateTime $currentPeriodStart, bool $cancelAtPeriodEnd, string $customerId, string $productId, string $priceId, ?\DateTime $modifiedAt = null, ?int $amount = null, ?string $currency = null, ?\DateTime $currentPeriodEnd = null, ?\DateTime $canceledAt = null, ?\DateTime $startedAt = null, ?\DateTime $endsAt = null, ?\DateTime $endedAt = null, ?string $discountId = null, ?string $checkoutId = null, ?CustomerCancellationReason $customerCancellationReason = null, ?string $customerCancellationComment = null) { $this->createdAt = $createdAt; $this->id = $id; @@ -169,9 +203,13 @@ public function __construct(\DateTime $createdAt, string $id, SubscriptionRecurr $this->amount = $amount; $this->currency = $currency; $this->currentPeriodEnd = $currentPeriodEnd; + $this->canceledAt = $canceledAt; $this->startedAt = $startedAt; + $this->endsAt = $endsAt; $this->endedAt = $endedAt; $this->discountId = $discountId; $this->checkoutId = $checkoutId; + $this->customerCancellationReason = $customerCancellationReason; + $this->customerCancellationComment = $customerCancellationComment; } } \ No newline at end of file diff --git a/src/Models/Components/CustomerPortalCustomer.php b/src/Models/Components/CustomerPortalCustomer.php index 86fb43b..fffc3b1 100644 --- a/src/Models/Components/CustomerPortalCustomer.php +++ b/src/Models/Components/CustomerPortalCustomer.php @@ -76,10 +76,10 @@ class CustomerPortalCustomer /** * $taxId * - * @var ?array $taxId + * @var ?array $taxId */ #[\Speakeasy\Serializer\Annotation\SerializedName('tax_id')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] public ?array $taxId; /** @@ -91,7 +91,8 @@ class CustomerPortalCustomer * @param ?\DateTime $modifiedAt * @param ?string $name * @param ?Address $billingAddress - * @param ?array $taxId + * @param ?array $taxId + * @phpstan-pure */ public function __construct(\DateTime $createdAt, string $id, string $email, bool $emailVerified, array $oauthAccounts, ?\DateTime $modifiedAt = null, ?string $name = null, ?Address $billingAddress = null, ?array $taxId = null) { diff --git a/src/Models/Components/CustomerPortalOAuthAccount.php b/src/Models/Components/CustomerPortalOAuthAccount.php index d5ebc2b..add018d 100644 --- a/src/Models/Components/CustomerPortalOAuthAccount.php +++ b/src/Models/Components/CustomerPortalOAuthAccount.php @@ -28,6 +28,7 @@ class CustomerPortalOAuthAccount /** * @param string $accountId * @param ?string $accountUsername + * @phpstan-pure */ public function __construct(string $accountId, ?string $accountUsername = null) { diff --git a/src/Models/Components/CustomerSession.php b/src/Models/Components/CustomerSession.php index 38e368f..04a4fd4 100644 --- a/src/Models/Components/CustomerSession.php +++ b/src/Models/Components/CustomerSession.php @@ -42,6 +42,13 @@ class CustomerSession #[\Speakeasy\Serializer\Annotation\SerializedName('expires_at')] public \DateTime $expiresAt; + /** + * + * @var string $customerPortalUrl + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('customer_portal_url')] + public string $customerPortalUrl; + /** * * @var string $customerId @@ -71,16 +78,19 @@ class CustomerSession * @param string $id * @param string $token * @param \DateTime $expiresAt + * @param string $customerPortalUrl * @param string $customerId * @param Customer $customer * @param ?\DateTime $modifiedAt + * @phpstan-pure */ - public function __construct(\DateTime $createdAt, string $id, string $token, \DateTime $expiresAt, string $customerId, Customer $customer, ?\DateTime $modifiedAt = null) + public function __construct(\DateTime $createdAt, string $id, string $token, \DateTime $expiresAt, string $customerPortalUrl, string $customerId, Customer $customer, ?\DateTime $modifiedAt = null) { $this->createdAt = $createdAt; $this->id = $id; $this->token = $token; $this->expiresAt = $expiresAt; + $this->customerPortalUrl = $customerPortalUrl; $this->customerId = $customerId; $this->customer = $customer; $this->modifiedAt = $modifiedAt; diff --git a/src/Models/Components/CustomerSessionCreate.php b/src/Models/Components/CustomerSessionCreate.php index 70ce1c1..3c8883d 100644 --- a/src/Models/Components/CustomerSessionCreate.php +++ b/src/Models/Components/CustomerSessionCreate.php @@ -22,6 +22,7 @@ class CustomerSessionCreate /** * @param string $customerId + * @phpstan-pure */ public function __construct(string $customerId) { diff --git a/src/Models/Components/CustomerSubscription.php b/src/Models/Components/CustomerSubscription.php index 07097e3..04b8b4c 100644 --- a/src/Models/Components/CustomerSubscription.php +++ b/src/Models/Components/CustomerSubscription.php @@ -131,6 +131,13 @@ class CustomerSubscription #[\Speakeasy\Serializer\Annotation\SerializedName('current_period_end')] public ?\DateTime $currentPeriodEnd; + /** + * + * @var ?\DateTime $canceledAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('canceled_at')] + public ?\DateTime $canceledAt; + /** * * @var ?\DateTime $startedAt @@ -138,6 +145,13 @@ class CustomerSubscription #[\Speakeasy\Serializer\Annotation\SerializedName('started_at')] public ?\DateTime $startedAt; + /** + * + * @var ?\DateTime $endsAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('ends_at')] + public ?\DateTime $endsAt; + /** * * @var ?\DateTime $endedAt @@ -159,6 +173,21 @@ class CustomerSubscription #[\Speakeasy\Serializer\Annotation\SerializedName('checkout_id')] public ?string $checkoutId; + /** + * + * @var ?CustomerCancellationReason $customerCancellationReason + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('customer_cancellation_reason')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomerCancellationReason|null')] + public ?CustomerCancellationReason $customerCancellationReason; + + /** + * + * @var ?string $customerCancellationComment + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('customer_cancellation_comment')] + public ?string $customerCancellationComment; + /** * @param \DateTime $createdAt * @param string $id @@ -176,12 +205,17 @@ class CustomerSubscription * @param ?int $amount * @param ?string $currency * @param ?\DateTime $currentPeriodEnd + * @param ?\DateTime $canceledAt * @param ?\DateTime $startedAt + * @param ?\DateTime $endsAt * @param ?\DateTime $endedAt * @param ?string $discountId * @param ?string $checkoutId + * @param ?CustomerCancellationReason $customerCancellationReason + * @param ?string $customerCancellationComment + * @phpstan-pure */ - public function __construct(\DateTime $createdAt, string $id, SubscriptionRecurringInterval $recurringInterval, SubscriptionStatus $status, \DateTime $currentPeriodStart, bool $cancelAtPeriodEnd, string $customerId, string $productId, string $priceId, string $userId, CustomerSubscriptionProduct $product, ProductPriceRecurringFixed|ProductPriceRecurringCustom|ProductPriceRecurringFree|ProductPriceOneTimeFixed|ProductPriceOneTimeCustom|ProductPriceOneTimeFree $price, ?\DateTime $modifiedAt = null, ?int $amount = null, ?string $currency = null, ?\DateTime $currentPeriodEnd = null, ?\DateTime $startedAt = null, ?\DateTime $endedAt = null, ?string $discountId = null, ?string $checkoutId = null) + public function __construct(\DateTime $createdAt, string $id, SubscriptionRecurringInterval $recurringInterval, SubscriptionStatus $status, \DateTime $currentPeriodStart, bool $cancelAtPeriodEnd, string $customerId, string $productId, string $priceId, string $userId, CustomerSubscriptionProduct $product, ProductPriceRecurringFixed|ProductPriceRecurringCustom|ProductPriceRecurringFree|ProductPriceOneTimeFixed|ProductPriceOneTimeCustom|ProductPriceOneTimeFree $price, ?\DateTime $modifiedAt = null, ?int $amount = null, ?string $currency = null, ?\DateTime $currentPeriodEnd = null, ?\DateTime $canceledAt = null, ?\DateTime $startedAt = null, ?\DateTime $endsAt = null, ?\DateTime $endedAt = null, ?string $discountId = null, ?string $checkoutId = null, ?CustomerCancellationReason $customerCancellationReason = null, ?string $customerCancellationComment = null) { $this->createdAt = $createdAt; $this->id = $id; @@ -199,9 +233,13 @@ public function __construct(\DateTime $createdAt, string $id, SubscriptionRecurr $this->amount = $amount; $this->currency = $currency; $this->currentPeriodEnd = $currentPeriodEnd; + $this->canceledAt = $canceledAt; $this->startedAt = $startedAt; + $this->endsAt = $endsAt; $this->endedAt = $endedAt; $this->discountId = $discountId; $this->checkoutId = $checkoutId; + $this->customerCancellationReason = $customerCancellationReason; + $this->customerCancellationComment = $customerCancellationComment; } } \ No newline at end of file diff --git a/src/Models/Components/CustomerSubscriptionCancel.php b/src/Models/Components/CustomerSubscriptionCancel.php new file mode 100644 index 0000000..3e17936 --- /dev/null +++ b/src/Models/Components/CustomerSubscriptionCancel.php @@ -0,0 +1,67 @@ +cancelAtPeriodEnd = $cancelAtPeriodEnd; + $this->cancellationReason = $cancellationReason; + $this->cancellationComment = $cancellationComment; + } +} \ No newline at end of file diff --git a/src/Models/Components/CustomerSubscriptionProduct.php b/src/Models/Components/CustomerSubscriptionProduct.php index ec60119..e943564 100644 --- a/src/Models/Components/CustomerSubscriptionProduct.php +++ b/src/Models/Components/CustomerSubscriptionProduct.php @@ -62,10 +62,10 @@ class CustomerSubscriptionProduct /** * List of prices for this product. * - * @var array $prices + * @var array $prices */ #[\Speakeasy\Serializer\Annotation\SerializedName('prices')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Polar\Models\Components\ProductPriceRecurringFixed|\Polar\Models\Components\ProductPriceRecurringCustom|\Polar\Models\Components\ProductPriceRecurringFree|\Polar\Models\Components\ProductPriceOneTimeFixed|\Polar\Models\Components\ProductPriceOneTimeCustom|\Polar\Models\Components\ProductPriceOneTimeFree>')] public array $prices; /** @@ -117,12 +117,13 @@ class CustomerSubscriptionProduct * @param bool $isRecurring * @param bool $isArchived * @param string $organizationId - * @param array $prices + * @param array $prices * @param array $benefits * @param array $medias * @param Organization $organization * @param ?\DateTime $modifiedAt * @param ?string $description + * @phpstan-pure */ public function __construct(\DateTime $createdAt, string $id, string $name, bool $isRecurring, bool $isArchived, string $organizationId, array $prices, array $benefits, array $medias, Organization $organization, ?\DateTime $modifiedAt = null, ?string $description = null) { diff --git a/src/Models/Components/CustomerSubscriptionUpdate.php b/src/Models/Components/CustomerSubscriptionUpdatePrice.php similarity index 82% rename from src/Models/Components/CustomerSubscriptionUpdate.php rename to src/Models/Components/CustomerSubscriptionUpdatePrice.php index 02ed729..dd622c2 100644 --- a/src/Models/Components/CustomerSubscriptionUpdate.php +++ b/src/Models/Components/CustomerSubscriptionUpdatePrice.php @@ -9,9 +9,10 @@ namespace Polar\Models\Components; -class CustomerSubscriptionUpdate +class CustomerSubscriptionUpdatePrice { /** + * Update subscription to another price. * * @var string $productPriceId */ @@ -20,6 +21,7 @@ class CustomerSubscriptionUpdate /** * @param string $productPriceId + * @phpstan-pure */ public function __construct(string $productPriceId) { diff --git a/src/Models/Components/CustomerUpdate.php b/src/Models/Components/CustomerUpdate.php index 52eade0..c998976 100644 --- a/src/Models/Components/CustomerUpdate.php +++ b/src/Models/Components/CustomerUpdate.php @@ -11,6 +11,16 @@ class CustomerUpdate { + /** + * $metadata + * + * @var ?array $metadata + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?array $metadata = null; + /** * * @var ?string $email @@ -39,21 +49,24 @@ class CustomerUpdate /** * $taxId * - * @var ?array $taxId + * @var ?array $taxId */ #[\Speakeasy\Serializer\Annotation\SerializedName('tax_id')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $taxId = null; /** + * @param ?array $metadata * @param ?string $email * @param ?string $name * @param ?Address $billingAddress - * @param ?array $taxId + * @param ?array $taxId + * @phpstan-pure */ - public function __construct(?string $email = null, ?string $name = null, ?Address $billingAddress = null, ?array $taxId = null) + public function __construct(?array $metadata = null, ?string $email = null, ?string $name = null, ?Address $billingAddress = null, ?array $taxId = null) { + $this->metadata = $metadata; $this->email = $email; $this->name = $name; $this->billingAddress = $billingAddress; diff --git a/src/Models/Components/DiscountFixedOnceForeverDuration.php b/src/Models/Components/DiscountFixedOnceForeverDuration.php index e8c40cb..792b638 100644 --- a/src/Models/Components/DiscountFixedOnceForeverDuration.php +++ b/src/Models/Components/DiscountFixedOnceForeverDuration.php @@ -61,10 +61,10 @@ class DiscountFixedOnceForeverDuration /** * $metadata * - * @var array $metadata + * @var array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $metadata; /** @@ -147,7 +147,7 @@ class DiscountFixedOnceForeverDuration * @param string $currency * @param \DateTime $createdAt * @param string $id - * @param array $metadata + * @param array $metadata * @param string $name * @param int $redemptionsCount * @param string $organizationId @@ -157,6 +157,7 @@ class DiscountFixedOnceForeverDuration * @param ?\DateTime $startsAt * @param ?\DateTime $endsAt * @param ?int $maxRedemptions + * @phpstan-pure */ public function __construct(DiscountDuration $duration, DiscountType $type, int $amount, string $currency, \DateTime $createdAt, string $id, array $metadata, string $name, int $redemptionsCount, string $organizationId, array $products, ?\DateTime $modifiedAt = null, ?string $code = null, ?\DateTime $startsAt = null, ?\DateTime $endsAt = null, ?int $maxRedemptions = null) { diff --git a/src/Models/Components/DiscountFixedOnceForeverDurationBase.php b/src/Models/Components/DiscountFixedOnceForeverDurationBase.php index 9e5f093..d8f59df 100644 --- a/src/Models/Components/DiscountFixedOnceForeverDurationBase.php +++ b/src/Models/Components/DiscountFixedOnceForeverDurationBase.php @@ -60,10 +60,10 @@ class DiscountFixedOnceForeverDurationBase /** * $metadata * - * @var array $metadata + * @var array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $metadata; /** @@ -137,7 +137,7 @@ class DiscountFixedOnceForeverDurationBase * @param string $currency * @param \DateTime $createdAt * @param string $id - * @param array $metadata + * @param array $metadata * @param string $name * @param int $redemptionsCount * @param string $organizationId @@ -146,6 +146,7 @@ class DiscountFixedOnceForeverDurationBase * @param ?\DateTime $startsAt * @param ?\DateTime $endsAt * @param ?int $maxRedemptions + * @phpstan-pure */ public function __construct(DiscountDuration $duration, DiscountType $type, int $amount, string $currency, \DateTime $createdAt, string $id, array $metadata, string $name, int $redemptionsCount, string $organizationId, ?\DateTime $modifiedAt = null, ?string $code = null, ?\DateTime $startsAt = null, ?\DateTime $endsAt = null, ?int $maxRedemptions = null) { diff --git a/src/Models/Components/DiscountFixedOnceForeverDurationCreate.php b/src/Models/Components/DiscountFixedOnceForeverDurationCreate.php index 73a2ab5..e1713f0 100644 --- a/src/Models/Components/DiscountFixedOnceForeverDurationCreate.php +++ b/src/Models/Components/DiscountFixedOnceForeverDurationCreate.php @@ -57,10 +57,10 @@ class DiscountFixedOnceForeverDurationCreate * * You can store up to **50 key-value pairs**. * - * @var ?array $metadata + * @var ?array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $metadata = null; @@ -134,13 +134,14 @@ class DiscountFixedOnceForeverDurationCreate * @param int $amount * @param string $name * @param ?string $currency - * @param ?array $metadata + * @param ?array $metadata * @param ?string $code * @param ?\DateTime $startsAt * @param ?\DateTime $endsAt * @param ?int $maxRedemptions * @param ?array $products * @param ?string $organizationId + * @phpstan-pure */ public function __construct(DiscountDuration $duration, DiscountType $type, int $amount, string $name, ?array $metadata = null, ?string $code = null, ?\DateTime $startsAt = null, ?\DateTime $endsAt = null, ?int $maxRedemptions = null, ?array $products = null, ?string $organizationId = null, ?string $currency = 'usd') { diff --git a/src/Models/Components/DiscountFixedRepeatDuration.php b/src/Models/Components/DiscountFixedRepeatDuration.php index e72b947..9555479 100644 --- a/src/Models/Components/DiscountFixedRepeatDuration.php +++ b/src/Models/Components/DiscountFixedRepeatDuration.php @@ -72,10 +72,10 @@ class DiscountFixedRepeatDuration /** * $metadata * - * @var array $metadata + * @var array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $metadata; /** @@ -159,7 +159,7 @@ class DiscountFixedRepeatDuration * @param string $currency * @param \DateTime $createdAt * @param string $id - * @param array $metadata + * @param array $metadata * @param string $name * @param int $redemptionsCount * @param string $organizationId @@ -169,6 +169,7 @@ class DiscountFixedRepeatDuration * @param ?\DateTime $startsAt * @param ?\DateTime $endsAt * @param ?int $maxRedemptions + * @phpstan-pure */ public function __construct(DiscountDuration $duration, int $durationInMonths, DiscountType $type, int $amount, string $currency, \DateTime $createdAt, string $id, array $metadata, string $name, int $redemptionsCount, string $organizationId, array $products, ?\DateTime $modifiedAt = null, ?string $code = null, ?\DateTime $startsAt = null, ?\DateTime $endsAt = null, ?int $maxRedemptions = null) { diff --git a/src/Models/Components/DiscountFixedRepeatDurationBase.php b/src/Models/Components/DiscountFixedRepeatDurationBase.php index 1ab0508..e6e35df 100644 --- a/src/Models/Components/DiscountFixedRepeatDurationBase.php +++ b/src/Models/Components/DiscountFixedRepeatDurationBase.php @@ -67,10 +67,10 @@ class DiscountFixedRepeatDurationBase /** * $metadata * - * @var array $metadata + * @var array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $metadata; /** @@ -145,7 +145,7 @@ class DiscountFixedRepeatDurationBase * @param string $currency * @param \DateTime $createdAt * @param string $id - * @param array $metadata + * @param array $metadata * @param string $name * @param int $redemptionsCount * @param string $organizationId @@ -154,6 +154,7 @@ class DiscountFixedRepeatDurationBase * @param ?\DateTime $startsAt * @param ?\DateTime $endsAt * @param ?int $maxRedemptions + * @phpstan-pure */ public function __construct(DiscountDuration $duration, int $durationInMonths, DiscountType $type, int $amount, string $currency, \DateTime $createdAt, string $id, array $metadata, string $name, int $redemptionsCount, string $organizationId, ?\DateTime $modifiedAt = null, ?string $code = null, ?\DateTime $startsAt = null, ?\DateTime $endsAt = null, ?int $maxRedemptions = null) { diff --git a/src/Models/Components/DiscountFixedRepeatDurationCreate.php b/src/Models/Components/DiscountFixedRepeatDurationCreate.php index bef93bb..30a533e 100644 --- a/src/Models/Components/DiscountFixedRepeatDurationCreate.php +++ b/src/Models/Components/DiscountFixedRepeatDurationCreate.php @@ -73,10 +73,10 @@ class DiscountFixedRepeatDurationCreate * * You can store up to **50 key-value pairs**. * - * @var ?array $metadata + * @var ?array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $metadata = null; @@ -151,13 +151,14 @@ class DiscountFixedRepeatDurationCreate * @param int $amount * @param string $name * @param ?string $currency - * @param ?array $metadata + * @param ?array $metadata * @param ?string $code * @param ?\DateTime $startsAt * @param ?\DateTime $endsAt * @param ?int $maxRedemptions * @param ?array $products * @param ?string $organizationId + * @phpstan-pure */ public function __construct(DiscountDuration $duration, int $durationInMonths, DiscountType $type, int $amount, string $name, ?array $metadata = null, ?string $code = null, ?\DateTime $startsAt = null, ?\DateTime $endsAt = null, ?int $maxRedemptions = null, ?array $products = null, ?string $organizationId = null, ?string $currency = 'usd') { diff --git a/src/Models/Components/DiscountPercentageOnceForeverDuration.php b/src/Models/Components/DiscountPercentageOnceForeverDuration.php index 928d746..ffbd9a6 100644 --- a/src/Models/Components/DiscountPercentageOnceForeverDuration.php +++ b/src/Models/Components/DiscountPercentageOnceForeverDuration.php @@ -54,10 +54,10 @@ class DiscountPercentageOnceForeverDuration /** * $metadata * - * @var array $metadata + * @var array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $metadata; /** @@ -139,7 +139,7 @@ class DiscountPercentageOnceForeverDuration * @param int $basisPoints * @param \DateTime $createdAt * @param string $id - * @param array $metadata + * @param array $metadata * @param string $name * @param int $redemptionsCount * @param string $organizationId @@ -149,6 +149,7 @@ class DiscountPercentageOnceForeverDuration * @param ?\DateTime $startsAt * @param ?\DateTime $endsAt * @param ?int $maxRedemptions + * @phpstan-pure */ public function __construct(DiscountDuration $duration, DiscountType $type, int $basisPoints, \DateTime $createdAt, string $id, array $metadata, string $name, int $redemptionsCount, string $organizationId, array $products, ?\DateTime $modifiedAt = null, ?string $code = null, ?\DateTime $startsAt = null, ?\DateTime $endsAt = null, ?int $maxRedemptions = null) { diff --git a/src/Models/Components/DiscountPercentageOnceForeverDurationBase.php b/src/Models/Components/DiscountPercentageOnceForeverDurationBase.php index 57a9a78..d91656d 100644 --- a/src/Models/Components/DiscountPercentageOnceForeverDurationBase.php +++ b/src/Models/Components/DiscountPercentageOnceForeverDurationBase.php @@ -53,10 +53,10 @@ class DiscountPercentageOnceForeverDurationBase /** * $metadata * - * @var array $metadata + * @var array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $metadata; /** @@ -129,7 +129,7 @@ class DiscountPercentageOnceForeverDurationBase * @param int $basisPoints * @param \DateTime $createdAt * @param string $id - * @param array $metadata + * @param array $metadata * @param string $name * @param int $redemptionsCount * @param string $organizationId @@ -138,6 +138,7 @@ class DiscountPercentageOnceForeverDurationBase * @param ?\DateTime $startsAt * @param ?\DateTime $endsAt * @param ?int $maxRedemptions + * @phpstan-pure */ public function __construct(DiscountDuration $duration, DiscountType $type, int $basisPoints, \DateTime $createdAt, string $id, array $metadata, string $name, int $redemptionsCount, string $organizationId, ?\DateTime $modifiedAt = null, ?string $code = null, ?\DateTime $startsAt = null, ?\DateTime $endsAt = null, ?int $maxRedemptions = null) { diff --git a/src/Models/Components/DiscountPercentageOnceForeverDurationCreate.php b/src/Models/Components/DiscountPercentageOnceForeverDurationCreate.php index 107b718..1a631e7 100644 --- a/src/Models/Components/DiscountPercentageOnceForeverDurationCreate.php +++ b/src/Models/Components/DiscountPercentageOnceForeverDurationCreate.php @@ -61,10 +61,10 @@ class DiscountPercentageOnceForeverDurationCreate * * You can store up to **50 key-value pairs**. * - * @var ?array $metadata + * @var ?array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $metadata = null; @@ -128,13 +128,14 @@ class DiscountPercentageOnceForeverDurationCreate * @param DiscountType $type * @param int $basisPoints * @param string $name - * @param ?array $metadata + * @param ?array $metadata * @param ?string $code * @param ?\DateTime $startsAt * @param ?\DateTime $endsAt * @param ?int $maxRedemptions * @param ?array $products * @param ?string $organizationId + * @phpstan-pure */ public function __construct(DiscountDuration $duration, DiscountType $type, int $basisPoints, string $name, ?array $metadata = null, ?string $code = null, ?\DateTime $startsAt = null, ?\DateTime $endsAt = null, ?int $maxRedemptions = null, ?array $products = null, ?string $organizationId = null) { diff --git a/src/Models/Components/DiscountPercentageRepeatDuration.php b/src/Models/Components/DiscountPercentageRepeatDuration.php index 75bb40a..0cf41a5 100644 --- a/src/Models/Components/DiscountPercentageRepeatDuration.php +++ b/src/Models/Components/DiscountPercentageRepeatDuration.php @@ -65,10 +65,10 @@ class DiscountPercentageRepeatDuration /** * $metadata * - * @var array $metadata + * @var array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $metadata; /** @@ -151,7 +151,7 @@ class DiscountPercentageRepeatDuration * @param int $basisPoints * @param \DateTime $createdAt * @param string $id - * @param array $metadata + * @param array $metadata * @param string $name * @param int $redemptionsCount * @param string $organizationId @@ -161,6 +161,7 @@ class DiscountPercentageRepeatDuration * @param ?\DateTime $startsAt * @param ?\DateTime $endsAt * @param ?int $maxRedemptions + * @phpstan-pure */ public function __construct(DiscountDuration $duration, int $durationInMonths, DiscountType $type, int $basisPoints, \DateTime $createdAt, string $id, array $metadata, string $name, int $redemptionsCount, string $organizationId, array $products, ?\DateTime $modifiedAt = null, ?string $code = null, ?\DateTime $startsAt = null, ?\DateTime $endsAt = null, ?int $maxRedemptions = null) { diff --git a/src/Models/Components/DiscountPercentageRepeatDurationBase.php b/src/Models/Components/DiscountPercentageRepeatDurationBase.php index e5f982e..896d367 100644 --- a/src/Models/Components/DiscountPercentageRepeatDurationBase.php +++ b/src/Models/Components/DiscountPercentageRepeatDurationBase.php @@ -60,10 +60,10 @@ class DiscountPercentageRepeatDurationBase /** * $metadata * - * @var array $metadata + * @var array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $metadata; /** @@ -137,7 +137,7 @@ class DiscountPercentageRepeatDurationBase * @param int $basisPoints * @param \DateTime $createdAt * @param string $id - * @param array $metadata + * @param array $metadata * @param string $name * @param int $redemptionsCount * @param string $organizationId @@ -146,6 +146,7 @@ class DiscountPercentageRepeatDurationBase * @param ?\DateTime $startsAt * @param ?\DateTime $endsAt * @param ?int $maxRedemptions + * @phpstan-pure */ public function __construct(DiscountDuration $duration, int $durationInMonths, DiscountType $type, int $basisPoints, \DateTime $createdAt, string $id, array $metadata, string $name, int $redemptionsCount, string $organizationId, ?\DateTime $modifiedAt = null, ?string $code = null, ?\DateTime $startsAt = null, ?\DateTime $endsAt = null, ?int $maxRedemptions = null) { diff --git a/src/Models/Components/DiscountPercentageRepeatDurationCreate.php b/src/Models/Components/DiscountPercentageRepeatDurationCreate.php index 104b521..c4f7419 100644 --- a/src/Models/Components/DiscountPercentageRepeatDurationCreate.php +++ b/src/Models/Components/DiscountPercentageRepeatDurationCreate.php @@ -77,10 +77,10 @@ class DiscountPercentageRepeatDurationCreate * * You can store up to **50 key-value pairs**. * - * @var ?array $metadata + * @var ?array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $metadata = null; @@ -145,13 +145,14 @@ class DiscountPercentageRepeatDurationCreate * @param DiscountType $type * @param int $basisPoints * @param string $name - * @param ?array $metadata + * @param ?array $metadata * @param ?string $code * @param ?\DateTime $startsAt * @param ?\DateTime $endsAt * @param ?int $maxRedemptions * @param ?array $products * @param ?string $organizationId + * @phpstan-pure */ public function __construct(DiscountDuration $duration, int $durationInMonths, DiscountType $type, int $basisPoints, string $name, ?array $metadata = null, ?string $code = null, ?\DateTime $startsAt = null, ?\DateTime $endsAt = null, ?int $maxRedemptions = null, ?array $products = null, ?string $organizationId = null) { diff --git a/src/Models/Components/DiscountProduct.php b/src/Models/Components/DiscountProduct.php index fe73ca1..f76067d 100644 --- a/src/Models/Components/DiscountProduct.php +++ b/src/Models/Components/DiscountProduct.php @@ -85,6 +85,7 @@ class DiscountProduct * @param string $organizationId * @param ?\DateTime $modifiedAt * @param ?string $description + * @phpstan-pure */ public function __construct(\DateTime $createdAt, string $id, string $name, bool $isRecurring, bool $isArchived, string $organizationId, ?\DateTime $modifiedAt = null, ?string $description = null) { diff --git a/src/Models/Components/DiscountUpdate.php b/src/Models/Components/DiscountUpdate.php index f5dfe00..6afd72d 100644 --- a/src/Models/Components/DiscountUpdate.php +++ b/src/Models/Components/DiscountUpdate.php @@ -15,10 +15,10 @@ class DiscountUpdate /** * $metadata * - * @var ?array $metadata + * @var ?array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $metadata = null; @@ -123,7 +123,7 @@ class DiscountUpdate public ?string $currency = null; /** - * @param ?array $metadata + * @param ?array $metadata * @param ?string $name * @param ?string $code * @param ?\DateTime $startsAt @@ -136,6 +136,7 @@ class DiscountUpdate * @param ?string $currency * @param ?int $basisPoints * @param ?array $products + * @phpstan-pure */ public function __construct(?array $metadata = null, ?string $name = null, ?string $code = null, ?\DateTime $startsAt = null, ?\DateTime $endsAt = null, ?int $maxRedemptions = null, ?DiscountDuration $duration = null, ?int $durationInMonths = null, ?DiscountType $type = null, ?int $amount = null, ?int $basisPoints = null, ?array $products = null, ?string $currency = 'usd') { diff --git a/src/Models/Components/DownloadableFileCreate.php b/src/Models/Components/DownloadableFileCreate.php index 87d275e..ea174d5 100644 --- a/src/Models/Components/DownloadableFileCreate.php +++ b/src/Models/Components/DownloadableFileCreate.php @@ -67,23 +67,23 @@ class DownloadableFileCreate /** * - * @var DownloadableFileCreateService $service + * @var string $service */ #[\Speakeasy\Serializer\Annotation\SerializedName('service')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\DownloadableFileCreateService')] - public DownloadableFileCreateService $service; + public string $service; /** * @param string $name * @param string $mimeType * @param int $size * @param S3FileCreateMultipart $upload - * @param DownloadableFileCreateService $service + * @param string $service * @param ?string $organizationId * @param ?string $checksumSha256Base64 * @param ?string $version + * @phpstan-pure */ - public function __construct(string $name, string $mimeType, int $size, S3FileCreateMultipart $upload, ?string $organizationId = null, ?string $checksumSha256Base64 = null, ?string $version = null, DownloadableFileCreateService $service = DownloadableFileCreateService::Downloadable) + public function __construct(string $name, string $mimeType, int $size, S3FileCreateMultipart $upload, ?string $organizationId = null, ?string $checksumSha256Base64 = null, ?string $version = null, string $service = 'downloadable') { $this->name = $name; $this->mimeType = $mimeType; diff --git a/src/Models/Components/DownloadableFileCreateService.php b/src/Models/Components/DownloadableFileCreateService.php deleted file mode 100644 index 9153713..0000000 --- a/src/Models/Components/DownloadableFileCreateService.php +++ /dev/null @@ -1,15 +0,0 @@ -id = $id; $this->organizationId = $organizationId; diff --git a/src/Models/Components/DownloadableFileReadService.php b/src/Models/Components/DownloadableFileReadService.php deleted file mode 100644 index 12fd800..0000000 --- a/src/Models/Components/DownloadableFileReadService.php +++ /dev/null @@ -1,15 +0,0 @@ - $metadata + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\Type('array')] + public array $metadata; + + /** + * The ID of the object. + * + * @var string $id + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('id')] + public string $id; + + /** + * The timestamp of the event. + * + * @var \DateTime $timestamp + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('timestamp')] + public \DateTime $timestamp; + + /** + * The name of the event. + * + * @var string $name + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('name')] + public string $name; + + /** + * + * @var EventSource $source + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('source')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\EventSource')] + public EventSource $source; + + /** + * The ID of the organization owning the event. + * + * @var string $organizationId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('organization_id')] + public string $organizationId; + + /** + * ID of the customer in your Polar organization associated with the event. + * + * @var ?string $customerId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('customer_id')] + public ?string $customerId; + + /** + * ID of the customer in your system associated with the event. + * + * @var ?string $externalCustomerId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('external_customer_id')] + public ?string $externalCustomerId; + + /** + * @param array $metadata + * @param string $id + * @param \DateTime $timestamp + * @param string $name + * @param EventSource $source + * @param string $organizationId + * @param ?string $customerId + * @param ?string $externalCustomerId + * @phpstan-pure + */ + public function __construct(array $metadata, string $id, \DateTime $timestamp, string $name, EventSource $source, string $organizationId, ?string $customerId = null, ?string $externalCustomerId = null) + { + $this->metadata = $metadata; + $this->id = $id; + $this->timestamp = $timestamp; + $this->name = $name; + $this->source = $source; + $this->organizationId = $organizationId; + $this->customerId = $customerId; + $this->externalCustomerId = $externalCustomerId; + } +} \ No newline at end of file diff --git a/src/Models/Components/EventCreateCustomer.php b/src/Models/Components/EventCreateCustomer.php new file mode 100644 index 0000000..7101423 --- /dev/null +++ b/src/Models/Components/EventCreateCustomer.php @@ -0,0 +1,84 @@ + $metadata + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?array $metadata = null; + + /** + * The timestamp of the event. + * + * @var ?\DateTime $timestamp + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('timestamp')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?\DateTime $timestamp = null; + + /** + * The ID of the organization owning the event. **Required unless you use an organization token.** + * + * @var ?string $organizationId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('organization_id')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $organizationId = null; + + /** + * @param string $name + * @param string $customerId + * @param ?array $metadata + * @param ?\DateTime $timestamp + * @param ?string $organizationId + * @phpstan-pure + */ + public function __construct(string $name, string $customerId, ?array $metadata = null, ?\DateTime $timestamp = null, ?string $organizationId = null) + { + $this->name = $name; + $this->customerId = $customerId; + $this->metadata = $metadata; + $this->timestamp = $timestamp; + $this->organizationId = $organizationId; + } +} \ No newline at end of file diff --git a/src/Models/Components/EventCreateExternalCustomer.php b/src/Models/Components/EventCreateExternalCustomer.php new file mode 100644 index 0000000..44c1323 --- /dev/null +++ b/src/Models/Components/EventCreateExternalCustomer.php @@ -0,0 +1,84 @@ + $metadata + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?array $metadata = null; + + /** + * The timestamp of the event. + * + * @var ?\DateTime $timestamp + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('timestamp')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?\DateTime $timestamp = null; + + /** + * The ID of the organization owning the event. **Required unless you use an organization token.** + * + * @var ?string $organizationId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('organization_id')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $organizationId = null; + + /** + * @param string $name + * @param string $externalCustomerId + * @param ?array $metadata + * @param ?\DateTime $timestamp + * @param ?string $organizationId + * @phpstan-pure + */ + public function __construct(string $name, string $externalCustomerId, ?array $metadata = null, ?\DateTime $timestamp = null, ?string $organizationId = null) + { + $this->name = $name; + $this->externalCustomerId = $externalCustomerId; + $this->metadata = $metadata; + $this->timestamp = $timestamp; + $this->organizationId = $organizationId; + } +} \ No newline at end of file diff --git a/src/Models/Components/BenefitAdsCreateType.php b/src/Models/Components/EventSortProperty.php similarity index 59% rename from src/Models/Components/BenefitAdsCreateType.php rename to src/Models/Components/EventSortProperty.php index e8ea7da..82f09c0 100644 --- a/src/Models/Components/BenefitAdsCreateType.php +++ b/src/Models/Components/EventSortProperty.php @@ -9,7 +9,8 @@ namespace Polar\Models\Components; -enum BenefitAdsCreateType: string +enum EventSortProperty: string { - case Ads = 'ads'; + case Timestamp = 'timestamp'; + case MinusTimestamp = '-timestamp'; } diff --git a/src/Models/Components/AuthorizeResponseUserSubType.php b/src/Models/Components/EventSource.php similarity index 76% rename from src/Models/Components/AuthorizeResponseUserSubType.php rename to src/Models/Components/EventSource.php index d9885d3..cab285c 100644 --- a/src/Models/Components/AuthorizeResponseUserSubType.php +++ b/src/Models/Components/EventSource.php @@ -9,7 +9,8 @@ namespace Polar\Models\Components; -enum AuthorizeResponseUserSubType: string +enum EventSource: string { + case System = 'system'; case User = 'user'; } diff --git a/src/Models/Components/EventsIngest.php b/src/Models/Components/EventsIngest.php new file mode 100644 index 0000000..c0c992d --- /dev/null +++ b/src/Models/Components/EventsIngest.php @@ -0,0 +1,31 @@ + $events + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('events')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Polar\Models\Components\EventCreateCustomer|\Polar\Models\Components\EventCreateExternalCustomer>')] + public array $events; + + /** + * @param array $events + * @phpstan-pure + */ + public function __construct(array $events) + { + $this->events = $events; + } +} \ No newline at end of file diff --git a/src/Models/Components/EventsIngestResponse.php b/src/Models/Components/EventsIngestResponse.php new file mode 100644 index 0000000..5050930 --- /dev/null +++ b/src/Models/Components/EventsIngestResponse.php @@ -0,0 +1,30 @@ +inserted = $inserted; + } +} \ No newline at end of file diff --git a/src/Models/Components/ExistingProductPrice.php b/src/Models/Components/ExistingProductPrice.php index a068f9e..f555d18 100644 --- a/src/Models/Components/ExistingProductPrice.php +++ b/src/Models/Components/ExistingProductPrice.php @@ -26,6 +26,7 @@ class ExistingProductPrice /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Components/ExternalOrganization.php b/src/Models/Components/ExternalOrganization.php index ed82bfb..f4c7ca8 100644 --- a/src/Models/Components/ExternalOrganization.php +++ b/src/Models/Components/ExternalOrganization.php @@ -18,6 +18,14 @@ class ExternalOrganization #[\Speakeasy\Serializer\Annotation\SerializedName('id')] public string $id; + /** + * + * @var Platforms $platform + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('platform')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\Platforms')] + public Platforms $platform; + /** * * @var string $name @@ -95,14 +103,6 @@ class ExternalOrganization #[\Speakeasy\Serializer\Annotation\SerializedName('organization_id')] public ?string $organizationId; - /** - * - * @var Platforms $platform - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('platform')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\Platforms')] - public Platforms $platform; - /** * @param string $id * @param Platforms $platform @@ -117,10 +117,12 @@ class ExternalOrganization * @param ?string $email * @param ?string $twitterUsername * @param ?string $organizationId + * @phpstan-pure */ - public function __construct(string $id, string $name, string $avatarUrl, bool $isPersonal, ?string $bio = null, ?string $prettyName = null, ?string $company = null, ?string $blog = null, ?string $location = null, ?string $email = null, ?string $twitterUsername = null, ?string $organizationId = null, Platforms $platform = Platforms::Github) + public function __construct(string $id, Platforms $platform, string $name, string $avatarUrl, bool $isPersonal, ?string $bio = null, ?string $prettyName = null, ?string $company = null, ?string $blog = null, ?string $location = null, ?string $email = null, ?string $twitterUsername = null, ?string $organizationId = null) { $this->id = $id; + $this->platform = $platform; $this->name = $name; $this->avatarUrl = $avatarUrl; $this->isPersonal = $isPersonal; @@ -132,6 +134,5 @@ public function __construct(string $id, string $name, string $avatarUrl, bool $i $this->email = $email; $this->twitterUsername = $twitterUsername; $this->organizationId = $organizationId; - $this->platform = $platform; } } \ No newline at end of file diff --git a/src/Models/Components/FileDownload.php b/src/Models/Components/FileDownload.php index 939faa1..1599e33 100644 --- a/src/Models/Components/FileDownload.php +++ b/src/Models/Components/FileDownload.php @@ -143,6 +143,7 @@ class FileDownload * @param ?string $checksumSha256Hex * @param ?\DateTime $lastModifiedAt * @param ?string $version + * @phpstan-pure */ public function __construct(string $id, string $organizationId, string $name, string $path, string $mimeType, int $size, S3DownloadURL $download, bool $isUploaded, FileServiceTypes $service, string $sizeReadable, ?string $storageVersion = null, ?string $checksumEtag = null, ?string $checksumSha256Base64 = null, ?string $checksumSha256Hex = null, ?\DateTime $lastModifiedAt = null, ?string $version = null) { diff --git a/src/Models/Components/FilePatch.php b/src/Models/Components/FilePatch.php index 2c1a07f..0aa0c34 100644 --- a/src/Models/Components/FilePatch.php +++ b/src/Models/Components/FilePatch.php @@ -30,6 +30,7 @@ class FilePatch /** * @param ?string $name * @param ?string $version + * @phpstan-pure */ public function __construct(?string $name = null, ?string $version = null) { diff --git a/src/Models/Components/FileUpload.php b/src/Models/Components/FileUpload.php index ab047bd..17b16fa 100644 --- a/src/Models/Components/FileUpload.php +++ b/src/Models/Components/FileUpload.php @@ -144,6 +144,7 @@ class FileUpload * @param ?\DateTime $lastModifiedAt * @param ?string $version * @param ?bool $isUploaded + * @phpstan-pure */ public function __construct(string $id, string $organizationId, string $name, string $path, string $mimeType, int $size, S3FileUploadMultipart $upload, FileServiceTypes $service, string $sizeReadable, ?string $storageVersion = null, ?string $checksumEtag = null, ?string $checksumSha256Base64 = null, ?string $checksumSha256Hex = null, ?\DateTime $lastModifiedAt = null, ?string $version = null, ?bool $isUploaded = false) { diff --git a/src/Models/Components/FileUploadCompleted.php b/src/Models/Components/FileUploadCompleted.php index 20fff6d..14c7c00 100644 --- a/src/Models/Components/FileUploadCompleted.php +++ b/src/Models/Components/FileUploadCompleted.php @@ -38,6 +38,7 @@ class FileUploadCompleted * @param string $id * @param string $path * @param array $parts + * @phpstan-pure */ public function __construct(string $id, string $path, array $parts) { diff --git a/src/Models/Components/Filter.php b/src/Models/Components/Filter.php new file mode 100644 index 0000000..796f79d --- /dev/null +++ b/src/Models/Components/Filter.php @@ -0,0 +1,41 @@ + $clauses + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('clauses')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Polar\Models\Components\FilterClause|\Polar\Models\Components\Filter>')] + public array $clauses; + + /** + * @param FilterConjunction $conjunction + * @param array $clauses + * @phpstan-pure + */ + public function __construct(FilterConjunction $conjunction, array $clauses) + { + $this->conjunction = $conjunction; + $this->clauses = $clauses; + } +} \ No newline at end of file diff --git a/src/Models/Components/FilterClause.php b/src/Models/Components/FilterClause.php new file mode 100644 index 0000000..14c3f86 --- /dev/null +++ b/src/Models/Components/FilterClause.php @@ -0,0 +1,49 @@ +property = $property; + $this->operator = $operator; + $this->value = $value; + } +} \ No newline at end of file diff --git a/src/Models/Components/AmountType.php b/src/Models/Components/FilterConjunction.php similarity index 67% rename from src/Models/Components/AmountType.php rename to src/Models/Components/FilterConjunction.php index fa1ed50..ebea569 100644 --- a/src/Models/Components/AmountType.php +++ b/src/Models/Components/FilterConjunction.php @@ -9,7 +9,8 @@ namespace Polar\Models\Components; -enum AmountType: string +enum FilterConjunction: string { - case Fixed = 'fixed'; + case And = 'and'; + case Or = 'or'; } diff --git a/src/Models/Components/FilterOperator.php b/src/Models/Components/FilterOperator.php new file mode 100644 index 0000000..39485c7 --- /dev/null +++ b/src/Models/Components/FilterOperator.php @@ -0,0 +1,22 @@ +active = $active; $this->clientId = $clientId; diff --git a/src/Models/Components/IntrospectTokenResponseTokenType.php b/src/Models/Components/IntrospectTokenResponseTokenType.php deleted file mode 100644 index 4289ecb..0000000 --- a/src/Models/Components/IntrospectTokenResponseTokenType.php +++ /dev/null @@ -1,16 +0,0 @@ -id = $id; + $this->platform = $platform; $this->number = $number; $this->title = $title; $this->state = $state; @@ -235,6 +237,5 @@ public function __construct(string $id, int $number, string $title, State $state $this->confirmedSolvedAt = $confirmedSolvedAt; $this->upfrontSplitToContributors = $upfrontSplitToContributors; $this->badgeCustomContent = $badgeCustomContent; - $this->platform = $platform; } } \ No newline at end of file diff --git a/src/Models/Components/Label.php b/src/Models/Components/Label.php index 478a68a..2a76338 100644 --- a/src/Models/Components/Label.php +++ b/src/Models/Components/Label.php @@ -28,6 +28,7 @@ class Label /** * @param string $name * @param string $color + * @phpstan-pure */ public function __construct(string $name, string $color) { diff --git a/src/Models/Components/LicenseKeyActivate.php b/src/Models/Components/LicenseKeyActivate.php index d6eecca..50e0341 100644 --- a/src/Models/Components/LicenseKeyActivate.php +++ b/src/Models/Components/LicenseKeyActivate.php @@ -56,6 +56,7 @@ class LicenseKeyActivate * @param string $label * @param ?LicenseKeyActivateConditions $conditions * @param ?LicenseKeyActivateMeta $meta + * @phpstan-pure */ public function __construct(string $key, string $organizationId, string $label, ?LicenseKeyActivateConditions $conditions = null, ?LicenseKeyActivateMeta $meta = null) { diff --git a/src/Models/Components/LicenseKeyActivationBase.php b/src/Models/Components/LicenseKeyActivationBase.php index 0d5479d..a6d9e23 100644 --- a/src/Models/Components/LicenseKeyActivationBase.php +++ b/src/Models/Components/LicenseKeyActivationBase.php @@ -61,6 +61,7 @@ class LicenseKeyActivationBase * @param Meta $meta * @param \DateTime $createdAt * @param ?\DateTime $modifiedAt + * @phpstan-pure */ public function __construct(string $id, string $licenseKeyId, string $label, Meta $meta, \DateTime $createdAt, ?\DateTime $modifiedAt = null) { diff --git a/src/Models/Components/LicenseKeyActivationRead.php b/src/Models/Components/LicenseKeyActivationRead.php index a234fcc..273da9f 100644 --- a/src/Models/Components/LicenseKeyActivationRead.php +++ b/src/Models/Components/LicenseKeyActivationRead.php @@ -70,6 +70,7 @@ class LicenseKeyActivationRead * @param \DateTime $createdAt * @param LicenseKeyRead $licenseKey * @param ?\DateTime $modifiedAt + * @phpstan-pure */ public function __construct(string $id, string $licenseKeyId, string $label, LicenseKeyActivationReadMeta $meta, \DateTime $createdAt, LicenseKeyRead $licenseKey, ?\DateTime $modifiedAt = null) { diff --git a/src/Models/Components/LicenseKeyCustomer.php b/src/Models/Components/LicenseKeyCustomer.php index 6b7b971..d1045cd 100644 --- a/src/Models/Components/LicenseKeyCustomer.php +++ b/src/Models/Components/LicenseKeyCustomer.php @@ -30,10 +30,10 @@ class LicenseKeyCustomer /** * $metadata * - * @var array $metadata + * @var array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $metadata; /** @@ -90,16 +90,16 @@ class LicenseKeyCustomer /** * $taxId * - * @var ?array $taxId + * @var ?array $taxId */ #[\Speakeasy\Serializer\Annotation\SerializedName('tax_id')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] public ?array $taxId; /** * @param \DateTime $createdAt * @param string $id - * @param array $metadata + * @param array $metadata * @param string $email * @param bool $emailVerified * @param string $organizationId @@ -107,7 +107,8 @@ class LicenseKeyCustomer * @param ?\DateTime $modifiedAt * @param ?string $name * @param ?Address $billingAddress - * @param ?array $taxId + * @param ?array $taxId + * @phpstan-pure */ public function __construct(\DateTime $createdAt, string $id, array $metadata, string $email, bool $emailVerified, string $organizationId, string $avatarUrl, ?\DateTime $modifiedAt = null, ?string $name = null, ?Address $billingAddress = null, ?array $taxId = null) { diff --git a/src/Models/Components/LicenseKeyDeactivate.php b/src/Models/Components/LicenseKeyDeactivate.php index 3ce824b..0a11ddc 100644 --- a/src/Models/Components/LicenseKeyDeactivate.php +++ b/src/Models/Components/LicenseKeyDeactivate.php @@ -36,6 +36,7 @@ class LicenseKeyDeactivate * @param string $key * @param string $organizationId * @param string $activationId + * @phpstan-pure */ public function __construct(string $key, string $organizationId, string $activationId) { diff --git a/src/Models/Components/LicenseKeyRead.php b/src/Models/Components/LicenseKeyRead.php index c2e383a..b80cacf 100644 --- a/src/Models/Components/LicenseKeyRead.php +++ b/src/Models/Components/LicenseKeyRead.php @@ -145,6 +145,7 @@ class LicenseKeyRead * @param ?int $limitUsage * @param ?\DateTime $lastValidatedAt * @param ?\DateTime $expiresAt + * @phpstan-pure */ public function __construct(string $id, string $organizationId, string $userId, string $customerId, LicenseKeyUser $user, LicenseKeyCustomer $customer, string $benefitId, string $key, string $displayKey, LicenseKeyStatus $status, int $usage, int $validations, ?int $limitActivations = null, ?int $limitUsage = null, ?\DateTime $lastValidatedAt = null, ?\DateTime $expiresAt = null) { diff --git a/src/Models/Components/LicenseKeyUpdate.php b/src/Models/Components/LicenseKeyUpdate.php index ed6066f..a8a2909 100644 --- a/src/Models/Components/LicenseKeyUpdate.php +++ b/src/Models/Components/LicenseKeyUpdate.php @@ -58,6 +58,7 @@ class LicenseKeyUpdate * @param ?int $limitActivations * @param ?int $limitUsage * @param ?\DateTime $expiresAt + * @phpstan-pure */ public function __construct(?LicenseKeyStatus $status = null, ?int $limitActivations = null, ?int $limitUsage = null, ?\DateTime $expiresAt = null, ?int $usage = 0) { diff --git a/src/Models/Components/LicenseKeyUser.php b/src/Models/Components/LicenseKeyUser.php index 4c0db0e..44a2a28 100644 --- a/src/Models/Components/LicenseKeyUser.php +++ b/src/Models/Components/LicenseKeyUser.php @@ -45,6 +45,7 @@ class LicenseKeyUser * @param string $email * @param string $publicName * @param ?string $avatarUrl + * @phpstan-pure */ public function __construct(string $id, string $email, string $publicName, ?string $avatarUrl = null) { diff --git a/src/Models/Components/LicenseKeyValidate.php b/src/Models/Components/LicenseKeyValidate.php index 70c0de1..3762342 100644 --- a/src/Models/Components/LicenseKeyValidate.php +++ b/src/Models/Components/LicenseKeyValidate.php @@ -74,6 +74,7 @@ class LicenseKeyValidate * @param ?string $benefitId * @param ?string $customerId * @param ?int $incrementUsage + * @phpstan-pure */ public function __construct(string $key, string $organizationId, ?Conditions $conditions = null, ?string $activationId = null, ?string $benefitId = null, ?string $customerId = null, ?int $incrementUsage = null) { diff --git a/src/Models/Components/LicenseKeyWithActivations.php b/src/Models/Components/LicenseKeyWithActivations.php index 1b10bca..e37a68b 100644 --- a/src/Models/Components/LicenseKeyWithActivations.php +++ b/src/Models/Components/LicenseKeyWithActivations.php @@ -155,6 +155,7 @@ class LicenseKeyWithActivations * @param ?int $limitUsage * @param ?\DateTime $lastValidatedAt * @param ?\DateTime $expiresAt + * @phpstan-pure */ public function __construct(string $id, string $organizationId, string $userId, string $customerId, LicenseKeyUser $user, LicenseKeyCustomer $customer, string $benefitId, string $key, string $displayKey, LicenseKeyStatus $status, int $usage, int $validations, array $activations, ?int $limitActivations = null, ?int $limitUsage = null, ?\DateTime $lastValidatedAt = null, ?\DateTime $expiresAt = null) { diff --git a/src/Models/Components/ListResourceBenefit.php b/src/Models/Components/ListResourceBenefit.php index 3b64d82..6ef8b19 100644 --- a/src/Models/Components/ListResourceBenefit.php +++ b/src/Models/Components/ListResourceBenefit.php @@ -14,10 +14,10 @@ class ListResourceBenefit /** * $items * - * @var array $items + * @var array $items */ #[\Speakeasy\Serializer\Annotation\SerializedName('items')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Polar\Models\Components\BenefitAds|\Polar\Models\Components\BenefitCustom|\Polar\Models\Components\BenefitDiscord|\Polar\Models\Components\BenefitGitHubRepository|\Polar\Models\Components\BenefitDownloadables|\Polar\Models\Components\BenefitLicenseKeys>')] public array $items; /** @@ -29,8 +29,9 @@ class ListResourceBenefit public Pagination $pagination; /** - * @param array $items + * @param array $items * @param Pagination $pagination + * @phpstan-pure */ public function __construct(array $items, Pagination $pagination) { diff --git a/src/Models/Components/ListResourceBenefitGrant.php b/src/Models/Components/ListResourceBenefitGrant.php index 6ae3579..924b8fc 100644 --- a/src/Models/Components/ListResourceBenefitGrant.php +++ b/src/Models/Components/ListResourceBenefitGrant.php @@ -31,6 +31,7 @@ class ListResourceBenefitGrant /** * @param array $items * @param Pagination $pagination + * @phpstan-pure */ public function __construct(array $items, Pagination $pagination) { diff --git a/src/Models/Components/ListResourceCheckout.php b/src/Models/Components/ListResourceCheckout.php index 09c6a46..9f1dad2 100644 --- a/src/Models/Components/ListResourceCheckout.php +++ b/src/Models/Components/ListResourceCheckout.php @@ -31,6 +31,7 @@ class ListResourceCheckout /** * @param array $items * @param Pagination $pagination + * @phpstan-pure */ public function __construct(array $items, Pagination $pagination) { diff --git a/src/Models/Components/ListResourceCheckoutLink.php b/src/Models/Components/ListResourceCheckoutLink.php index 4155703..371db46 100644 --- a/src/Models/Components/ListResourceCheckoutLink.php +++ b/src/Models/Components/ListResourceCheckoutLink.php @@ -31,6 +31,7 @@ class ListResourceCheckoutLink /** * @param array $items * @param Pagination $pagination + * @phpstan-pure */ public function __construct(array $items, Pagination $pagination) { diff --git a/src/Models/Components/ListResourceCustomField.php b/src/Models/Components/ListResourceCustomField.php index c3b946f..47da43f 100644 --- a/src/Models/Components/ListResourceCustomField.php +++ b/src/Models/Components/ListResourceCustomField.php @@ -14,10 +14,10 @@ class ListResourceCustomField /** * $items * - * @var array $items + * @var array $items */ #[\Speakeasy\Serializer\Annotation\SerializedName('items')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Polar\Models\Components\CustomFieldText|\Polar\Models\Components\CustomFieldNumber|\Polar\Models\Components\CustomFieldDate|\Polar\Models\Components\CustomFieldCheckbox|\Polar\Models\Components\CustomFieldSelect>')] public array $items; /** @@ -29,8 +29,9 @@ class ListResourceCustomField public Pagination $pagination; /** - * @param array $items + * @param array $items * @param Pagination $pagination + * @phpstan-pure */ public function __construct(array $items, Pagination $pagination) { diff --git a/src/Models/Components/ListResourceCustomer.php b/src/Models/Components/ListResourceCustomer.php index 0c62090..095e13d 100644 --- a/src/Models/Components/ListResourceCustomer.php +++ b/src/Models/Components/ListResourceCustomer.php @@ -31,6 +31,7 @@ class ListResourceCustomer /** * @param array $items * @param Pagination $pagination + * @phpstan-pure */ public function __construct(array $items, Pagination $pagination) { diff --git a/src/Models/Components/ListResourceCustomerBenefitGrant.php b/src/Models/Components/ListResourceCustomerBenefitGrant.php index d47f96b..4677085 100644 --- a/src/Models/Components/ListResourceCustomerBenefitGrant.php +++ b/src/Models/Components/ListResourceCustomerBenefitGrant.php @@ -14,10 +14,10 @@ class ListResourceCustomerBenefitGrant /** * $items * - * @var array $items + * @var array $items */ #[\Speakeasy\Serializer\Annotation\SerializedName('items')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Polar\Models\Components\CustomerBenefitGrantDiscord|\Polar\Models\Components\CustomerBenefitGrantGitHubRepository|\Polar\Models\Components\CustomerBenefitGrantDownloadables|\Polar\Models\Components\CustomerBenefitGrantLicenseKeys|\Polar\Models\Components\CustomerBenefitGrantAds|\Polar\Models\Components\CustomerBenefitGrantCustom>')] public array $items; /** @@ -29,8 +29,9 @@ class ListResourceCustomerBenefitGrant public Pagination $pagination; /** - * @param array $items + * @param array $items * @param Pagination $pagination + * @phpstan-pure */ public function __construct(array $items, Pagination $pagination) { diff --git a/src/Models/Components/ListResourceCustomerOrder.php b/src/Models/Components/ListResourceCustomerOrder.php index dfbe638..668adb9 100644 --- a/src/Models/Components/ListResourceCustomerOrder.php +++ b/src/Models/Components/ListResourceCustomerOrder.php @@ -31,6 +31,7 @@ class ListResourceCustomerOrder /** * @param array $items * @param Pagination $pagination + * @phpstan-pure */ public function __construct(array $items, Pagination $pagination) { diff --git a/src/Models/Components/ListResourceCustomerSubscription.php b/src/Models/Components/ListResourceCustomerSubscription.php index e453be2..63d0174 100644 --- a/src/Models/Components/ListResourceCustomerSubscription.php +++ b/src/Models/Components/ListResourceCustomerSubscription.php @@ -31,6 +31,7 @@ class ListResourceCustomerSubscription /** * @param array $items * @param Pagination $pagination + * @phpstan-pure */ public function __construct(array $items, Pagination $pagination) { diff --git a/src/Models/Components/ListResourceDiscount.php b/src/Models/Components/ListResourceDiscount.php index 86b6af1..095bff7 100644 --- a/src/Models/Components/ListResourceDiscount.php +++ b/src/Models/Components/ListResourceDiscount.php @@ -14,10 +14,10 @@ class ListResourceDiscount /** * $items * - * @var array $items + * @var array $items */ #[\Speakeasy\Serializer\Annotation\SerializedName('items')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Polar\Models\Components\DiscountFixedOnceForeverDuration|\Polar\Models\Components\DiscountFixedRepeatDuration|\Polar\Models\Components\DiscountPercentageOnceForeverDuration|\Polar\Models\Components\DiscountPercentageRepeatDuration>')] public array $items; /** @@ -29,8 +29,9 @@ class ListResourceDiscount public Pagination $pagination; /** - * @param array $items + * @param array $items * @param Pagination $pagination + * @phpstan-pure */ public function __construct(array $items, Pagination $pagination) { diff --git a/src/Models/Components/ListResourceDownloadableRead.php b/src/Models/Components/ListResourceDownloadableRead.php index e8ffbad..15f959d 100644 --- a/src/Models/Components/ListResourceDownloadableRead.php +++ b/src/Models/Components/ListResourceDownloadableRead.php @@ -31,6 +31,7 @@ class ListResourceDownloadableRead /** * @param array $items * @param Pagination $pagination + * @phpstan-pure */ public function __construct(array $items, Pagination $pagination) { diff --git a/src/Models/Components/ListResourceEvent.php b/src/Models/Components/ListResourceEvent.php new file mode 100644 index 0000000..18cb35e --- /dev/null +++ b/src/Models/Components/ListResourceEvent.php @@ -0,0 +1,41 @@ + $items + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('items')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Polar\Models\Components\Event>')] + public array $items; + + /** + * + * @var Pagination $pagination + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('pagination')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\Pagination')] + public Pagination $pagination; + + /** + * @param array $items + * @param Pagination $pagination + * @phpstan-pure + */ + public function __construct(array $items, Pagination $pagination) + { + $this->items = $items; + $this->pagination = $pagination; + } +} \ No newline at end of file diff --git a/src/Models/Components/ListResourceExternalOrganization.php b/src/Models/Components/ListResourceExternalOrganization.php index c72140a..c8ab986 100644 --- a/src/Models/Components/ListResourceExternalOrganization.php +++ b/src/Models/Components/ListResourceExternalOrganization.php @@ -31,6 +31,7 @@ class ListResourceExternalOrganization /** * @param array $items * @param Pagination $pagination + * @phpstan-pure */ public function __construct(array $items, Pagination $pagination) { diff --git a/src/Models/Components/ListResourceFileRead.php b/src/Models/Components/ListResourceFileRead.php index 3ca12b3..53e10e6 100644 --- a/src/Models/Components/ListResourceFileRead.php +++ b/src/Models/Components/ListResourceFileRead.php @@ -14,10 +14,10 @@ class ListResourceFileRead /** * $items * - * @var array $items + * @var array $items */ #[\Speakeasy\Serializer\Annotation\SerializedName('items')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Polar\Models\Components\DownloadableFileRead|\Polar\Models\Components\ProductMediaFileRead|\Polar\Models\Components\OrganizationAvatarFileRead>')] public array $items; /** @@ -29,8 +29,9 @@ class ListResourceFileRead public Pagination $pagination; /** - * @param array $items + * @param array $items * @param Pagination $pagination + * @phpstan-pure */ public function __construct(array $items, Pagination $pagination) { diff --git a/src/Models/Components/ListResourceLicenseKeyRead.php b/src/Models/Components/ListResourceLicenseKeyRead.php index fc0ad10..9a04fce 100644 --- a/src/Models/Components/ListResourceLicenseKeyRead.php +++ b/src/Models/Components/ListResourceLicenseKeyRead.php @@ -31,6 +31,7 @@ class ListResourceLicenseKeyRead /** * @param array $items * @param Pagination $pagination + * @phpstan-pure */ public function __construct(array $items, Pagination $pagination) { diff --git a/src/Models/Components/ListResourceMeter.php b/src/Models/Components/ListResourceMeter.php new file mode 100644 index 0000000..c8cfb9c --- /dev/null +++ b/src/Models/Components/ListResourceMeter.php @@ -0,0 +1,41 @@ + $items + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('items')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Polar\Models\Components\Meter>')] + public array $items; + + /** + * + * @var Pagination $pagination + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('pagination')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\Pagination')] + public Pagination $pagination; + + /** + * @param array $items + * @param Pagination $pagination + * @phpstan-pure + */ + public function __construct(array $items, Pagination $pagination) + { + $this->items = $items; + $this->pagination = $pagination; + } +} \ No newline at end of file diff --git a/src/Models/Components/ListResourceOAuth2Client.php b/src/Models/Components/ListResourceOAuth2Client.php index 93abc8f..4ab5b89 100644 --- a/src/Models/Components/ListResourceOAuth2Client.php +++ b/src/Models/Components/ListResourceOAuth2Client.php @@ -31,6 +31,7 @@ class ListResourceOAuth2Client /** * @param array $items * @param Pagination $pagination + * @phpstan-pure */ public function __construct(array $items, Pagination $pagination) { diff --git a/src/Models/Components/ListResourceOrder.php b/src/Models/Components/ListResourceOrder.php index 083c640..709ce4d 100644 --- a/src/Models/Components/ListResourceOrder.php +++ b/src/Models/Components/ListResourceOrder.php @@ -31,6 +31,7 @@ class ListResourceOrder /** * @param array $items * @param Pagination $pagination + * @phpstan-pure */ public function __construct(array $items, Pagination $pagination) { diff --git a/src/Models/Components/ListResourceOrganization.php b/src/Models/Components/ListResourceOrganization.php index ebc10ad..7760a4a 100644 --- a/src/Models/Components/ListResourceOrganization.php +++ b/src/Models/Components/ListResourceOrganization.php @@ -31,6 +31,7 @@ class ListResourceOrganization /** * @param array $items * @param Pagination $pagination + * @phpstan-pure */ public function __construct(array $items, Pagination $pagination) { diff --git a/src/Models/Components/ListResourceProduct.php b/src/Models/Components/ListResourceProduct.php index e17f78e..36b1698 100644 --- a/src/Models/Components/ListResourceProduct.php +++ b/src/Models/Components/ListResourceProduct.php @@ -31,6 +31,7 @@ class ListResourceProduct /** * @param array $items * @param Pagination $pagination + * @phpstan-pure */ public function __construct(array $items, Pagination $pagination) { diff --git a/src/Models/Components/ListResourceRefund.php b/src/Models/Components/ListResourceRefund.php new file mode 100644 index 0000000..4efaa7b --- /dev/null +++ b/src/Models/Components/ListResourceRefund.php @@ -0,0 +1,41 @@ + $items + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('items')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Polar\Models\Components\Refund>')] + public array $items; + + /** + * + * @var Pagination $pagination + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('pagination')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\Pagination')] + public Pagination $pagination; + + /** + * @param array $items + * @param Pagination $pagination + * @phpstan-pure + */ + public function __construct(array $items, Pagination $pagination) + { + $this->items = $items; + $this->pagination = $pagination; + } +} \ No newline at end of file diff --git a/src/Models/Components/ListResourceRepository.php b/src/Models/Components/ListResourceRepository.php index 84da65a..29914e6 100644 --- a/src/Models/Components/ListResourceRepository.php +++ b/src/Models/Components/ListResourceRepository.php @@ -31,6 +31,7 @@ class ListResourceRepository /** * @param array $items * @param Pagination $pagination + * @phpstan-pure */ public function __construct(array $items, Pagination $pagination) { diff --git a/src/Models/Components/ListResourceSubscription.php b/src/Models/Components/ListResourceSubscription.php index f34ffe9..a586f97 100644 --- a/src/Models/Components/ListResourceSubscription.php +++ b/src/Models/Components/ListResourceSubscription.php @@ -31,6 +31,7 @@ class ListResourceSubscription /** * @param array $items * @param Pagination $pagination + * @phpstan-pure */ public function __construct(array $items, Pagination $pagination) { diff --git a/src/Models/Components/Meter.php b/src/Models/Components/Meter.php new file mode 100644 index 0000000..3d54a7c --- /dev/null +++ b/src/Models/Components/Meter.php @@ -0,0 +1,103 @@ + $metadata + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\Type('array')] + public array $metadata; + + /** + * Creation timestamp of the object. + * + * @var \DateTime $createdAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('created_at')] + public \DateTime $createdAt; + + /** + * The ID of the object. + * + * @var string $id + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('id')] + public string $id; + + /** + * The name of the meter. Will be shown on customer's invoices and usage. + * + * @var string $name + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('name')] + public string $name; + + /** + * + * @var Filter $filter + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('filter')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\Filter')] + public Filter $filter; + + /** + * The aggregation to apply on the filtered events to calculate the meter. + * + * @var CountAggregation|PropertyAggregation $aggregation + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('aggregation')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CountAggregation|\Polar\Models\Components\PropertyAggregation')] + #[\Speakeasy\Serializer\Annotation\UnionDiscriminator(field: 'func', map: ['CountAggregation' => '\Polar\Models\Components\CountAggregation', 'PropertyAggregation' => '\Polar\Models\Components\PropertyAggregation'])] + public CountAggregation|PropertyAggregation $aggregation; + + /** + * The ID of the organization owning the meter. + * + * @var string $organizationId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('organization_id')] + public string $organizationId; + + /** + * Last modification timestamp of the object. + * + * @var ?\DateTime $modifiedAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('modified_at')] + public ?\DateTime $modifiedAt; + + /** + * @param array $metadata + * @param \DateTime $createdAt + * @param string $id + * @param string $name + * @param Filter $filter + * @param CountAggregation|PropertyAggregation $aggregation + * @param string $organizationId + * @param ?\DateTime $modifiedAt + * @phpstan-pure + */ + public function __construct(array $metadata, \DateTime $createdAt, string $id, string $name, Filter $filter, CountAggregation|PropertyAggregation $aggregation, string $organizationId, ?\DateTime $modifiedAt = null) + { + $this->metadata = $metadata; + $this->createdAt = $createdAt; + $this->id = $id; + $this->name = $name; + $this->filter = $filter; + $this->aggregation = $aggregation; + $this->organizationId = $organizationId; + $this->modifiedAt = $modifiedAt; + } +} \ No newline at end of file diff --git a/src/Models/Components/MeterCreate.php b/src/Models/Components/MeterCreate.php new file mode 100644 index 0000000..0cfa326 --- /dev/null +++ b/src/Models/Components/MeterCreate.php @@ -0,0 +1,85 @@ + '\Polar\Models\Components\CountAggregation', 'PropertyAggregation' => '\Polar\Models\Components\PropertyAggregation'])] + public CountAggregation|PropertyAggregation $aggregation; + + /** + * Key-value object allowing you to store additional information. + * + * + * The key must be a string with a maximum length of **40 characters**. + * The value must be either: + * + * * A string with a maximum length of **500 characters** + * * An integer + * * A boolean + * + * You can store up to **50 key-value pairs**. + * + * @var ?array $metadata + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?array $metadata = null; + + /** + * The ID of the organization owning the meter. **Required unless you use an organization token.** + * + * @var ?string $organizationId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('organization_id')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $organizationId = null; + + /** + * @param string $name + * @param Filter $filter + * @param CountAggregation|PropertyAggregation $aggregation + * @param ?array $metadata + * @param ?string $organizationId + * @phpstan-pure + */ + public function __construct(string $name, Filter $filter, CountAggregation|PropertyAggregation $aggregation, ?array $metadata = null, ?string $organizationId = null) + { + $this->name = $name; + $this->filter = $filter; + $this->aggregation = $aggregation; + $this->metadata = $metadata; + $this->organizationId = $organizationId; + } +} \ No newline at end of file diff --git a/src/Models/Components/MeterQuantities.php b/src/Models/Components/MeterQuantities.php new file mode 100644 index 0000000..3b64add --- /dev/null +++ b/src/Models/Components/MeterQuantities.php @@ -0,0 +1,31 @@ + $quantities + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('quantities')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Polar\Models\Components\MeterQuantity>')] + public array $quantities; + + /** + * @param array $quantities + * @phpstan-pure + */ + public function __construct(array $quantities) + { + $this->quantities = $quantities; + } +} \ No newline at end of file diff --git a/src/Models/Components/MeterQuantity.php b/src/Models/Components/MeterQuantity.php new file mode 100644 index 0000000..7dedec7 --- /dev/null +++ b/src/Models/Components/MeterQuantity.php @@ -0,0 +1,40 @@ +timestamp = $timestamp; + $this->quantity = $quantity; + } +} \ No newline at end of file diff --git a/src/Models/Components/MeterSortProperty.php b/src/Models/Components/MeterSortProperty.php new file mode 100644 index 0000000..855cd46 --- /dev/null +++ b/src/Models/Components/MeterSortProperty.php @@ -0,0 +1,18 @@ + $metadata + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?array $metadata = null; + + /** + * The name of the meter. Will be shown on customer's invoices and usage. + * + * @var ?string $name + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('name')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $name = null; + + /** + * The filter to apply on events that'll be used to calculate the meter. + * + * @var ?Filter $filter + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('filter')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\Filter|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?Filter $filter = null; + + /** + * The aggregation to apply on the filtered events to calculate the meter. + * + * @var CountAggregation|PropertyAggregation|null $aggregation + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('aggregation')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CountAggregation|\Polar\Models\Components\PropertyAggregation|null')] + #[\Speakeasy\Serializer\Annotation\UnionDiscriminator(field: 'func', map: ['CountAggregation' => '\Polar\Models\Components\CountAggregation', 'PropertyAggregation' => '\Polar\Models\Components\PropertyAggregation'])] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public CountAggregation|PropertyAggregation|null $aggregation = null; + + /** + * @param ?array $metadata + * @param ?string $name + * @param ?Filter $filter + * @param CountAggregation|PropertyAggregation|null $aggregation + * @phpstan-pure + */ + public function __construct(?array $metadata = null, ?string $name = null, ?Filter $filter = null, CountAggregation|PropertyAggregation|null $aggregation = null) + { + $this->metadata = $metadata; + $this->name = $name; + $this->filter = $filter; + $this->aggregation = $aggregation; + } +} \ No newline at end of file diff --git a/src/Models/Components/Metric.php b/src/Models/Components/Metric.php index 0ca4299..6bab027 100644 --- a/src/Models/Components/Metric.php +++ b/src/Models/Components/Metric.php @@ -40,6 +40,7 @@ class Metric * @param string $slug * @param string $displayName * @param MetricType $type + * @phpstan-pure */ public function __construct(string $slug, string $displayName, MetricType $type) { diff --git a/src/Models/Components/MetricPeriod.php b/src/Models/Components/MetricPeriod.php index e64a5b2..4e15bb3 100644 --- a/src/Models/Components/MetricPeriod.php +++ b/src/Models/Components/MetricPeriod.php @@ -33,6 +33,13 @@ class MetricPeriod #[\Speakeasy\Serializer\Annotation\SerializedName('revenue')] public int $revenue; + /** + * + * @var int $cumulativeRevenue + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('cumulative_revenue')] + public int $cumulativeRevenue; + /** * * @var int $averageOrderValue @@ -100,6 +107,7 @@ class MetricPeriod * @param \DateTime $timestamp * @param int $orders * @param int $revenue + * @param int $cumulativeRevenue * @param int $averageOrderValue * @param int $oneTimeProducts * @param int $oneTimeProductsRevenue @@ -109,12 +117,14 @@ class MetricPeriod * @param int $renewedSubscriptionsRevenue * @param int $activeSubscriptions * @param int $monthlyRecurringRevenue + * @phpstan-pure */ - public function __construct(\DateTime $timestamp, int $orders, int $revenue, int $averageOrderValue, int $oneTimeProducts, int $oneTimeProductsRevenue, int $newSubscriptions, int $newSubscriptionsRevenue, int $renewedSubscriptions, int $renewedSubscriptionsRevenue, int $activeSubscriptions, int $monthlyRecurringRevenue) + public function __construct(\DateTime $timestamp, int $orders, int $revenue, int $cumulativeRevenue, int $averageOrderValue, int $oneTimeProducts, int $oneTimeProductsRevenue, int $newSubscriptions, int $newSubscriptionsRevenue, int $renewedSubscriptions, int $renewedSubscriptionsRevenue, int $activeSubscriptions, int $monthlyRecurringRevenue) { $this->timestamp = $timestamp; $this->orders = $orders; $this->revenue = $revenue; + $this->cumulativeRevenue = $cumulativeRevenue; $this->averageOrderValue = $averageOrderValue; $this->oneTimeProducts = $oneTimeProducts; $this->oneTimeProductsRevenue = $oneTimeProductsRevenue; diff --git a/src/Models/Components/Metrics.php b/src/Models/Components/Metrics.php index fe60458..a2a653f 100644 --- a/src/Models/Components/Metrics.php +++ b/src/Models/Components/Metrics.php @@ -29,6 +29,15 @@ class Metrics #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\Metric')] public Metric $revenue; + /** + * Information about a metric. + * + * @var Metric $cumulativeRevenue + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('cumulative_revenue')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\Metric')] + public Metric $cumulativeRevenue; + /** * Information about a metric. * @@ -113,6 +122,7 @@ class Metrics /** * @param Metric $orders * @param Metric $revenue + * @param Metric $cumulativeRevenue * @param Metric $averageOrderValue * @param Metric $oneTimeProducts * @param Metric $oneTimeProductsRevenue @@ -122,11 +132,13 @@ class Metrics * @param Metric $renewedSubscriptionsRevenue * @param Metric $activeSubscriptions * @param Metric $monthlyRecurringRevenue + * @phpstan-pure */ - public function __construct(Metric $orders, Metric $revenue, Metric $averageOrderValue, Metric $oneTimeProducts, Metric $oneTimeProductsRevenue, Metric $newSubscriptions, Metric $newSubscriptionsRevenue, Metric $renewedSubscriptions, Metric $renewedSubscriptionsRevenue, Metric $activeSubscriptions, Metric $monthlyRecurringRevenue) + public function __construct(Metric $orders, Metric $revenue, Metric $cumulativeRevenue, Metric $averageOrderValue, Metric $oneTimeProducts, Metric $oneTimeProductsRevenue, Metric $newSubscriptions, Metric $newSubscriptionsRevenue, Metric $renewedSubscriptions, Metric $renewedSubscriptionsRevenue, Metric $activeSubscriptions, Metric $monthlyRecurringRevenue) { $this->orders = $orders; $this->revenue = $revenue; + $this->cumulativeRevenue = $cumulativeRevenue; $this->averageOrderValue = $averageOrderValue; $this->oneTimeProducts = $oneTimeProducts; $this->oneTimeProductsRevenue = $oneTimeProductsRevenue; diff --git a/src/Models/Components/MetricsIntervalLimit.php b/src/Models/Components/MetricsIntervalLimit.php index 6bbbb72..fc023be 100644 --- a/src/Models/Components/MetricsIntervalLimit.php +++ b/src/Models/Components/MetricsIntervalLimit.php @@ -22,6 +22,7 @@ class MetricsIntervalLimit /** * @param int $maxDays + * @phpstan-pure */ public function __construct(int $maxDays) { diff --git a/src/Models/Components/MetricsIntervalsLimits.php b/src/Models/Components/MetricsIntervalsLimits.php index 498b44c..e6fa3ce 100644 --- a/src/Models/Components/MetricsIntervalsLimits.php +++ b/src/Models/Components/MetricsIntervalsLimits.php @@ -63,6 +63,7 @@ class MetricsIntervalsLimits * @param MetricsIntervalLimit $week * @param MetricsIntervalLimit $month * @param MetricsIntervalLimit $year + * @phpstan-pure */ public function __construct(MetricsIntervalLimit $hour, MetricsIntervalLimit $day, MetricsIntervalLimit $week, MetricsIntervalLimit $month, MetricsIntervalLimit $year) { diff --git a/src/Models/Components/MetricsLimits.php b/src/Models/Components/MetricsLimits.php index 114d8a9..25b37bb 100644 --- a/src/Models/Components/MetricsLimits.php +++ b/src/Models/Components/MetricsLimits.php @@ -32,6 +32,7 @@ class MetricsLimits /** * @param LocalDate $minDate * @param MetricsIntervalsLimits $intervals + * @phpstan-pure */ public function __construct(LocalDate $minDate, MetricsIntervalsLimits $intervals) { diff --git a/src/Models/Components/MetricsResponse.php b/src/Models/Components/MetricsResponse.php index 50d190d..1891cc0 100644 --- a/src/Models/Components/MetricsResponse.php +++ b/src/Models/Components/MetricsResponse.php @@ -32,6 +32,7 @@ class MetricsResponse /** * @param array $periods * @param Metrics $metrics + * @phpstan-pure */ public function __construct(array $periods, Metrics $metrics) { diff --git a/src/Models/Components/OAuth2Client.php b/src/Models/Components/OAuth2Client.php index f12303f..f9d008e 100644 --- a/src/Models/Components/OAuth2Client.php +++ b/src/Models/Components/OAuth2Client.php @@ -76,10 +76,10 @@ class OAuth2Client /** * $responseTypes * - * @var ?array $responseTypes + * @var ?array $responseTypes */ #[\Speakeasy\Serializer\Annotation\SerializedName('response_types')] - #[\Speakeasy\Serializer\Annotation\Type('array<\Polar\Models\Components\ResponseTypes>|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $responseTypes = null; @@ -150,15 +150,16 @@ class OAuth2Client * @param int $clientSecretExpiresAt * @param ?TokenEndpointAuthMethod $tokenEndpointAuthMethod * @param ?array $grantTypes - * @param ?array $responseTypes + * @param ?array $responseTypes * @param ?string $scope * @param ?\DateTime $modifiedAt * @param ?string $clientUri * @param ?string $logoUri * @param ?string $tosUri * @param ?string $policyUri + * @phpstan-pure */ - public function __construct(array $redirectUris, string $clientName, \DateTime $createdAt, string $clientId, string $clientSecret, int $clientIdIssuedAt, int $clientSecretExpiresAt, ?array $grantTypes = null, ?array $responseTypes = null, ?\DateTime $modifiedAt = null, ?string $clientUri = null, ?string $logoUri = null, ?string $tosUri = null, ?string $policyUri = null, ?TokenEndpointAuthMethod $tokenEndpointAuthMethod = TokenEndpointAuthMethod::ClientSecretPost, ?string $scope = 'openid profile email user:read organizations:read organizations:write custom_fields:read custom_fields:write discounts:read discounts:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write customer_sessions:write orders:read metrics:read webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write customer_portal:read customer_portal:write') + public function __construct(array $redirectUris, string $clientName, \DateTime $createdAt, string $clientId, string $clientSecret, int $clientIdIssuedAt, int $clientSecretExpiresAt, ?array $grantTypes = null, ?array $responseTypes = null, ?\DateTime $modifiedAt = null, ?string $clientUri = null, ?string $logoUri = null, ?string $tosUri = null, ?string $policyUri = null, ?TokenEndpointAuthMethod $tokenEndpointAuthMethod = TokenEndpointAuthMethod::ClientSecretPost, ?string $scope = 'openid profile email user:read organizations:read organizations:write custom_fields:read custom_fields:write discounts:read discounts:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write events:read events:write meters:read meters:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write customer_sessions:write orders:read refunds:read refunds:write metrics:read webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write customer_portal:read customer_portal:write') { $this->redirectUris = $redirectUris; $this->clientName = $clientName; diff --git a/src/Models/Components/OAuth2ClientConfiguration.php b/src/Models/Components/OAuth2ClientConfiguration.php index a79de7d..40d32fa 100644 --- a/src/Models/Components/OAuth2ClientConfiguration.php +++ b/src/Models/Components/OAuth2ClientConfiguration.php @@ -40,10 +40,10 @@ class OAuth2ClientConfiguration /** * $responseTypes * - * @var ?array $responseTypes + * @var ?array $responseTypes */ #[\Speakeasy\Serializer\Annotation\SerializedName('response_types')] - #[\Speakeasy\Serializer\Annotation\Type('array<\Polar\Models\Components\OAuth2ClientConfigurationResponseTypes>|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $responseTypes = null; @@ -101,14 +101,15 @@ class OAuth2ClientConfiguration * @param string $clientName * @param ?OAuth2ClientConfigurationTokenEndpointAuthMethod $tokenEndpointAuthMethod * @param ?array $grantTypes - * @param ?array $responseTypes + * @param ?array $responseTypes * @param ?string $scope * @param ?string $clientUri * @param ?string $logoUri * @param ?string $tosUri * @param ?string $policyUri + * @phpstan-pure */ - public function __construct(array $redirectUris, string $clientName, ?array $grantTypes = null, ?array $responseTypes = null, ?string $clientUri = null, ?string $logoUri = null, ?string $tosUri = null, ?string $policyUri = null, ?OAuth2ClientConfigurationTokenEndpointAuthMethod $tokenEndpointAuthMethod = OAuth2ClientConfigurationTokenEndpointAuthMethod::ClientSecretPost, ?string $scope = 'openid profile email user:read organizations:read organizations:write custom_fields:read custom_fields:write discounts:read discounts:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write customer_sessions:write orders:read metrics:read webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write customer_portal:read customer_portal:write') + public function __construct(array $redirectUris, string $clientName, ?array $grantTypes = null, ?array $responseTypes = null, ?string $clientUri = null, ?string $logoUri = null, ?string $tosUri = null, ?string $policyUri = null, ?OAuth2ClientConfigurationTokenEndpointAuthMethod $tokenEndpointAuthMethod = OAuth2ClientConfigurationTokenEndpointAuthMethod::ClientSecretPost, ?string $scope = 'openid profile email user:read organizations:read organizations:write custom_fields:read custom_fields:write discounts:read discounts:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write events:read events:write meters:read meters:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write customer_sessions:write orders:read refunds:read refunds:write metrics:read webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write customer_portal:read customer_portal:write') { $this->redirectUris = $redirectUris; $this->clientName = $clientName; diff --git a/src/Models/Components/OAuth2ClientConfigurationResponseTypes.php b/src/Models/Components/OAuth2ClientConfigurationResponseTypes.php deleted file mode 100644 index fd1d8c5..0000000 --- a/src/Models/Components/OAuth2ClientConfigurationResponseTypes.php +++ /dev/null @@ -1,15 +0,0 @@ - $responseTypes + * @var ?array $responseTypes */ #[\Speakeasy\Serializer\Annotation\SerializedName('response_types')] - #[\Speakeasy\Serializer\Annotation\Type('array<\Polar\Models\Components\OAuth2ClientConfigurationUpdateResponseTypes>|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $responseTypes = null; @@ -109,14 +109,15 @@ class OAuth2ClientConfigurationUpdate * @param string $clientId * @param ?OAuth2ClientConfigurationUpdateTokenEndpointAuthMethod $tokenEndpointAuthMethod * @param ?array $grantTypes - * @param ?array $responseTypes + * @param ?array $responseTypes * @param ?string $scope * @param ?string $clientUri * @param ?string $logoUri * @param ?string $tosUri * @param ?string $policyUri + * @phpstan-pure */ - public function __construct(array $redirectUris, string $clientName, string $clientId, ?array $grantTypes = null, ?array $responseTypes = null, ?string $clientUri = null, ?string $logoUri = null, ?string $tosUri = null, ?string $policyUri = null, ?OAuth2ClientConfigurationUpdateTokenEndpointAuthMethod $tokenEndpointAuthMethod = OAuth2ClientConfigurationUpdateTokenEndpointAuthMethod::ClientSecretPost, ?string $scope = 'openid profile email user:read organizations:read organizations:write custom_fields:read custom_fields:write discounts:read discounts:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write customer_sessions:write orders:read metrics:read webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write customer_portal:read customer_portal:write') + public function __construct(array $redirectUris, string $clientName, string $clientId, ?array $grantTypes = null, ?array $responseTypes = null, ?string $clientUri = null, ?string $logoUri = null, ?string $tosUri = null, ?string $policyUri = null, ?OAuth2ClientConfigurationUpdateTokenEndpointAuthMethod $tokenEndpointAuthMethod = OAuth2ClientConfigurationUpdateTokenEndpointAuthMethod::ClientSecretPost, ?string $scope = 'openid profile email user:read organizations:read organizations:write custom_fields:read custom_fields:write discounts:read discounts:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write events:read events:write meters:read meters:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write customer_sessions:write orders:read refunds:read refunds:write metrics:read webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write customer_portal:read customer_portal:write') { $this->redirectUris = $redirectUris; $this->clientName = $clientName; diff --git a/src/Models/Components/OAuth2ClientConfigurationUpdateResponseTypes.php b/src/Models/Components/OAuth2ClientConfigurationUpdateResponseTypes.php deleted file mode 100644 index 572988d..0000000 --- a/src/Models/Components/OAuth2ClientConfigurationUpdateResponseTypes.php +++ /dev/null @@ -1,15 +0,0 @@ -clientId = $clientId; $this->clientSecret = $clientSecret; diff --git a/src/Models/Components/Onev11oauth21tokenPostXComponentsRefreshTokenRequest.php b/src/Models/Components/Onev11oauth21tokenPostXComponentsRefreshTokenRequest.php index 4078c56..7dd9679 100644 --- a/src/Models/Components/Onev11oauth21tokenPostXComponentsRefreshTokenRequest.php +++ b/src/Models/Components/Onev11oauth21tokenPostXComponentsRefreshTokenRequest.php @@ -34,18 +34,19 @@ class Onev11oauth21tokenPostXComponentsRefreshTokenRequest /** * - * @var Onev11oauth21tokenPostXComponentsRefreshTokenRequestGrantType $grantType + * @var string $grantType */ #[SpeakeasyMetadata('form:name=grant_type')] - public Onev11oauth21tokenPostXComponentsRefreshTokenRequestGrantType $grantType; + public string $grantType; /** - * @param Onev11oauth21tokenPostXComponentsRefreshTokenRequestGrantType $grantType + * @param string $grantType * @param string $clientId * @param string $clientSecret * @param string $refreshToken + * @phpstan-pure */ - public function __construct(string $clientId, string $clientSecret, string $refreshToken, Onev11oauth21tokenPostXComponentsRefreshTokenRequestGrantType $grantType = Onev11oauth21tokenPostXComponentsRefreshTokenRequestGrantType::RefreshToken) + public function __construct(string $clientId, string $clientSecret, string $refreshToken, string $grantType = 'refresh_token') { $this->clientId = $clientId; $this->clientSecret = $clientSecret; diff --git a/src/Models/Components/Onev11oauth21tokenPostXComponentsRefreshTokenRequestGrantType.php b/src/Models/Components/Onev11oauth21tokenPostXComponentsRefreshTokenRequestGrantType.php deleted file mode 100644 index 57a99f1..0000000 --- a/src/Models/Components/Onev11oauth21tokenPostXComponentsRefreshTokenRequestGrantType.php +++ /dev/null @@ -1,15 +0,0 @@ - $metadata + * @var array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $metadata; + /** + * + * @var string $status + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('status')] + public string $status; + /** * * @var int $amount @@ -50,6 +57,22 @@ class Order #[\Speakeasy\Serializer\Annotation\SerializedName('tax_amount')] public int $taxAmount; + /** + * Amount refunded + * + * @var int $refundedAmount + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('refunded_amount')] + public int $refundedAmount; + + /** + * Sales tax refunded + * + * @var int $refundedTaxAmount + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('refunded_tax_amount')] + public int $refundedTaxAmount; + /** * * @var string $currency @@ -137,12 +160,12 @@ class Order /** * Key-value object storing custom field values. * - * @var ?OrderCustomFieldData $customFieldData + * @var ?array $customFieldData */ #[\Speakeasy\Serializer\Annotation\SerializedName('custom_field_data')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\OrderCustomFieldData|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?OrderCustomFieldData $customFieldData = null; + public ?array $customFieldData = null; /** * @@ -178,7 +201,7 @@ class Order * @var DiscountFixedOnceForeverDurationBase|DiscountFixedRepeatDurationBase|DiscountPercentageOnceForeverDurationBase|DiscountPercentageRepeatDurationBase|null $discount */ #[\Speakeasy\Serializer\Annotation\SerializedName('discount')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\DiscountFixedOnceForeverDurationBase|\Polar\Models\Components\DiscountFixedRepeatDurationBase|\Polar\Models\Components\DiscountPercentageOnceForeverDurationBase|\Polar\Models\Components\DiscountPercentageRepeatDurationBase')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\DiscountFixedOnceForeverDurationBase|\Polar\Models\Components\DiscountFixedRepeatDurationBase|\Polar\Models\Components\DiscountPercentageOnceForeverDurationBase|\Polar\Models\Components\DiscountPercentageRepeatDurationBase|null')] public DiscountFixedOnceForeverDurationBase|DiscountFixedRepeatDurationBase|DiscountPercentageOnceForeverDurationBase|DiscountPercentageRepeatDurationBase|null $discount; /** @@ -192,9 +215,12 @@ class Order /** * @param \DateTime $createdAt * @param string $id - * @param array $metadata + * @param array $metadata + * @param string $status * @param int $amount * @param int $taxAmount + * @param int $refundedAmount + * @param int $refundedTaxAmount * @param string $currency * @param OrderBillingReason $billingReason * @param string $customerId @@ -206,21 +232,25 @@ class Order * @param OrderProduct $product * @param ProductPriceRecurringFixed|ProductPriceRecurringCustom|ProductPriceRecurringFree|ProductPriceOneTimeFixed|ProductPriceOneTimeCustom|ProductPriceOneTimeFree $productPrice * @param ?\DateTime $modifiedAt - * @param ?OrderCustomFieldData $customFieldData + * @param ?array $customFieldData * @param ?Address $billingAddress * @param ?string $discountId * @param ?string $subscriptionId * @param ?string $checkoutId * @param DiscountFixedOnceForeverDurationBase|DiscountFixedRepeatDurationBase|DiscountPercentageOnceForeverDurationBase|DiscountPercentageRepeatDurationBase|null $discount * @param ?OrderSubscription $subscription + * @phpstan-pure */ - public function __construct(\DateTime $createdAt, string $id, array $metadata, int $amount, int $taxAmount, string $currency, OrderBillingReason $billingReason, string $customerId, string $productId, string $productPriceId, OrderCustomer $customer, string $userId, OrderUser $user, OrderProduct $product, ProductPriceRecurringFixed|ProductPriceRecurringCustom|ProductPriceRecurringFree|ProductPriceOneTimeFixed|ProductPriceOneTimeCustom|ProductPriceOneTimeFree $productPrice, ?\DateTime $modifiedAt = null, ?OrderCustomFieldData $customFieldData = null, ?Address $billingAddress = null, ?string $discountId = null, ?string $subscriptionId = null, ?string $checkoutId = null, DiscountFixedOnceForeverDurationBase|DiscountFixedRepeatDurationBase|DiscountPercentageOnceForeverDurationBase|DiscountPercentageRepeatDurationBase|null $discount = null, ?OrderSubscription $subscription = null) + public function __construct(\DateTime $createdAt, string $id, array $metadata, string $status, int $amount, int $taxAmount, int $refundedAmount, int $refundedTaxAmount, string $currency, OrderBillingReason $billingReason, string $customerId, string $productId, string $productPriceId, OrderCustomer $customer, string $userId, OrderUser $user, OrderProduct $product, ProductPriceRecurringFixed|ProductPriceRecurringCustom|ProductPriceRecurringFree|ProductPriceOneTimeFixed|ProductPriceOneTimeCustom|ProductPriceOneTimeFree $productPrice, ?\DateTime $modifiedAt = null, ?array $customFieldData = null, ?Address $billingAddress = null, ?string $discountId = null, ?string $subscriptionId = null, ?string $checkoutId = null, DiscountFixedOnceForeverDurationBase|DiscountFixedRepeatDurationBase|DiscountPercentageOnceForeverDurationBase|DiscountPercentageRepeatDurationBase|null $discount = null, ?OrderSubscription $subscription = null) { $this->createdAt = $createdAt; $this->id = $id; $this->metadata = $metadata; + $this->status = $status; $this->amount = $amount; $this->taxAmount = $taxAmount; + $this->refundedAmount = $refundedAmount; + $this->refundedTaxAmount = $refundedTaxAmount; $this->currency = $currency; $this->billingReason = $billingReason; $this->customerId = $customerId; diff --git a/src/Models/Components/OrderCustomFieldData.php b/src/Models/Components/OrderCustomFieldData.php deleted file mode 100644 index 5aad6e5..0000000 --- a/src/Models/Components/OrderCustomFieldData.php +++ /dev/null @@ -1,19 +0,0 @@ - $metadata + * @var array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $metadata; /** @@ -90,16 +90,16 @@ class OrderCustomer /** * $taxId * - * @var ?array $taxId + * @var ?array $taxId */ #[\Speakeasy\Serializer\Annotation\SerializedName('tax_id')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] public ?array $taxId; /** * @param \DateTime $createdAt * @param string $id - * @param array $metadata + * @param array $metadata * @param string $email * @param bool $emailVerified * @param string $organizationId @@ -107,7 +107,8 @@ class OrderCustomer * @param ?\DateTime $modifiedAt * @param ?string $name * @param ?Address $billingAddress - * @param ?array $taxId + * @param ?array $taxId + * @phpstan-pure */ public function __construct(\DateTime $createdAt, string $id, array $metadata, string $email, bool $emailVerified, string $organizationId, string $avatarUrl, ?\DateTime $modifiedAt = null, ?string $name = null, ?Address $billingAddress = null, ?array $taxId = null) { diff --git a/src/Models/Components/OrderInvoice.php b/src/Models/Components/OrderInvoice.php index f7a83c1..d7c49c0 100644 --- a/src/Models/Components/OrderInvoice.php +++ b/src/Models/Components/OrderInvoice.php @@ -22,6 +22,7 @@ class OrderInvoice /** * @param string $url + * @phpstan-pure */ public function __construct(string $url) { diff --git a/src/Models/Components/OrderProduct.php b/src/Models/Components/OrderProduct.php index b166fea..03a428e 100644 --- a/src/Models/Components/OrderProduct.php +++ b/src/Models/Components/OrderProduct.php @@ -84,6 +84,7 @@ class OrderProduct * @param string $organizationId * @param ?\DateTime $modifiedAt * @param ?string $description + * @phpstan-pure */ public function __construct(\DateTime $createdAt, string $id, string $name, bool $isRecurring, bool $isArchived, string $organizationId, ?\DateTime $modifiedAt = null, ?string $description = null) { diff --git a/src/Models/Components/OrderSubscription.php b/src/Models/Components/OrderSubscription.php index 557c8a3..e204ab7 100644 --- a/src/Models/Components/OrderSubscription.php +++ b/src/Models/Components/OrderSubscription.php @@ -14,10 +14,10 @@ class OrderSubscription /** * $metadata * - * @var array $metadata + * @var array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $metadata; /** @@ -124,6 +124,13 @@ class OrderSubscription #[\Speakeasy\Serializer\Annotation\SerializedName('current_period_end')] public ?\DateTime $currentPeriodEnd; + /** + * + * @var ?\DateTime $canceledAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('canceled_at')] + public ?\DateTime $canceledAt; + /** * * @var ?\DateTime $startedAt @@ -131,6 +138,13 @@ class OrderSubscription #[\Speakeasy\Serializer\Annotation\SerializedName('started_at')] public ?\DateTime $startedAt; + /** + * + * @var ?\DateTime $endsAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('ends_at')] + public ?\DateTime $endsAt; + /** * * @var ?\DateTime $endedAt @@ -153,7 +167,22 @@ class OrderSubscription public ?string $checkoutId; /** - * @param array $metadata + * + * @var ?CustomerCancellationReason $customerCancellationReason + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('customer_cancellation_reason')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomerCancellationReason|null')] + public ?CustomerCancellationReason $customerCancellationReason; + + /** + * + * @var ?string $customerCancellationComment + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('customer_cancellation_comment')] + public ?string $customerCancellationComment; + + /** + * @param array $metadata * @param \DateTime $createdAt * @param string $id * @param SubscriptionRecurringInterval $recurringInterval @@ -168,12 +197,17 @@ class OrderSubscription * @param ?int $amount * @param ?string $currency * @param ?\DateTime $currentPeriodEnd + * @param ?\DateTime $canceledAt * @param ?\DateTime $startedAt + * @param ?\DateTime $endsAt * @param ?\DateTime $endedAt * @param ?string $discountId * @param ?string $checkoutId + * @param ?CustomerCancellationReason $customerCancellationReason + * @param ?string $customerCancellationComment + * @phpstan-pure */ - public function __construct(array $metadata, \DateTime $createdAt, string $id, SubscriptionRecurringInterval $recurringInterval, SubscriptionStatus $status, \DateTime $currentPeriodStart, bool $cancelAtPeriodEnd, string $customerId, string $productId, string $priceId, string $userId, ?\DateTime $modifiedAt = null, ?int $amount = null, ?string $currency = null, ?\DateTime $currentPeriodEnd = null, ?\DateTime $startedAt = null, ?\DateTime $endedAt = null, ?string $discountId = null, ?string $checkoutId = null) + public function __construct(array $metadata, \DateTime $createdAt, string $id, SubscriptionRecurringInterval $recurringInterval, SubscriptionStatus $status, \DateTime $currentPeriodStart, bool $cancelAtPeriodEnd, string $customerId, string $productId, string $priceId, string $userId, ?\DateTime $modifiedAt = null, ?int $amount = null, ?string $currency = null, ?\DateTime $currentPeriodEnd = null, ?\DateTime $canceledAt = null, ?\DateTime $startedAt = null, ?\DateTime $endsAt = null, ?\DateTime $endedAt = null, ?string $discountId = null, ?string $checkoutId = null, ?CustomerCancellationReason $customerCancellationReason = null, ?string $customerCancellationComment = null) { $this->metadata = $metadata; $this->createdAt = $createdAt; @@ -190,9 +224,13 @@ public function __construct(array $metadata, \DateTime $createdAt, string $id, S $this->amount = $amount; $this->currency = $currency; $this->currentPeriodEnd = $currentPeriodEnd; + $this->canceledAt = $canceledAt; $this->startedAt = $startedAt; + $this->endsAt = $endsAt; $this->endedAt = $endedAt; $this->discountId = $discountId; $this->checkoutId = $checkoutId; + $this->customerCancellationReason = $customerCancellationReason; + $this->customerCancellationComment = $customerCancellationComment; } } \ No newline at end of file diff --git a/src/Models/Components/OrderUser.php b/src/Models/Components/OrderUser.php index 8de627d..f420494 100644 --- a/src/Models/Components/OrderUser.php +++ b/src/Models/Components/OrderUser.php @@ -54,6 +54,7 @@ class OrderUser * @param string $publicName * @param ?string $avatarUrl * @param ?string $githubUsername + * @phpstan-pure */ public function __construct(string $id, string $email, string $publicName, ?string $avatarUrl = null, ?string $githubUsername = null) { diff --git a/src/Models/Components/Organization.php b/src/Models/Components/Organization.php index 7c06979..88f4760 100644 --- a/src/Models/Components/Organization.php +++ b/src/Models/Components/Organization.php @@ -55,6 +55,14 @@ class Organization #[\Speakeasy\Serializer\Annotation\SerializedName('pledge_badge_show_amount')] public bool $pledgeBadgeShowAmount; + /** + * + * @var OrganizationSubscriptionSettings $subscriptionSettings + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('subscription_settings')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\OrganizationSubscriptionSettings')] + public OrganizationSubscriptionSettings $subscriptionSettings; + /** * Last modification timestamp of the object. * @@ -144,6 +152,7 @@ class Organization * @param string $slug * @param int $pledgeMinimumAmount * @param bool $pledgeBadgeShowAmount + * @param OrganizationSubscriptionSettings $subscriptionSettings * @param ?\DateTime $modifiedAt * @param ?string $avatarUrl * @param ?string $bio @@ -155,8 +164,9 @@ class Organization * @param ?int $defaultUpfrontSplitToContributors * @param ?OrganizationProfileSettings $profileSettings * @param ?OrganizationFeatureSettings $featureSettings + * @phpstan-pure */ - public function __construct(\DateTime $createdAt, string $id, string $name, string $slug, int $pledgeMinimumAmount, bool $pledgeBadgeShowAmount, ?\DateTime $modifiedAt = null, ?string $avatarUrl = null, ?string $bio = null, ?string $company = null, ?string $blog = null, ?string $location = null, ?string $email = null, ?string $twitterUsername = null, ?int $defaultUpfrontSplitToContributors = null, ?OrganizationProfileSettings $profileSettings = null, ?OrganizationFeatureSettings $featureSettings = null) + public function __construct(\DateTime $createdAt, string $id, string $name, string $slug, int $pledgeMinimumAmount, bool $pledgeBadgeShowAmount, OrganizationSubscriptionSettings $subscriptionSettings, ?\DateTime $modifiedAt = null, ?string $avatarUrl = null, ?string $bio = null, ?string $company = null, ?string $blog = null, ?string $location = null, ?string $email = null, ?string $twitterUsername = null, ?int $defaultUpfrontSplitToContributors = null, ?OrganizationProfileSettings $profileSettings = null, ?OrganizationFeatureSettings $featureSettings = null) { $this->createdAt = $createdAt; $this->id = $id; @@ -164,6 +174,7 @@ public function __construct(\DateTime $createdAt, string $id, string $name, stri $this->slug = $slug; $this->pledgeMinimumAmount = $pledgeMinimumAmount; $this->pledgeBadgeShowAmount = $pledgeBadgeShowAmount; + $this->subscriptionSettings = $subscriptionSettings; $this->modifiedAt = $modifiedAt; $this->avatarUrl = $avatarUrl; $this->bio = $bio; diff --git a/src/Models/Components/OrganizationAvatarFileCreate.php b/src/Models/Components/OrganizationAvatarFileCreate.php index db0cbc3..87f90ef 100644 --- a/src/Models/Components/OrganizationAvatarFileCreate.php +++ b/src/Models/Components/OrganizationAvatarFileCreate.php @@ -69,23 +69,23 @@ class OrganizationAvatarFileCreate /** * - * @var OrganizationAvatarFileCreateService $service + * @var string $service */ #[\Speakeasy\Serializer\Annotation\SerializedName('service')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\OrganizationAvatarFileCreateService')] - public OrganizationAvatarFileCreateService $service; + public string $service; /** * @param string $name * @param string $mimeType * @param int $size * @param S3FileCreateMultipart $upload - * @param OrganizationAvatarFileCreateService $service + * @param string $service * @param ?string $organizationId * @param ?string $checksumSha256Base64 * @param ?string $version + * @phpstan-pure */ - public function __construct(string $name, string $mimeType, int $size, S3FileCreateMultipart $upload, ?string $organizationId = null, ?string $checksumSha256Base64 = null, ?string $version = null, OrganizationAvatarFileCreateService $service = OrganizationAvatarFileCreateService::OrganizationAvatar) + public function __construct(string $name, string $mimeType, int $size, S3FileCreateMultipart $upload, ?string $organizationId = null, ?string $checksumSha256Base64 = null, ?string $version = null, string $service = 'organization_avatar') { $this->name = $name; $this->mimeType = $mimeType; diff --git a/src/Models/Components/OrganizationAvatarFileCreateService.php b/src/Models/Components/OrganizationAvatarFileCreateService.php deleted file mode 100644 index 9d3bd06..0000000 --- a/src/Models/Components/OrganizationAvatarFileCreateService.php +++ /dev/null @@ -1,15 +0,0 @@ -id = $id; $this->organizationId = $organizationId; diff --git a/src/Models/Components/OrganizationAvatarFileReadService.php b/src/Models/Components/OrganizationAvatarFileReadService.php deleted file mode 100644 index 616736f..0000000 --- a/src/Models/Components/OrganizationAvatarFileReadService.php +++ /dev/null @@ -1,15 +0,0 @@ -name = $name; $this->slug = $slug; $this->avatarUrl = $avatarUrl; $this->featureSettings = $featureSettings; + $this->subscriptionSettings = $subscriptionSettings; } } \ No newline at end of file diff --git a/src/Models/Components/OrganizationFeatureSettings.php b/src/Models/Components/OrganizationFeatureSettings.php index 68563d3..21fadd1 100644 --- a/src/Models/Components/OrganizationFeatureSettings.php +++ b/src/Models/Components/OrganizationFeatureSettings.php @@ -22,6 +22,7 @@ class OrganizationFeatureSettings /** * @param ?bool $issueFundingEnabled + * @phpstan-pure */ public function __construct(?bool $issueFundingEnabled = false) { diff --git a/src/Models/Components/OrganizationProfileSettings.php b/src/Models/Components/OrganizationProfileSettings.php index e4b1530..91cf8cd 100644 --- a/src/Models/Components/OrganizationProfileSettings.php +++ b/src/Models/Components/OrganizationProfileSettings.php @@ -86,6 +86,7 @@ class OrganizationProfileSettings * @param ?array $links * @param ?OrganizationSubscribePromoteSettings $subscribe * @param ?string $accentColor + * @phpstan-pure */ public function __construct(?bool $enabled = null, ?string $description = null, ?array $featuredProjects = null, ?array $featuredOrganizations = null, ?array $links = null, ?OrganizationSubscribePromoteSettings $subscribe = null, ?string $accentColor = null) { diff --git a/src/Models/Components/OrganizationSubscribePromoteSettings.php b/src/Models/Components/OrganizationSubscribePromoteSettings.php index 98d9911..e388070 100644 --- a/src/Models/Components/OrganizationSubscribePromoteSettings.php +++ b/src/Models/Components/OrganizationSubscribePromoteSettings.php @@ -42,6 +42,7 @@ class OrganizationSubscribePromoteSettings * @param ?bool $promote * @param ?bool $showCount * @param ?bool $countFree + * @phpstan-pure */ public function __construct(?bool $promote = true, ?bool $showCount = true, ?bool $countFree = true) { diff --git a/src/Models/Components/OrganizationSubscriptionSettings.php b/src/Models/Components/OrganizationSubscriptionSettings.php new file mode 100644 index 0000000..f81ee0f --- /dev/null +++ b/src/Models/Components/OrganizationSubscriptionSettings.php @@ -0,0 +1,48 @@ +allowMultipleSubscriptions = $allowMultipleSubscriptions; + $this->allowCustomerUpdates = $allowCustomerUpdates; + $this->prorationBehavior = $prorationBehavior; + } +} \ No newline at end of file diff --git a/src/Models/Components/OrganizationUpdate.php b/src/Models/Components/OrganizationUpdate.php index 3ce934b..efae78e 100644 --- a/src/Models/Components/OrganizationUpdate.php +++ b/src/Models/Components/OrganizationUpdate.php @@ -85,6 +85,15 @@ class OrganizationUpdate #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?OrganizationFeatureSettings $featureSettings = null; + /** + * + * @var ?OrganizationSubscriptionSettings $subscriptionSettings + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('subscription_settings')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\OrganizationSubscriptionSettings|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?OrganizationSubscriptionSettings $subscriptionSettings = null; + /** * * @var ?bool $pledgeBadgeShowAmount @@ -113,8 +122,10 @@ class OrganizationUpdate * @param ?int $perUserMonthlySpendingLimit * @param ?OrganizationProfileSettings $profileSettings * @param ?OrganizationFeatureSettings $featureSettings + * @param ?OrganizationSubscriptionSettings $subscriptionSettings + * @phpstan-pure */ - public function __construct(?string $name = null, ?string $avatarUrl = null, ?int $defaultUpfrontSplitToContributors = null, ?string $billingEmail = null, ?string $defaultBadgeCustomContent = null, ?int $totalMonthlySpendingLimit = null, ?int $perUserMonthlySpendingLimit = null, ?OrganizationProfileSettings $profileSettings = null, ?OrganizationFeatureSettings $featureSettings = null, ?bool $pledgeBadgeShowAmount = false, ?int $pledgeMinimumAmount = 2000) + public function __construct(?string $name = null, ?string $avatarUrl = null, ?int $defaultUpfrontSplitToContributors = null, ?string $billingEmail = null, ?string $defaultBadgeCustomContent = null, ?int $totalMonthlySpendingLimit = null, ?int $perUserMonthlySpendingLimit = null, ?OrganizationProfileSettings $profileSettings = null, ?OrganizationFeatureSettings $featureSettings = null, ?OrganizationSubscriptionSettings $subscriptionSettings = null, ?bool $pledgeBadgeShowAmount = false, ?int $pledgeMinimumAmount = 2000) { $this->name = $name; $this->avatarUrl = $avatarUrl; @@ -125,6 +136,7 @@ public function __construct(?string $name = null, ?string $avatarUrl = null, ?in $this->perUserMonthlySpendingLimit = $perUserMonthlySpendingLimit; $this->profileSettings = $profileSettings; $this->featureSettings = $featureSettings; + $this->subscriptionSettings = $subscriptionSettings; $this->pledgeBadgeShowAmount = $pledgeBadgeShowAmount; $this->pledgeMinimumAmount = $pledgeMinimumAmount; } diff --git a/src/Models/Components/Pagination.php b/src/Models/Components/Pagination.php index 2b80001..ee9b596 100644 --- a/src/Models/Components/Pagination.php +++ b/src/Models/Components/Pagination.php @@ -28,6 +28,7 @@ class Pagination /** * @param int $totalCount * @param int $maxPage + * @phpstan-pure */ public function __construct(int $totalCount, int $maxPage) { diff --git a/src/Models/Components/PaymentProcessorMetadata.php b/src/Models/Components/PaymentProcessorMetadata.php deleted file mode 100644 index 667df23..0000000 --- a/src/Models/Components/PaymentProcessorMetadata.php +++ /dev/null @@ -1,18 +0,0 @@ - $metadata + * @var array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $metadata; /** * List of prices for this product. * - * @var array $prices + * @var array $prices */ #[\Speakeasy\Serializer\Annotation\SerializedName('prices')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Polar\Models\Components\ProductPriceRecurringFixed|\Polar\Models\Components\ProductPriceRecurringCustom|\Polar\Models\Components\ProductPriceRecurringFree|\Polar\Models\Components\ProductPriceOneTimeFixed|\Polar\Models\Components\ProductPriceOneTimeCustom|\Polar\Models\Components\ProductPriceOneTimeFree>')] public array $prices; /** * List of benefits granted by the product. * - * @var array $benefits + * @var array $benefits */ #[\Speakeasy\Serializer\Annotation\SerializedName('benefits')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Polar\Models\Components\BenefitAds|\Polar\Models\Components\BenefitCustom|\Polar\Models\Components\BenefitDiscord|\Polar\Models\Components\BenefitGitHubRepository|\Polar\Models\Components\BenefitDownloadables|\Polar\Models\Components\BenefitLicenseKeys>')] public array $benefits; /** @@ -128,13 +128,14 @@ class Product * @param bool $isRecurring * @param bool $isArchived * @param string $organizationId - * @param array $metadata - * @param array $prices - * @param array $benefits + * @param array $metadata + * @param array $prices + * @param array $benefits * @param array $medias * @param array $attachedCustomFields * @param ?\DateTime $modifiedAt * @param ?string $description + * @phpstan-pure */ public function __construct(\DateTime $createdAt, string $id, string $name, bool $isRecurring, bool $isArchived, string $organizationId, array $metadata, array $prices, array $benefits, array $medias, array $attachedCustomFields, ?\DateTime $modifiedAt = null, ?string $description = null) { diff --git a/src/Models/Components/ProductBenefitsUpdate.php b/src/Models/Components/ProductBenefitsUpdate.php index 7af55df..72159fc 100644 --- a/src/Models/Components/ProductBenefitsUpdate.php +++ b/src/Models/Components/ProductBenefitsUpdate.php @@ -23,6 +23,7 @@ class ProductBenefitsUpdate /** * @param array $benefits + * @phpstan-pure */ public function __construct(array $benefits) { diff --git a/src/Models/Components/ProductMediaFileCreate.php b/src/Models/Components/ProductMediaFileCreate.php index 6ce46d4..2233304 100644 --- a/src/Models/Components/ProductMediaFileCreate.php +++ b/src/Models/Components/ProductMediaFileCreate.php @@ -69,23 +69,23 @@ class ProductMediaFileCreate /** * - * @var ProductMediaFileCreateService $service + * @var string $service */ #[\Speakeasy\Serializer\Annotation\SerializedName('service')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\ProductMediaFileCreateService')] - public ProductMediaFileCreateService $service; + public string $service; /** * @param string $name * @param string $mimeType * @param int $size * @param S3FileCreateMultipart $upload - * @param ProductMediaFileCreateService $service + * @param string $service * @param ?string $organizationId * @param ?string $checksumSha256Base64 * @param ?string $version + * @phpstan-pure */ - public function __construct(string $name, string $mimeType, int $size, S3FileCreateMultipart $upload, ?string $organizationId = null, ?string $checksumSha256Base64 = null, ?string $version = null, ProductMediaFileCreateService $service = ProductMediaFileCreateService::ProductMedia) + public function __construct(string $name, string $mimeType, int $size, S3FileCreateMultipart $upload, ?string $organizationId = null, ?string $checksumSha256Base64 = null, ?string $version = null, string $service = 'product_media') { $this->name = $name; $this->mimeType = $mimeType; diff --git a/src/Models/Components/ProductMediaFileCreateService.php b/src/Models/Components/ProductMediaFileCreateService.php deleted file mode 100644 index 0f7bc1a..0000000 --- a/src/Models/Components/ProductMediaFileCreateService.php +++ /dev/null @@ -1,15 +0,0 @@ -id = $id; $this->organizationId = $organizationId; diff --git a/src/Models/Components/ProductOneTimeCreate.php b/src/Models/Components/ProductOneTimeCreate.php index e4ad227..dcaf46b 100644 --- a/src/Models/Components/ProductOneTimeCreate.php +++ b/src/Models/Components/ProductOneTimeCreate.php @@ -23,10 +23,10 @@ class ProductOneTimeCreate /** * List of available prices for this product. * - * @var array $prices + * @var array $prices */ #[\Speakeasy\Serializer\Annotation\SerializedName('prices')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Polar\Models\Components\ProductPriceOneTimeFixedCreate|\Polar\Models\Components\ProductPriceOneTimeCustomCreate|\Polar\Models\Components\ProductPriceOneTimeFreeCreate>')] public array $prices; /** @@ -42,10 +42,10 @@ class ProductOneTimeCreate * * You can store up to **50 key-value pairs**. * - * @var ?array $metadata + * @var ?array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $metadata = null; @@ -89,12 +89,13 @@ class ProductOneTimeCreate /** * @param string $name - * @param array $prices - * @param ?array $metadata + * @param array $prices + * @param ?array $metadata * @param ?array $attachedCustomFields * @param ?string $description * @param ?array $medias * @param ?string $organizationId + * @phpstan-pure */ public function __construct(string $name, array $prices, ?array $metadata = null, ?array $attachedCustomFields = null, ?string $description = null, ?array $medias = null, ?string $organizationId = null) { diff --git a/src/Models/Components/ProductPriceOneTimeCustom.php b/src/Models/Components/ProductPriceOneTimeCustom.php index 84ee5b1..19e43b5 100644 --- a/src/Models/Components/ProductPriceOneTimeCustom.php +++ b/src/Models/Components/ProductPriceOneTimeCustom.php @@ -86,35 +86,34 @@ class ProductPriceOneTimeCustom /** * - * @var ProductPriceOneTimeCustomAmountType $amountType + * @var string $amountType */ #[\Speakeasy\Serializer\Annotation\SerializedName('amount_type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\ProductPriceOneTimeCustomAmountType')] - public ProductPriceOneTimeCustomAmountType $amountType; + public string $amountType; /** * The type of the price. * - * @var ProductPriceOneTimeCustomType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\ProductPriceOneTimeCustomType')] - public ProductPriceOneTimeCustomType $type; + public string $type; /** * @param \DateTime $createdAt * @param string $id - * @param ProductPriceOneTimeCustomAmountType $amountType + * @param string $amountType * @param bool $isArchived * @param string $productId * @param string $priceCurrency - * @param ProductPriceOneTimeCustomType $type + * @param string $type * @param ?\DateTime $modifiedAt * @param ?int $minimumAmount * @param ?int $maximumAmount * @param ?int $presetAmount + * @phpstan-pure */ - public function __construct(\DateTime $createdAt, string $id, bool $isArchived, string $productId, string $priceCurrency, ?\DateTime $modifiedAt = null, ?int $minimumAmount = null, ?int $maximumAmount = null, ?int $presetAmount = null, ProductPriceOneTimeCustomAmountType $amountType = ProductPriceOneTimeCustomAmountType::Custom, ProductPriceOneTimeCustomType $type = ProductPriceOneTimeCustomType::OneTime) + public function __construct(\DateTime $createdAt, string $id, bool $isArchived, string $productId, string $priceCurrency, ?\DateTime $modifiedAt = null, ?int $minimumAmount = null, ?int $maximumAmount = null, ?int $presetAmount = null, string $amountType = 'custom', string $type = 'one_time') { $this->createdAt = $createdAt; $this->id = $id; diff --git a/src/Models/Components/ProductPriceOneTimeCustomAmountType.php b/src/Models/Components/ProductPriceOneTimeCustomAmountType.php deleted file mode 100644 index 4b1b8c9..0000000 --- a/src/Models/Components/ProductPriceOneTimeCustomAmountType.php +++ /dev/null @@ -1,15 +0,0 @@ -minimumAmount = $minimumAmount; $this->maximumAmount = $maximumAmount; diff --git a/src/Models/Components/ProductPriceOneTimeCustomCreateAmountType.php b/src/Models/Components/ProductPriceOneTimeCustomCreateAmountType.php deleted file mode 100644 index 887e4db..0000000 --- a/src/Models/Components/ProductPriceOneTimeCustomCreateAmountType.php +++ /dev/null @@ -1,15 +0,0 @@ -createdAt = $createdAt; $this->id = $id; diff --git a/src/Models/Components/ProductPriceOneTimeFixedAmountType.php b/src/Models/Components/ProductPriceOneTimeFixedAmountType.php deleted file mode 100644 index c1dc3fd..0000000 --- a/src/Models/Components/ProductPriceOneTimeFixedAmountType.php +++ /dev/null @@ -1,15 +0,0 @@ -priceAmount = $priceAmount; $this->type = $type; diff --git a/src/Models/Components/ProductPriceOneTimeFixedCreateAmountType.php b/src/Models/Components/ProductPriceOneTimeFixedCreateAmountType.php deleted file mode 100644 index bbdf3a3..0000000 --- a/src/Models/Components/ProductPriceOneTimeFixedCreateAmountType.php +++ /dev/null @@ -1,15 +0,0 @@ -createdAt = $createdAt; $this->id = $id; diff --git a/src/Models/Components/ProductPriceOneTimeFreeAmountType.php b/src/Models/Components/ProductPriceOneTimeFreeAmountType.php deleted file mode 100644 index 19becca..0000000 --- a/src/Models/Components/ProductPriceOneTimeFreeAmountType.php +++ /dev/null @@ -1,15 +0,0 @@ -type = $type; $this->amountType = $amountType; diff --git a/src/Models/Components/ProductPriceOneTimeFreeCreateAmountType.php b/src/Models/Components/ProductPriceOneTimeFreeCreateAmountType.php deleted file mode 100644 index bf2dacf..0000000 --- a/src/Models/Components/ProductPriceOneTimeFreeCreateAmountType.php +++ /dev/null @@ -1,15 +0,0 @@ -createdAt = $createdAt; $this->id = $id; diff --git a/src/Models/Components/ProductPriceRecurringCustomAmountType.php b/src/Models/Components/ProductPriceRecurringCustomAmountType.php deleted file mode 100644 index 1a58fc7..0000000 --- a/src/Models/Components/ProductPriceRecurringCustomAmountType.php +++ /dev/null @@ -1,15 +0,0 @@ -createdAt = $createdAt; $this->id = $id; diff --git a/src/Models/Components/ProductPriceRecurringFixedCreate.php b/src/Models/Components/ProductPriceRecurringFixedCreate.php index a602622..eb589d3 100644 --- a/src/Models/Components/ProductPriceRecurringFixedCreate.php +++ b/src/Models/Components/ProductPriceRecurringFixedCreate.php @@ -30,19 +30,17 @@ class ProductPriceRecurringFixedCreate /** * - * @var ProductPriceRecurringFixedCreateType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\ProductPriceRecurringFixedCreateType')] - public ProductPriceRecurringFixedCreateType $type; + public string $type; /** * - * @var ProductPriceRecurringFixedCreateAmountType $amountType + * @var string $amountType */ #[\Speakeasy\Serializer\Annotation\SerializedName('amount_type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\ProductPriceRecurringFixedCreateAmountType')] - public ProductPriceRecurringFixedCreateAmountType $amountType; + public string $amountType; /** * The currency. Currently, only `usd` is supported. @@ -54,13 +52,14 @@ class ProductPriceRecurringFixedCreate public ?string $priceCurrency = null; /** - * @param ProductPriceRecurringFixedCreateType $type - * @param ProductPriceRecurringFixedCreateAmountType $amountType + * @param string $type + * @param string $amountType * @param int $priceAmount * @param SubscriptionRecurringInterval $recurringInterval * @param ?string $priceCurrency + * @phpstan-pure */ - public function __construct(int $priceAmount, SubscriptionRecurringInterval $recurringInterval, ProductPriceRecurringFixedCreateType $type = ProductPriceRecurringFixedCreateType::Recurring, ProductPriceRecurringFixedCreateAmountType $amountType = ProductPriceRecurringFixedCreateAmountType::Fixed, ?string $priceCurrency = 'usd') + public function __construct(int $priceAmount, SubscriptionRecurringInterval $recurringInterval, string $type = 'recurring', string $amountType = 'fixed', ?string $priceCurrency = 'usd') { $this->priceAmount = $priceAmount; $this->recurringInterval = $recurringInterval; diff --git a/src/Models/Components/ProductPriceRecurringFixedCreateAmountType.php b/src/Models/Components/ProductPriceRecurringFixedCreateAmountType.php deleted file mode 100644 index 90fe663..0000000 --- a/src/Models/Components/ProductPriceRecurringFixedCreateAmountType.php +++ /dev/null @@ -1,15 +0,0 @@ -createdAt = $createdAt; $this->id = $id; diff --git a/src/Models/Components/ProductPriceRecurringFreeAmountType.php b/src/Models/Components/ProductPriceRecurringFreeAmountType.php deleted file mode 100644 index 60aff45..0000000 --- a/src/Models/Components/ProductPriceRecurringFreeAmountType.php +++ /dev/null @@ -1,15 +0,0 @@ -recurringInterval = $recurringInterval; $this->type = $type; diff --git a/src/Models/Components/ProductPriceRecurringFreeCreateAmountType.php b/src/Models/Components/ProductPriceRecurringFreeCreateAmountType.php deleted file mode 100644 index c2ae54c..0000000 --- a/src/Models/Components/ProductPriceRecurringFreeCreateAmountType.php +++ /dev/null @@ -1,15 +0,0 @@ - $prices + * @var array|array $prices */ #[\Speakeasy\Serializer\Annotation\SerializedName('prices')] - #[\Speakeasy\Serializer\Annotation\Type('array<\Polar\Models\Components\ProductPriceRecurringFixedCreate>')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Polar\Models\Components\ProductPriceRecurringFixedCreate>|array<\Polar\Models\Components\ProductPriceRecurringFreeCreate>')] public array $prices; /** @@ -42,10 +42,10 @@ class ProductRecurringCreate * * You can store up to **50 key-value pairs**. * - * @var ?array $metadata + * @var ?array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $metadata = null; @@ -89,12 +89,13 @@ class ProductRecurringCreate /** * @param string $name - * @param array $prices - * @param ?array $metadata + * @param array|array $prices + * @param ?array $metadata * @param ?array $attachedCustomFields * @param ?string $description * @param ?array $medias * @param ?string $organizationId + * @phpstan-pure */ public function __construct(string $name, array $prices, ?array $metadata = null, ?array $attachedCustomFields = null, ?string $description = null, ?array $medias = null, ?string $organizationId = null) { diff --git a/src/Models/Components/ProductUpdate.php b/src/Models/Components/ProductUpdate.php index c996f2e..63183d2 100644 --- a/src/Models/Components/ProductUpdate.php +++ b/src/Models/Components/ProductUpdate.php @@ -15,10 +15,10 @@ class ProductUpdate /** * $metadata * - * @var ?array $metadata + * @var ?array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $metadata = null; @@ -51,10 +51,10 @@ class ProductUpdate /** * List of available prices for this product. If you want to keep existing prices, include them in the list as an `ExistingProductPrice` object. * - * @var ?array $prices + * @var ?array $prices */ #[\Speakeasy\Serializer\Annotation\SerializedName('prices')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array<\Polar\Models\Components\ExistingProductPrice|\Polar\Models\Components\ProductPriceRecurringFixedCreate|\Polar\Models\Components\ProductPriceRecurringFreeCreate|\Polar\Models\Components\ProductPriceOneTimeFixedCreate|\Polar\Models\Components\ProductPriceOneTimeCustomCreate|\Polar\Models\Components\ProductPriceOneTimeFreeCreate>|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $prices = null; @@ -79,13 +79,14 @@ class ProductUpdate public ?array $attachedCustomFields = null; /** - * @param ?array $metadata + * @param ?array $metadata * @param ?string $name * @param ?string $description * @param ?bool $isArchived - * @param ?array $prices + * @param ?array $prices * @param ?array $medias * @param ?array $attachedCustomFields + * @phpstan-pure */ public function __construct(?array $metadata = null, ?string $name = null, ?string $description = null, ?bool $isArchived = null, ?array $prices = null, ?array $medias = null, ?array $attachedCustomFields = null) { diff --git a/src/Models/Components/PropertyAggregation.php b/src/Models/Components/PropertyAggregation.php new file mode 100644 index 0000000..d1295a5 --- /dev/null +++ b/src/Models/Components/PropertyAggregation.php @@ -0,0 +1,39 @@ +func = $func; + $this->property = $property; + } +} \ No newline at end of file diff --git a/src/Models/Components/Reactions.php b/src/Models/Components/Reactions.php index 029abda..03eceb6 100644 --- a/src/Models/Components/Reactions.php +++ b/src/Models/Components/Reactions.php @@ -84,6 +84,7 @@ class Reactions * @param int $heart * @param int $rocket * @param int $eyes + * @phpstan-pure */ public function __construct(int $totalCount, int $plusOne, int $minusOne, int $laugh, int $hooray, int $confused, int $heart, int $rocket, int $eyes) { diff --git a/src/Models/Components/Refund.php b/src/Models/Components/Refund.php new file mode 100644 index 0000000..172fd4f --- /dev/null +++ b/src/Models/Components/Refund.php @@ -0,0 +1,153 @@ + $metadata + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\Type('array')] + public array $metadata; + + /** + * + * @var RefundStatus $status + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('status')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\RefundStatus')] + public RefundStatus $status; + + /** + * + * @var RefundReason $reason + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('reason')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\RefundReason')] + public RefundReason $reason; + + /** + * + * @var int $amount + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('amount')] + public int $amount; + + /** + * + * @var int $taxAmount + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('tax_amount')] + public int $taxAmount; + + /** + * + * @var string $currency + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('currency')] + public string $currency; + + /** + * + * @var string $organizationId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('organization_id')] + public string $organizationId; + + /** + * + * @var string $orderId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('order_id')] + public string $orderId; + + /** + * + * @var string $customerId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('customer_id')] + public string $customerId; + + /** + * + * @var bool $revokeBenefits + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('revoke_benefits')] + public bool $revokeBenefits; + + /** + * Last modification timestamp of the object. + * + * @var ?\DateTime $modifiedAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('modified_at')] + public ?\DateTime $modifiedAt; + + /** + * + * @var ?string $subscriptionId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('subscription_id')] + public ?string $subscriptionId; + + /** + * @param \DateTime $createdAt + * @param string $id + * @param array $metadata + * @param RefundStatus $status + * @param RefundReason $reason + * @param int $amount + * @param int $taxAmount + * @param string $currency + * @param string $organizationId + * @param string $orderId + * @param string $customerId + * @param bool $revokeBenefits + * @param ?\DateTime $modifiedAt + * @param ?string $subscriptionId + * @phpstan-pure + */ + public function __construct(\DateTime $createdAt, string $id, array $metadata, RefundStatus $status, RefundReason $reason, int $amount, int $taxAmount, string $currency, string $organizationId, string $orderId, string $customerId, bool $revokeBenefits, ?\DateTime $modifiedAt = null, ?string $subscriptionId = null) + { + $this->createdAt = $createdAt; + $this->id = $id; + $this->metadata = $metadata; + $this->status = $status; + $this->reason = $reason; + $this->amount = $amount; + $this->taxAmount = $taxAmount; + $this->currency = $currency; + $this->organizationId = $organizationId; + $this->orderId = $orderId; + $this->customerId = $customerId; + $this->revokeBenefits = $revokeBenefits; + $this->modifiedAt = $modifiedAt; + $this->subscriptionId = $subscriptionId; + } +} \ No newline at end of file diff --git a/src/Models/Components/RefundCreate.php b/src/Models/Components/RefundCreate.php new file mode 100644 index 0000000..d50c618 --- /dev/null +++ b/src/Models/Components/RefundCreate.php @@ -0,0 +1,98 @@ + $metadata + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?array $metadata = null; + + /** + * An internal comment about the refund. + * + * @var ?string $comment + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('comment')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $comment = null; + + /** + * Should this refund trigger the associated customer benefits to be revoked? + * + * + * **Note:** + * Only allowed in case the `order` is a one-time purchase. + * Subscriptions automatically revoke customer benefits once the + * subscription itself is revoked, i.e fully canceled. + * + * @var ?bool $revokeBenefits + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('revoke_benefits')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $revokeBenefits = null; + + /** + * @param string $orderId + * @param RefundReason $reason + * @param int $amount + * @param ?array $metadata + * @param ?bool $revokeBenefits + * @param ?string $comment + * @phpstan-pure + */ + public function __construct(string $orderId, RefundReason $reason, int $amount, ?array $metadata = null, ?string $comment = null, ?bool $revokeBenefits = false) + { + $this->orderId = $orderId; + $this->reason = $reason; + $this->amount = $amount; + $this->metadata = $metadata; + $this->comment = $comment; + $this->revokeBenefits = $revokeBenefits; + } +} \ No newline at end of file diff --git a/src/Models/Components/RefundReason.php b/src/Models/Components/RefundReason.php new file mode 100644 index 0000000..8381d7c --- /dev/null +++ b/src/Models/Components/RefundReason.php @@ -0,0 +1,20 @@ +id = $id; + $this->platform = $platform; $this->isPrivate = $isPrivate; $this->name = $name; $this->organization = $organization; @@ -118,6 +120,5 @@ public function __construct(string $id, bool $isPrivate, string $name, ExternalO $this->homepage = $homepage; $this->profileSettings = $profileSettings; $this->internalOrganization = $internalOrganization; - $this->platform = $platform; } } \ No newline at end of file diff --git a/src/Models/Components/RepositoryProfileSettings.php b/src/Models/Components/RepositoryProfileSettings.php index 40f38e6..4fb84a2 100644 --- a/src/Models/Components/RepositoryProfileSettings.php +++ b/src/Models/Components/RepositoryProfileSettings.php @@ -65,6 +65,7 @@ class RepositoryProfileSettings * @param ?array $featuredOrganizations * @param ?array $highlightedSubscriptionTiers * @param ?array $links + * @phpstan-pure */ public function __construct(?string $description = null, ?string $coverImageUrl = null, ?array $featuredOrganizations = null, ?array $highlightedSubscriptionTiers = null, ?array $links = null) { diff --git a/src/Models/Components/RepositoryProfileSettingsUpdate.php b/src/Models/Components/RepositoryProfileSettingsUpdate.php index ea4eacd..ea786ac 100644 --- a/src/Models/Components/RepositoryProfileSettingsUpdate.php +++ b/src/Models/Components/RepositoryProfileSettingsUpdate.php @@ -81,6 +81,7 @@ class RepositoryProfileSettingsUpdate * @param ?array $featuredOrganizations * @param ?array $highlightedSubscriptionTiers * @param ?array $links + * @phpstan-pure */ public function __construct(?bool $setDescription = null, ?string $description = null, ?bool $setCoverImageUrl = null, ?string $coverImageUrl = null, ?array $featuredOrganizations = null, ?array $highlightedSubscriptionTiers = null, ?array $links = null) { diff --git a/src/Models/Components/RepositoryUpdate.php b/src/Models/Components/RepositoryUpdate.php index bf9f4a8..969327b 100644 --- a/src/Models/Components/RepositoryUpdate.php +++ b/src/Models/Components/RepositoryUpdate.php @@ -22,6 +22,7 @@ class RepositoryUpdate /** * @param ?RepositoryProfileSettingsUpdate $profileSettings + * @phpstan-pure */ public function __construct(?RepositoryProfileSettingsUpdate $profileSettings = null) { diff --git a/src/Models/Components/ResponseTypes.php b/src/Models/Components/ResponseTypes.php deleted file mode 100644 index 0e0e7a1..0000000 --- a/src/Models/Components/ResponseTypes.php +++ /dev/null @@ -1,15 +0,0 @@ - $headers + * @phpstan-pure */ public function __construct(string $url, \DateTime $expiresAt, ?array $headers = null) { diff --git a/src/Models/Components/S3FileCreateMultipart.php b/src/Models/Components/S3FileCreateMultipart.php index b8546ce..e64ac22 100644 --- a/src/Models/Components/S3FileCreateMultipart.php +++ b/src/Models/Components/S3FileCreateMultipart.php @@ -22,6 +22,7 @@ class S3FileCreateMultipart /** * @param array $parts + * @phpstan-pure */ public function __construct(array $parts) { diff --git a/src/Models/Components/S3FileCreatePart.php b/src/Models/Components/S3FileCreatePart.php index b8d1aa4..c2cf526 100644 --- a/src/Models/Components/S3FileCreatePart.php +++ b/src/Models/Components/S3FileCreatePart.php @@ -45,6 +45,7 @@ class S3FileCreatePart * @param int $chunkStart * @param int $chunkEnd * @param ?string $checksumSha256Base64 + * @phpstan-pure */ public function __construct(int $number, int $chunkStart, int $chunkEnd, ?string $checksumSha256Base64 = null) { diff --git a/src/Models/Components/S3FileUploadCompletedPart.php b/src/Models/Components/S3FileUploadCompletedPart.php index 33ca58f..ad57de7 100644 --- a/src/Models/Components/S3FileUploadCompletedPart.php +++ b/src/Models/Components/S3FileUploadCompletedPart.php @@ -36,6 +36,7 @@ class S3FileUploadCompletedPart * @param int $number * @param string $checksumEtag * @param ?string $checksumSha256Base64 + * @phpstan-pure */ public function __construct(int $number, string $checksumEtag, ?string $checksumSha256Base64 = null) { diff --git a/src/Models/Components/S3FileUploadMultipart.php b/src/Models/Components/S3FileUploadMultipart.php index 1b79378..43ce2e2 100644 --- a/src/Models/Components/S3FileUploadMultipart.php +++ b/src/Models/Components/S3FileUploadMultipart.php @@ -38,6 +38,7 @@ class S3FileUploadMultipart * @param string $id * @param string $path * @param array $parts + * @phpstan-pure */ public function __construct(string $id, string $path, array $parts) { diff --git a/src/Models/Components/S3FileUploadPart.php b/src/Models/Components/S3FileUploadPart.php index c1cf4cb..f8237c2 100644 --- a/src/Models/Components/S3FileUploadPart.php +++ b/src/Models/Components/S3FileUploadPart.php @@ -72,6 +72,7 @@ class S3FileUploadPart * @param \DateTime $expiresAt * @param ?array $headers * @param ?string $checksumSha256Base64 + * @phpstan-pure */ public function __construct(int $number, int $chunkStart, int $chunkEnd, string $url, \DateTime $expiresAt, ?string $checksumSha256Base64 = null, ?array $headers = null) { diff --git a/src/Models/Components/Scope.php b/src/Models/Components/Scope.php index 8d980de..fa36924 100644 --- a/src/Models/Components/Scope.php +++ b/src/Models/Components/Scope.php @@ -31,6 +31,10 @@ enum Scope: string case ProductsWrite = 'products:write'; case BenefitsRead = 'benefits:read'; case BenefitsWrite = 'benefits:write'; + case EventsRead = 'events:read'; + case EventsWrite = 'events:write'; + case MetersRead = 'meters:read'; + case MetersWrite = 'meters:write'; case FilesRead = 'files:read'; case FilesWrite = 'files:write'; case SubscriptionsRead = 'subscriptions:read'; @@ -39,6 +43,8 @@ enum Scope: string case CustomersWrite = 'customers:write'; case CustomerSessionsWrite = 'customer_sessions:write'; case OrdersRead = 'orders:read'; + case RefundsRead = 'refunds:read'; + case RefundsWrite = 'refunds:write'; case MetricsRead = 'metrics:read'; case WebhooksRead = 'webhooks:read'; case WebhooksWrite = 'webhooks:write'; diff --git a/src/Models/Components/Security.php b/src/Models/Components/Security.php index 4be7c7f..2b89273 100644 --- a/src/Models/Components/Security.php +++ b/src/Models/Components/Security.php @@ -20,6 +20,7 @@ class Security /** * @param string $accessToken + * @phpstan-pure */ public function __construct(string $accessToken) { diff --git a/src/Models/Components/Service.php b/src/Models/Components/Service.php deleted file mode 100644 index dbac0bd..0000000 --- a/src/Models/Components/Service.php +++ /dev/null @@ -1,15 +0,0 @@ - $metadata + * @var array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $metadata; /** @@ -157,6 +157,13 @@ class Subscription #[\Speakeasy\Serializer\Annotation\SerializedName('current_period_end')] public ?\DateTime $currentPeriodEnd; + /** + * + * @var ?\DateTime $canceledAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('canceled_at')] + public ?\DateTime $canceledAt; + /** * * @var ?\DateTime $startedAt @@ -164,6 +171,13 @@ class Subscription #[\Speakeasy\Serializer\Annotation\SerializedName('started_at')] public ?\DateTime $startedAt; + /** + * + * @var ?\DateTime $endsAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('ends_at')] + public ?\DateTime $endsAt; + /** * * @var ?\DateTime $endedAt @@ -185,22 +199,37 @@ class Subscription #[\Speakeasy\Serializer\Annotation\SerializedName('checkout_id')] public ?string $checkoutId; + /** + * + * @var ?CustomerCancellationReason $customerCancellationReason + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('customer_cancellation_reason')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\CustomerCancellationReason|null')] + public ?CustomerCancellationReason $customerCancellationReason; + + /** + * + * @var ?string $customerCancellationComment + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('customer_cancellation_comment')] + public ?string $customerCancellationComment; + /** * Key-value object storing custom field values. * - * @var ?SubscriptionCustomFieldData $customFieldData + * @var ?array $customFieldData */ #[\Speakeasy\Serializer\Annotation\SerializedName('custom_field_data')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\SubscriptionCustomFieldData|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?SubscriptionCustomFieldData $customFieldData = null; + public ?array $customFieldData = null; /** * * @var DiscountFixedOnceForeverDurationBase|DiscountFixedRepeatDurationBase|DiscountPercentageOnceForeverDurationBase|DiscountPercentageRepeatDurationBase|null $discount */ #[\Speakeasy\Serializer\Annotation\SerializedName('discount')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\DiscountFixedOnceForeverDurationBase|\Polar\Models\Components\DiscountFixedRepeatDurationBase|\Polar\Models\Components\DiscountPercentageOnceForeverDurationBase|\Polar\Models\Components\DiscountPercentageRepeatDurationBase')] + #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\DiscountFixedOnceForeverDurationBase|\Polar\Models\Components\DiscountFixedRepeatDurationBase|\Polar\Models\Components\DiscountPercentageOnceForeverDurationBase|\Polar\Models\Components\DiscountPercentageRepeatDurationBase|null')] public DiscountFixedOnceForeverDurationBase|DiscountFixedRepeatDurationBase|DiscountPercentageOnceForeverDurationBase|DiscountPercentageRepeatDurationBase|null $discount; /** @@ -213,7 +242,7 @@ class Subscription * @param string $customerId * @param string $productId * @param string $priceId - * @param array $metadata + * @param array $metadata * @param SubscriptionCustomer $customer * @param string $userId * @param SubscriptionUser $user @@ -223,14 +252,19 @@ class Subscription * @param ?int $amount * @param ?string $currency * @param ?\DateTime $currentPeriodEnd + * @param ?\DateTime $canceledAt * @param ?\DateTime $startedAt + * @param ?\DateTime $endsAt * @param ?\DateTime $endedAt * @param ?string $discountId * @param ?string $checkoutId - * @param ?SubscriptionCustomFieldData $customFieldData + * @param ?CustomerCancellationReason $customerCancellationReason + * @param ?string $customerCancellationComment + * @param ?array $customFieldData * @param DiscountFixedOnceForeverDurationBase|DiscountFixedRepeatDurationBase|DiscountPercentageOnceForeverDurationBase|DiscountPercentageRepeatDurationBase|null $discount + * @phpstan-pure */ - public function __construct(\DateTime $createdAt, string $id, SubscriptionRecurringInterval $recurringInterval, SubscriptionStatus $status, \DateTime $currentPeriodStart, bool $cancelAtPeriodEnd, string $customerId, string $productId, string $priceId, array $metadata, SubscriptionCustomer $customer, string $userId, SubscriptionUser $user, Product $product, ProductPriceRecurringFixed|ProductPriceRecurringCustom|ProductPriceRecurringFree $price, ?\DateTime $modifiedAt = null, ?int $amount = null, ?string $currency = null, ?\DateTime $currentPeriodEnd = null, ?\DateTime $startedAt = null, ?\DateTime $endedAt = null, ?string $discountId = null, ?string $checkoutId = null, ?SubscriptionCustomFieldData $customFieldData = null, DiscountFixedOnceForeverDurationBase|DiscountFixedRepeatDurationBase|DiscountPercentageOnceForeverDurationBase|DiscountPercentageRepeatDurationBase|null $discount = null) + public function __construct(\DateTime $createdAt, string $id, SubscriptionRecurringInterval $recurringInterval, SubscriptionStatus $status, \DateTime $currentPeriodStart, bool $cancelAtPeriodEnd, string $customerId, string $productId, string $priceId, array $metadata, SubscriptionCustomer $customer, string $userId, SubscriptionUser $user, Product $product, ProductPriceRecurringFixed|ProductPriceRecurringCustom|ProductPriceRecurringFree $price, ?\DateTime $modifiedAt = null, ?int $amount = null, ?string $currency = null, ?\DateTime $currentPeriodEnd = null, ?\DateTime $canceledAt = null, ?\DateTime $startedAt = null, ?\DateTime $endsAt = null, ?\DateTime $endedAt = null, ?string $discountId = null, ?string $checkoutId = null, ?CustomerCancellationReason $customerCancellationReason = null, ?string $customerCancellationComment = null, ?array $customFieldData = null, DiscountFixedOnceForeverDurationBase|DiscountFixedRepeatDurationBase|DiscountPercentageOnceForeverDurationBase|DiscountPercentageRepeatDurationBase|null $discount = null) { $this->createdAt = $createdAt; $this->id = $id; @@ -251,10 +285,14 @@ public function __construct(\DateTime $createdAt, string $id, SubscriptionRecurr $this->amount = $amount; $this->currency = $currency; $this->currentPeriodEnd = $currentPeriodEnd; + $this->canceledAt = $canceledAt; $this->startedAt = $startedAt; + $this->endsAt = $endsAt; $this->endedAt = $endedAt; $this->discountId = $discountId; $this->checkoutId = $checkoutId; + $this->customerCancellationReason = $customerCancellationReason; + $this->customerCancellationComment = $customerCancellationComment; $this->customFieldData = $customFieldData; $this->discount = $discount; } diff --git a/src/Models/Components/SubscriptionCancel.php b/src/Models/Components/SubscriptionCancel.php new file mode 100644 index 0000000..fec6594 --- /dev/null +++ b/src/Models/Components/SubscriptionCancel.php @@ -0,0 +1,94 @@ +cancelAtPeriodEnd = $cancelAtPeriodEnd; + $this->customerCancellationReason = $customerCancellationReason; + $this->customerCancellationComment = $customerCancellationComment; + $this->revoke = $revoke; + } +} \ No newline at end of file diff --git a/src/Models/Components/SubscriptionCustomFieldData.php b/src/Models/Components/SubscriptionCustomFieldData.php deleted file mode 100644 index 46d83d6..0000000 --- a/src/Models/Components/SubscriptionCustomFieldData.php +++ /dev/null @@ -1,19 +0,0 @@ - $metadata + * @var array $metadata */ #[\Speakeasy\Serializer\Annotation\SerializedName('metadata')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $metadata; /** @@ -90,16 +90,16 @@ class SubscriptionCustomer /** * $taxId * - * @var ?array $taxId + * @var ?array $taxId */ #[\Speakeasy\Serializer\Annotation\SerializedName('tax_id')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] public ?array $taxId; /** * @param \DateTime $createdAt * @param string $id - * @param array $metadata + * @param array $metadata * @param string $email * @param bool $emailVerified * @param string $organizationId @@ -107,7 +107,8 @@ class SubscriptionCustomer * @param ?\DateTime $modifiedAt * @param ?string $name * @param ?Address $billingAddress - * @param ?array $taxId + * @param ?array $taxId + * @phpstan-pure */ public function __construct(\DateTime $createdAt, string $id, array $metadata, string $email, bool $emailVerified, string $organizationId, string $avatarUrl, ?\DateTime $modifiedAt = null, ?string $name = null, ?Address $billingAddress = null, ?array $taxId = null) { diff --git a/src/Models/Components/AuthorizeResponseOrganizationSubType.php b/src/Models/Components/SubscriptionProrationBehavior.php similarity index 59% rename from src/Models/Components/AuthorizeResponseOrganizationSubType.php rename to src/Models/Components/SubscriptionProrationBehavior.php index 59c7af7..40d2928 100644 --- a/src/Models/Components/AuthorizeResponseOrganizationSubType.php +++ b/src/Models/Components/SubscriptionProrationBehavior.php @@ -9,7 +9,8 @@ namespace Polar\Models\Components; -enum AuthorizeResponseOrganizationSubType: string +enum SubscriptionProrationBehavior: string { - case Organization = 'organization'; + case Invoice = 'invoice'; + case Prorate = 'prorate'; } diff --git a/src/Models/Components/SubscriptionUpdatePrice.php b/src/Models/Components/SubscriptionUpdatePrice.php new file mode 100644 index 0000000..da558c6 --- /dev/null +++ b/src/Models/Components/SubscriptionUpdatePrice.php @@ -0,0 +1,42 @@ +productPriceId = $productPriceId; + $this->prorationBehavior = $prorationBehavior; + } +} \ No newline at end of file diff --git a/src/Models/Components/SubscriptionUser.php b/src/Models/Components/SubscriptionUser.php index dae293e..2766291 100644 --- a/src/Models/Components/SubscriptionUser.php +++ b/src/Models/Components/SubscriptionUser.php @@ -54,6 +54,7 @@ class SubscriptionUser * @param string $publicName * @param ?string $avatarUrl * @param ?string $githubUsername + * @phpstan-pure */ public function __construct(string $id, string $email, string $publicName, ?string $avatarUrl = null, ?string $githubUsername = null) { diff --git a/src/Models/Components/Interval.php b/src/Models/Components/TimeInterval.php similarity index 91% rename from src/Models/Components/Interval.php rename to src/Models/Components/TimeInterval.php index ad41db1..4a12c27 100644 --- a/src/Models/Components/Interval.php +++ b/src/Models/Components/TimeInterval.php @@ -9,7 +9,7 @@ namespace Polar\Models\Components; -enum Interval: string +enum TimeInterval: string { case Year = 'year'; case Month = 'month'; diff --git a/src/Models/Components/TokenResponse.php b/src/Models/Components/TokenResponse.php index c30c577..5bf48e0 100644 --- a/src/Models/Components/TokenResponse.php +++ b/src/Models/Components/TokenResponse.php @@ -48,21 +48,21 @@ class TokenResponse /** * - * @var TokenType $tokenType + * @var string $tokenType */ #[\Speakeasy\Serializer\Annotation\SerializedName('token_type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\TokenType')] - public TokenType $tokenType; + public string $tokenType; /** * @param string $accessToken - * @param TokenType $tokenType + * @param string $tokenType * @param int $expiresIn * @param string $scope * @param string $idToken * @param ?string $refreshToken + * @phpstan-pure */ - public function __construct(string $accessToken, int $expiresIn, string $scope, string $idToken, ?string $refreshToken = null, TokenType $tokenType = TokenType::Bearer) + public function __construct(string $accessToken, int $expiresIn, string $scope, string $idToken, ?string $refreshToken = null, string $tokenType = 'Bearer') { $this->accessToken = $accessToken; $this->expiresIn = $expiresIn; diff --git a/src/Models/Components/TokenType.php b/src/Models/Components/TokenType.php index 6ac53ab..4ffd024 100644 --- a/src/Models/Components/TokenType.php +++ b/src/Models/Components/TokenType.php @@ -11,5 +11,6 @@ enum TokenType: string { - case Bearer = 'Bearer'; + case AccessToken = 'access_token'; + case RefreshToken = 'refresh_token'; } diff --git a/src/Models/Components/Type.php b/src/Models/Components/Type.php deleted file mode 100644 index 1aa16fa..0000000 --- a/src/Models/Components/Type.php +++ /dev/null @@ -1,16 +0,0 @@ - $loc + * @var array $loc */ #[\Speakeasy\Serializer\Annotation\SerializedName('loc')] - #[\Speakeasy\Serializer\Annotation\Type('array')] + #[\Speakeasy\Serializer\Annotation\Type('array')] public array $loc; /** @@ -35,9 +35,10 @@ class ValidationError public string $type; /** - * @param array $loc + * @param array $loc * @param string $msg * @param string $type + * @phpstan-pure */ public function __construct(array $loc, string $msg, string $type) { diff --git a/src/Models/Components/WebhookBenefitCreatedPayload.php b/src/Models/Components/WebhookBenefitCreatedPayload.php index 5862d17..af84ecc 100644 --- a/src/Models/Components/WebhookBenefitCreatedPayload.php +++ b/src/Models/Components/WebhookBenefitCreatedPayload.php @@ -27,17 +27,17 @@ class WebhookBenefitCreatedPayload /** * - * @var WebhookBenefitCreatedPayloadType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\WebhookBenefitCreatedPayloadType')] - public WebhookBenefitCreatedPayloadType $type; + public string $type; /** - * @param WebhookBenefitCreatedPayloadType $type + * @param string $type * @param BenefitAds|BenefitCustom|BenefitDiscord|BenefitGitHubRepository|BenefitDownloadables|BenefitLicenseKeys $data + * @phpstan-pure */ - public function __construct(BenefitAds|BenefitCustom|BenefitDiscord|BenefitGitHubRepository|BenefitDownloadables|BenefitLicenseKeys $data, WebhookBenefitCreatedPayloadType $type = WebhookBenefitCreatedPayloadType::BenefitCreated) + public function __construct(BenefitAds|BenefitCustom|BenefitDiscord|BenefitGitHubRepository|BenefitDownloadables|BenefitLicenseKeys $data, string $type = 'benefit.created') { $this->data = $data; $this->type = $type; diff --git a/src/Models/Components/WebhookBenefitCreatedPayloadType.php b/src/Models/Components/WebhookBenefitCreatedPayloadType.php deleted file mode 100644 index 24e518c..0000000 --- a/src/Models/Components/WebhookBenefitCreatedPayloadType.php +++ /dev/null @@ -1,15 +0,0 @@ -data = $data; $this->type = $type; diff --git a/src/Models/Components/WebhookBenefitGrantCreatedPayloadType.php b/src/Models/Components/WebhookBenefitGrantCreatedPayloadType.php deleted file mode 100644 index 45f96fa..0000000 --- a/src/Models/Components/WebhookBenefitGrantCreatedPayloadType.php +++ /dev/null @@ -1,15 +0,0 @@ -data = $data; $this->type = $type; diff --git a/src/Models/Components/WebhookBenefitGrantRevokedPayloadType.php b/src/Models/Components/WebhookBenefitGrantRevokedPayloadType.php deleted file mode 100644 index 20551d7..0000000 --- a/src/Models/Components/WebhookBenefitGrantRevokedPayloadType.php +++ /dev/null @@ -1,15 +0,0 @@ -data = $data; $this->type = $type; diff --git a/src/Models/Components/WebhookBenefitGrantUpdatedPayloadType.php b/src/Models/Components/WebhookBenefitGrantUpdatedPayloadType.php deleted file mode 100644 index 872d123..0000000 --- a/src/Models/Components/WebhookBenefitGrantUpdatedPayloadType.php +++ /dev/null @@ -1,15 +0,0 @@ -data = $data; $this->type = $type; diff --git a/src/Models/Components/WebhookBenefitUpdatedPayloadType.php b/src/Models/Components/WebhookBenefitUpdatedPayloadType.php deleted file mode 100644 index 543b19b..0000000 --- a/src/Models/Components/WebhookBenefitUpdatedPayloadType.php +++ /dev/null @@ -1,15 +0,0 @@ -data = $data; $this->type = $type; diff --git a/src/Models/Components/WebhookCheckoutCreatedPayloadType.php b/src/Models/Components/WebhookCheckoutCreatedPayloadType.php deleted file mode 100644 index 1c1c29a..0000000 --- a/src/Models/Components/WebhookCheckoutCreatedPayloadType.php +++ /dev/null @@ -1,15 +0,0 @@ -data = $data; $this->type = $type; diff --git a/src/Models/Components/WebhookCheckoutUpdatedPayloadType.php b/src/Models/Components/WebhookCheckoutUpdatedPayloadType.php deleted file mode 100644 index 11f86aa..0000000 --- a/src/Models/Components/WebhookCheckoutUpdatedPayloadType.php +++ /dev/null @@ -1,15 +0,0 @@ -data = $data; $this->type = $type; diff --git a/src/Models/Components/WebhookOrderCreatedPayloadType.php b/src/Models/Components/WebhookOrderCreatedPayloadType.php deleted file mode 100644 index 8be6d34..0000000 --- a/src/Models/Components/WebhookOrderCreatedPayloadType.php +++ /dev/null @@ -1,15 +0,0 @@ -data = $data; + $this->type = $type; + } +} \ No newline at end of file diff --git a/src/Models/Components/WebhookOrganizationUpdatedPayload.php b/src/Models/Components/WebhookOrganizationUpdatedPayload.php index e077c6b..3b9707e 100644 --- a/src/Models/Components/WebhookOrganizationUpdatedPayload.php +++ b/src/Models/Components/WebhookOrganizationUpdatedPayload.php @@ -27,17 +27,17 @@ class WebhookOrganizationUpdatedPayload /** * - * @var WebhookOrganizationUpdatedPayloadType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\WebhookOrganizationUpdatedPayloadType')] - public WebhookOrganizationUpdatedPayloadType $type; + public string $type; /** - * @param WebhookOrganizationUpdatedPayloadType $type + * @param string $type * @param Organization $data + * @phpstan-pure */ - public function __construct(Organization $data, WebhookOrganizationUpdatedPayloadType $type = WebhookOrganizationUpdatedPayloadType::OrganizationUpdated) + public function __construct(Organization $data, string $type = 'organization.updated') { $this->data = $data; $this->type = $type; diff --git a/src/Models/Components/WebhookOrganizationUpdatedPayloadType.php b/src/Models/Components/WebhookOrganizationUpdatedPayloadType.php deleted file mode 100644 index d5240a6..0000000 --- a/src/Models/Components/WebhookOrganizationUpdatedPayloadType.php +++ /dev/null @@ -1,15 +0,0 @@ -data = $data; $this->type = $type; diff --git a/src/Models/Components/WebhookPledgeCreatedPayloadType.php b/src/Models/Components/WebhookPledgeCreatedPayloadType.php deleted file mode 100644 index f83b6bb..0000000 --- a/src/Models/Components/WebhookPledgeCreatedPayloadType.php +++ /dev/null @@ -1,15 +0,0 @@ -data = $data; $this->type = $type; diff --git a/src/Models/Components/WebhookPledgeUpdatedPayloadType.php b/src/Models/Components/WebhookPledgeUpdatedPayloadType.php deleted file mode 100644 index b7845af..0000000 --- a/src/Models/Components/WebhookPledgeUpdatedPayloadType.php +++ /dev/null @@ -1,15 +0,0 @@ -data = $data; $this->type = $type; diff --git a/src/Models/Components/WebhookProductCreatedPayloadType.php b/src/Models/Components/WebhookProductCreatedPayloadType.php deleted file mode 100644 index 92ca3e4..0000000 --- a/src/Models/Components/WebhookProductCreatedPayloadType.php +++ /dev/null @@ -1,15 +0,0 @@ -data = $data; $this->type = $type; diff --git a/src/Models/Components/WebhookProductUpdatedPayloadType.php b/src/Models/Components/WebhookProductUpdatedPayloadType.php deleted file mode 100644 index 85188e0..0000000 --- a/src/Models/Components/WebhookProductUpdatedPayloadType.php +++ /dev/null @@ -1,15 +0,0 @@ -data = $data; + $this->type = $type; + } +} \ No newline at end of file diff --git a/src/Models/Components/WebhookRefundUpdatedPayload.php b/src/Models/Components/WebhookRefundUpdatedPayload.php new file mode 100644 index 0000000..4e1faae --- /dev/null +++ b/src/Models/Components/WebhookRefundUpdatedPayload.php @@ -0,0 +1,45 @@ +data = $data; + $this->type = $type; + } +} \ No newline at end of file diff --git a/src/Models/Components/WebhookSubscriptionActivePayload.php b/src/Models/Components/WebhookSubscriptionActivePayload.php index 21937a9..f497dcb 100644 --- a/src/Models/Components/WebhookSubscriptionActivePayload.php +++ b/src/Models/Components/WebhookSubscriptionActivePayload.php @@ -28,17 +28,17 @@ class WebhookSubscriptionActivePayload /** * - * @var WebhookSubscriptionActivePayloadType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\WebhookSubscriptionActivePayloadType')] - public WebhookSubscriptionActivePayloadType $type; + public string $type; /** - * @param WebhookSubscriptionActivePayloadType $type + * @param string $type * @param Subscription $data + * @phpstan-pure */ - public function __construct(Subscription $data, WebhookSubscriptionActivePayloadType $type = WebhookSubscriptionActivePayloadType::SubscriptionActive) + public function __construct(Subscription $data, string $type = 'subscription.active') { $this->data = $data; $this->type = $type; diff --git a/src/Models/Components/WebhookSubscriptionActivePayloadType.php b/src/Models/Components/WebhookSubscriptionActivePayloadType.php deleted file mode 100644 index fea1371..0000000 --- a/src/Models/Components/WebhookSubscriptionActivePayloadType.php +++ /dev/null @@ -1,15 +0,0 @@ -data = $data; $this->type = $type; diff --git a/src/Models/Components/WebhookSubscriptionCanceledPayloadType.php b/src/Models/Components/WebhookSubscriptionCanceledPayloadType.php deleted file mode 100644 index 63e3446..0000000 --- a/src/Models/Components/WebhookSubscriptionCanceledPayloadType.php +++ /dev/null @@ -1,15 +0,0 @@ -data = $data; $this->type = $type; diff --git a/src/Models/Components/WebhookSubscriptionCreatedPayloadType.php b/src/Models/Components/WebhookSubscriptionCreatedPayloadType.php deleted file mode 100644 index 412ed67..0000000 --- a/src/Models/Components/WebhookSubscriptionCreatedPayloadType.php +++ /dev/null @@ -1,15 +0,0 @@ -data = $data; $this->type = $type; diff --git a/src/Models/Components/WebhookSubscriptionRevokedPayloadType.php b/src/Models/Components/WebhookSubscriptionRevokedPayloadType.php deleted file mode 100644 index ef18d89..0000000 --- a/src/Models/Components/WebhookSubscriptionRevokedPayloadType.php +++ /dev/null @@ -1,15 +0,0 @@ -data = $data; + $this->type = $type; + } +} \ No newline at end of file diff --git a/src/Models/Components/WebhookSubscriptionUpdatedPayload.php b/src/Models/Components/WebhookSubscriptionUpdatedPayload.php index fadca83..bb54bf5 100644 --- a/src/Models/Components/WebhookSubscriptionUpdatedPayload.php +++ b/src/Models/Components/WebhookSubscriptionUpdatedPayload.php @@ -31,17 +31,17 @@ class WebhookSubscriptionUpdatedPayload /** * - * @var WebhookSubscriptionUpdatedPayloadType $type + * @var string $type */ #[\Speakeasy\Serializer\Annotation\SerializedName('type')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Components\WebhookSubscriptionUpdatedPayloadType')] - public WebhookSubscriptionUpdatedPayloadType $type; + public string $type; /** - * @param WebhookSubscriptionUpdatedPayloadType $type + * @param string $type * @param Subscription $data + * @phpstan-pure */ - public function __construct(Subscription $data, WebhookSubscriptionUpdatedPayloadType $type = WebhookSubscriptionUpdatedPayloadType::SubscriptionUpdated) + public function __construct(Subscription $data, string $type = 'subscription.updated') { $this->data = $data; $this->type = $type; diff --git a/src/Models/Components/WebhookSubscriptionUpdatedPayloadType.php b/src/Models/Components/WebhookSubscriptionUpdatedPayloadType.php deleted file mode 100644 index b19c871..0000000 --- a/src/Models/Components/WebhookSubscriptionUpdatedPayloadType.php +++ /dev/null @@ -1,15 +0,0 @@ -error = $error; + $this->detail = $detail; + } + + public function toException(): AlreadyActiveSubscriptionErrorThrowable + { + $serializer = Utils\JSON::createSerializer(); + $message = $serializer->serialize($this, 'json'); + $code = -1; + + return new AlreadyActiveSubscriptionErrorThrowable($message, (int) $code, $this); + } +} \ No newline at end of file diff --git a/src/Models/Errors/AlreadyActiveSubscriptionErrorThrowable.php b/src/Models/Errors/AlreadyActiveSubscriptionErrorThrowable.php new file mode 100644 index 0000000..df33244 --- /dev/null +++ b/src/Models/Errors/AlreadyActiveSubscriptionErrorThrowable.php @@ -0,0 +1,20 @@ +container = $container; + } +} \ No newline at end of file diff --git a/src/Models/Errors/AlreadyCanceledSubscription.php b/src/Models/Errors/AlreadyCanceledSubscription.php index de44eb9..805573b 100644 --- a/src/Models/Errors/AlreadyCanceledSubscription.php +++ b/src/Models/Errors/AlreadyCanceledSubscription.php @@ -8,19 +8,15 @@ namespace Polar\Models\Errors; - -use Polar\Models\Errors; use Polar\Utils; - class AlreadyCanceledSubscription { /** * - * @var AlreadyCanceledSubscriptionError $error + * @var string $error */ #[\Speakeasy\Serializer\Annotation\SerializedName('error')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Errors\AlreadyCanceledSubscriptionError')] - public AlreadyCanceledSubscriptionError $error; + public string $error; /** * @@ -30,10 +26,11 @@ class AlreadyCanceledSubscription public string $detail; /** - * @param AlreadyCanceledSubscriptionError $error + * @param string $error * @param string $detail + * @phpstan-pure */ - public function __construct(string $detail, AlreadyCanceledSubscriptionError $error = AlreadyCanceledSubscriptionError::AlreadyCanceledSubscription) + public function __construct(string $detail, string $error = 'AlreadyCanceledSubscription') { $this->error = $error; $this->detail = $detail; diff --git a/src/Models/Errors/AlreadyCanceledSubscriptionError.php b/src/Models/Errors/AlreadyCanceledSubscriptionError.php deleted file mode 100644 index 5f3b851..0000000 --- a/src/Models/Errors/AlreadyCanceledSubscriptionError.php +++ /dev/null @@ -1,15 +0,0 @@ - $detail + * @phpstan-pure */ public function __construct(?array $detail = null) { diff --git a/src/Models/Errors/NotPermitted.php b/src/Models/Errors/NotPermitted.php index f92322c..b3ee6a2 100644 --- a/src/Models/Errors/NotPermitted.php +++ b/src/Models/Errors/NotPermitted.php @@ -8,19 +8,15 @@ namespace Polar\Models\Errors; - -use Polar\Models\Errors; use Polar\Utils; - class NotPermitted { /** * - * @var NotPermittedError $error + * @var string $error */ #[\Speakeasy\Serializer\Annotation\SerializedName('error')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Errors\NotPermittedError')] - public NotPermittedError $error; + public string $error; /** * @@ -30,10 +26,11 @@ class NotPermitted public string $detail; /** - * @param NotPermittedError $error + * @param string $error * @param string $detail + * @phpstan-pure */ - public function __construct(string $detail, NotPermittedError $error = NotPermittedError::NotPermitted) + public function __construct(string $detail, string $error = 'NotPermitted') { $this->error = $error; $this->detail = $detail; diff --git a/src/Models/Errors/NotPermittedError.php b/src/Models/Errors/NotPermittedError.php deleted file mode 100644 index 32f3fec..0000000 --- a/src/Models/Errors/NotPermittedError.php +++ /dev/null @@ -1,15 +0,0 @@ -error = $error; + $this->detail = $detail; + } + + public function toException(): RefundAmountTooHighThrowable + { + $serializer = Utils\JSON::createSerializer(); + $message = $serializer->serialize($this, 'json'); + $code = -1; + + return new RefundAmountTooHighThrowable($message, (int) $code, $this); + } +} \ No newline at end of file diff --git a/src/Models/Errors/RefundAmountTooHighThrowable.php b/src/Models/Errors/RefundAmountTooHighThrowable.php new file mode 100644 index 0000000..1628316 --- /dev/null +++ b/src/Models/Errors/RefundAmountTooHighThrowable.php @@ -0,0 +1,20 @@ +container = $container; + } +} \ No newline at end of file diff --git a/src/Models/Errors/RefundedAlready.php b/src/Models/Errors/RefundedAlready.php new file mode 100644 index 0000000..77cc012 --- /dev/null +++ b/src/Models/Errors/RefundedAlready.php @@ -0,0 +1,47 @@ +error = $error; + $this->detail = $detail; + } + + public function toException(): RefundedAlreadyThrowable + { + $serializer = Utils\JSON::createSerializer(); + $message = $serializer->serialize($this, 'json'); + $code = -1; + + return new RefundedAlreadyThrowable($message, (int) $code, $this); + } +} \ No newline at end of file diff --git a/src/Models/Errors/RefundedAlreadyThrowable.php b/src/Models/Errors/RefundedAlreadyThrowable.php new file mode 100644 index 0000000..fc66021 --- /dev/null +++ b/src/Models/Errors/RefundedAlreadyThrowable.php @@ -0,0 +1,20 @@ +container = $container; + } +} \ No newline at end of file diff --git a/src/Models/Errors/ResourceNotFound.php b/src/Models/Errors/ResourceNotFound.php index 7e11a1f..bc30bbe 100644 --- a/src/Models/Errors/ResourceNotFound.php +++ b/src/Models/Errors/ResourceNotFound.php @@ -8,19 +8,15 @@ namespace Polar\Models\Errors; - -use Polar\Models\Errors; use Polar\Utils; - class ResourceNotFound { /** * - * @var Error $error + * @var string $error */ #[\Speakeasy\Serializer\Annotation\SerializedName('error')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Errors\Error')] - public Error $error; + public string $error; /** * @@ -30,10 +26,11 @@ class ResourceNotFound public string $detail; /** - * @param Error $error + * @param string $error * @param string $detail + * @phpstan-pure */ - public function __construct(string $detail, Error $error = Error::ResourceNotFound) + public function __construct(string $detail, string $error = 'ResourceNotFound') { $this->error = $error; $this->detail = $detail; diff --git a/src/Models/Errors/Unauthorized.php b/src/Models/Errors/Unauthorized.php index 7c8f551..af7cbe7 100644 --- a/src/Models/Errors/Unauthorized.php +++ b/src/Models/Errors/Unauthorized.php @@ -8,19 +8,15 @@ namespace Polar\Models\Errors; - -use Polar\Models\Errors; use Polar\Utils; - class Unauthorized { /** * - * @var UnauthorizedError $error + * @var string $error */ #[\Speakeasy\Serializer\Annotation\SerializedName('error')] - #[\Speakeasy\Serializer\Annotation\Type('\Polar\Models\Errors\UnauthorizedError')] - public UnauthorizedError $error; + public string $error; /** * @@ -30,10 +26,11 @@ class Unauthorized public string $detail; /** - * @param UnauthorizedError $error + * @param string $error * @param string $detail + * @phpstan-pure */ - public function __construct(string $detail, UnauthorizedError $error = UnauthorizedError::Unauthorized) + public function __construct(string $detail, string $error = 'Unauthorized') { $this->error = $error; $this->detail = $detail; diff --git a/src/Models/Errors/UnauthorizedError.php b/src/Models/Errors/UnauthorizedError.php deleted file mode 100644 index 345fda9..0000000 --- a/src/Models/Errors/UnauthorizedError.php +++ /dev/null @@ -1,15 +0,0 @@ - $sorting + * @phpstan-pure */ public function __construct(string $benefitId, ?array $sorting = null, ?int $page = 1, ?int $limit = 10) { diff --git a/src/Models/Operations/AdvertisementsListResponse.php b/src/Models/Operations/AdvertisementsListResponse.php index 825d173..41ea6e1 100644 --- a/src/Models/Operations/AdvertisementsListResponse.php +++ b/src/Models/Operations/AdvertisementsListResponse.php @@ -48,6 +48,7 @@ class AdvertisementsListResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\AdvertisementCampaignListResource $advertisementCampaignListResource + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\AdvertisementCampaignListResource $advertisementCampaignListResource = null) { diff --git a/src/Models/Operations/BenefitsCreateResponse.php b/src/Models/Operations/BenefitsCreateResponse.php index 5432c4c..7dac686 100644 --- a/src/Models/Operations/BenefitsCreateResponse.php +++ b/src/Models/Operations/BenefitsCreateResponse.php @@ -44,6 +44,7 @@ class BenefitsCreateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param Components\BenefitAds|Components\BenefitCustom|Components\BenefitDiscord|Components\BenefitGitHubRepository|Components\BenefitDownloadables|Components\BenefitLicenseKeys|null $benefit + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, Components\BenefitAds|Components\BenefitCustom|Components\BenefitDiscord|Components\BenefitGitHubRepository|Components\BenefitDownloadables|Components\BenefitLicenseKeys|null $benefit = null) { diff --git a/src/Models/Operations/BenefitsDeleteRequest.php b/src/Models/Operations/BenefitsDeleteRequest.php index 730eb6d..4e30afc 100644 --- a/src/Models/Operations/BenefitsDeleteRequest.php +++ b/src/Models/Operations/BenefitsDeleteRequest.php @@ -20,6 +20,7 @@ class BenefitsDeleteRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/BenefitsDeleteResponse.php b/src/Models/Operations/BenefitsDeleteResponse.php index d5d9bec..86f8fac 100644 --- a/src/Models/Operations/BenefitsDeleteResponse.php +++ b/src/Models/Operations/BenefitsDeleteResponse.php @@ -36,6 +36,7 @@ class BenefitsDeleteResponse * @param string $contentType * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse) { diff --git a/src/Models/Operations/BenefitsGetRequest.php b/src/Models/Operations/BenefitsGetRequest.php index dc7b910..d81e7a7 100644 --- a/src/Models/Operations/BenefitsGetRequest.php +++ b/src/Models/Operations/BenefitsGetRequest.php @@ -20,6 +20,7 @@ class BenefitsGetRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/BenefitsGetResponse.php b/src/Models/Operations/BenefitsGetResponse.php index 29c178e..a9d0a38 100644 --- a/src/Models/Operations/BenefitsGetResponse.php +++ b/src/Models/Operations/BenefitsGetResponse.php @@ -44,6 +44,7 @@ class BenefitsGetResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param Components\BenefitAds|Components\BenefitCustom|Components\BenefitDiscord|Components\BenefitGitHubRepository|Components\BenefitDownloadables|Components\BenefitLicenseKeys|null $benefit + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, Components\BenefitAds|Components\BenefitCustom|Components\BenefitDiscord|Components\BenefitGitHubRepository|Components\BenefitDownloadables|Components\BenefitLicenseKeys|null $benefit = null) { diff --git a/src/Models/Operations/BenefitsGrantsRequest.php b/src/Models/Operations/BenefitsGrantsRequest.php index 752d998..ebaaf60 100644 --- a/src/Models/Operations/BenefitsGrantsRequest.php +++ b/src/Models/Operations/BenefitsGrantsRequest.php @@ -56,6 +56,7 @@ class BenefitsGrantsRequest * @param ?int $limit * @param ?bool $isGranted * @param string|array|null $customerId + * @phpstan-pure */ public function __construct(string $id, ?bool $isGranted = null, string|array|null $customerId = null, ?int $page = 1, ?int $limit = 10) { diff --git a/src/Models/Operations/BenefitsGrantsResponse.php b/src/Models/Operations/BenefitsGrantsResponse.php index 6c41104..043dda0 100644 --- a/src/Models/Operations/BenefitsGrantsResponse.php +++ b/src/Models/Operations/BenefitsGrantsResponse.php @@ -48,6 +48,7 @@ class BenefitsGrantsResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\ListResourceBenefitGrant $listResourceBenefitGrant + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\ListResourceBenefitGrant $listResourceBenefitGrant = null) { diff --git a/src/Models/Operations/BenefitsListRequest.php b/src/Models/Operations/BenefitsListRequest.php index 065f257..7bfd211 100644 --- a/src/Models/Operations/BenefitsListRequest.php +++ b/src/Models/Operations/BenefitsListRequest.php @@ -49,6 +49,7 @@ class BenefitsListRequest * @param ?int $limit * @param string|array|null $organizationId * @param Components\BenefitType|array|null $typeFilter + * @phpstan-pure */ public function __construct(string|array|null $organizationId = null, Components\BenefitType|array|null $typeFilter = null, ?int $page = 1, ?int $limit = 10) { diff --git a/src/Models/Operations/BenefitsListResponse.php b/src/Models/Operations/BenefitsListResponse.php index aaa1887..a28801c 100644 --- a/src/Models/Operations/BenefitsListResponse.php +++ b/src/Models/Operations/BenefitsListResponse.php @@ -48,6 +48,7 @@ class BenefitsListResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\ListResourceBenefit $listResourceBenefit + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\ListResourceBenefit $listResourceBenefit = null) { diff --git a/src/Models/Operations/BenefitsUpdateRequest.php b/src/Models/Operations/BenefitsUpdateRequest.php index d0690a2..353eadd 100644 --- a/src/Models/Operations/BenefitsUpdateRequest.php +++ b/src/Models/Operations/BenefitsUpdateRequest.php @@ -29,6 +29,7 @@ class BenefitsUpdateRequest /** * @param string $id * @param Components\BenefitAdsUpdate|Components\BenefitCustomUpdate|Components\BenefitDiscordUpdate|Components\BenefitGitHubRepositoryUpdate|Components\BenefitDownloadablesUpdate|Components\BenefitLicenseKeysUpdate $requestBody + * @phpstan-pure */ public function __construct(string $id, Components\BenefitAdsUpdate|Components\BenefitCustomUpdate|Components\BenefitDiscordUpdate|Components\BenefitGitHubRepositoryUpdate|Components\BenefitDownloadablesUpdate|Components\BenefitLicenseKeysUpdate $requestBody) { diff --git a/src/Models/Operations/BenefitsUpdateResponse.php b/src/Models/Operations/BenefitsUpdateResponse.php index cf19356..332924d 100644 --- a/src/Models/Operations/BenefitsUpdateResponse.php +++ b/src/Models/Operations/BenefitsUpdateResponse.php @@ -44,6 +44,7 @@ class BenefitsUpdateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param Components\BenefitAds|Components\BenefitCustom|Components\BenefitDiscord|Components\BenefitGitHubRepository|Components\BenefitDownloadables|Components\BenefitLicenseKeys|null $benefit + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, Components\BenefitAds|Components\BenefitCustom|Components\BenefitDiscord|Components\BenefitGitHubRepository|Components\BenefitDownloadables|Components\BenefitLicenseKeys|null $benefit = null) { diff --git a/src/Models/Operations/CheckoutLinksCreateResponse.php b/src/Models/Operations/CheckoutLinksCreateResponse.php index 47d2202..6aa719a 100644 --- a/src/Models/Operations/CheckoutLinksCreateResponse.php +++ b/src/Models/Operations/CheckoutLinksCreateResponse.php @@ -44,6 +44,7 @@ class CheckoutLinksCreateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\CheckoutLink $checkoutLink + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\CheckoutLink $checkoutLink = null) { diff --git a/src/Models/Operations/CheckoutLinksDeleteRequest.php b/src/Models/Operations/CheckoutLinksDeleteRequest.php index 46e0b94..143f71b 100644 --- a/src/Models/Operations/CheckoutLinksDeleteRequest.php +++ b/src/Models/Operations/CheckoutLinksDeleteRequest.php @@ -21,6 +21,7 @@ class CheckoutLinksDeleteRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/CheckoutLinksDeleteResponse.php b/src/Models/Operations/CheckoutLinksDeleteResponse.php index cf73687..b463847 100644 --- a/src/Models/Operations/CheckoutLinksDeleteResponse.php +++ b/src/Models/Operations/CheckoutLinksDeleteResponse.php @@ -36,6 +36,7 @@ class CheckoutLinksDeleteResponse * @param string $contentType * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse) { diff --git a/src/Models/Operations/CheckoutLinksGetRequest.php b/src/Models/Operations/CheckoutLinksGetRequest.php index fad9d57..1d4c9d9 100644 --- a/src/Models/Operations/CheckoutLinksGetRequest.php +++ b/src/Models/Operations/CheckoutLinksGetRequest.php @@ -21,6 +21,7 @@ class CheckoutLinksGetRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/CheckoutLinksGetResponse.php b/src/Models/Operations/CheckoutLinksGetResponse.php index ecc8a13..48d26b1 100644 --- a/src/Models/Operations/CheckoutLinksGetResponse.php +++ b/src/Models/Operations/CheckoutLinksGetResponse.php @@ -44,6 +44,7 @@ class CheckoutLinksGetResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\CheckoutLink $checkoutLink + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\CheckoutLink $checkoutLink = null) { diff --git a/src/Models/Operations/CheckoutLinksListRequest.php b/src/Models/Operations/CheckoutLinksListRequest.php index e0c9e6b..a22bf9c 100644 --- a/src/Models/Operations/CheckoutLinksListRequest.php +++ b/src/Models/Operations/CheckoutLinksListRequest.php @@ -58,6 +58,7 @@ class CheckoutLinksListRequest * @param string|array|null $organizationId * @param string|array|null $productId * @param ?array $sorting + * @phpstan-pure */ public function __construct(string|array|null $organizationId = null, string|array|null $productId = null, ?array $sorting = null, ?int $page = 1, ?int $limit = 10) { diff --git a/src/Models/Operations/CheckoutLinksListResponse.php b/src/Models/Operations/CheckoutLinksListResponse.php index e9bdd17..fcfd2b8 100644 --- a/src/Models/Operations/CheckoutLinksListResponse.php +++ b/src/Models/Operations/CheckoutLinksListResponse.php @@ -48,6 +48,7 @@ class CheckoutLinksListResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\ListResourceCheckoutLink $listResourceCheckoutLink + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\ListResourceCheckoutLink $listResourceCheckoutLink = null) { diff --git a/src/Models/Operations/CheckoutLinksUpdateRequest.php b/src/Models/Operations/CheckoutLinksUpdateRequest.php index 6c33320..e69f64d 100644 --- a/src/Models/Operations/CheckoutLinksUpdateRequest.php +++ b/src/Models/Operations/CheckoutLinksUpdateRequest.php @@ -30,6 +30,7 @@ class CheckoutLinksUpdateRequest /** * @param string $id * @param Components\CheckoutLinkUpdate $checkoutLinkUpdate + * @phpstan-pure */ public function __construct(string $id, Components\CheckoutLinkUpdate $checkoutLinkUpdate) { diff --git a/src/Models/Operations/CheckoutLinksUpdateResponse.php b/src/Models/Operations/CheckoutLinksUpdateResponse.php index 3a340e2..b97c651 100644 --- a/src/Models/Operations/CheckoutLinksUpdateResponse.php +++ b/src/Models/Operations/CheckoutLinksUpdateResponse.php @@ -44,6 +44,7 @@ class CheckoutLinksUpdateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\CheckoutLink $checkoutLink + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\CheckoutLink $checkoutLink = null) { diff --git a/src/Models/Operations/CheckoutsCreateResponse.php b/src/Models/Operations/CheckoutsCreateResponse.php index 649c3e4..a995c6d 100644 --- a/src/Models/Operations/CheckoutsCreateResponse.php +++ b/src/Models/Operations/CheckoutsCreateResponse.php @@ -44,6 +44,7 @@ class CheckoutsCreateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\CheckoutLegacy $checkoutLegacy + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\CheckoutLegacy $checkoutLegacy = null) { diff --git a/src/Models/Operations/CheckoutsCustomClientConfirmRequest.php b/src/Models/Operations/CheckoutsCustomClientConfirmRequest.php index 8dc2ef6..251f014 100644 --- a/src/Models/Operations/CheckoutsCustomClientConfirmRequest.php +++ b/src/Models/Operations/CheckoutsCustomClientConfirmRequest.php @@ -30,6 +30,7 @@ class CheckoutsCustomClientConfirmRequest /** * @param string $clientSecret * @param Components\CheckoutConfirmStripe $checkoutConfirmStripe + * @phpstan-pure */ public function __construct(string $clientSecret, Components\CheckoutConfirmStripe $checkoutConfirmStripe) { diff --git a/src/Models/Operations/CheckoutsCustomClientConfirmResponse.php b/src/Models/Operations/CheckoutsCustomClientConfirmResponse.php index 7d581b6..dd4a74b 100644 --- a/src/Models/Operations/CheckoutsCustomClientConfirmResponse.php +++ b/src/Models/Operations/CheckoutsCustomClientConfirmResponse.php @@ -44,6 +44,7 @@ class CheckoutsCustomClientConfirmResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\CheckoutPublicConfirmed $checkoutPublicConfirmed + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\CheckoutPublicConfirmed $checkoutPublicConfirmed = null) { diff --git a/src/Models/Operations/CheckoutsCustomClientGetRequest.php b/src/Models/Operations/CheckoutsCustomClientGetRequest.php index 57ec59a..37ce8f5 100644 --- a/src/Models/Operations/CheckoutsCustomClientGetRequest.php +++ b/src/Models/Operations/CheckoutsCustomClientGetRequest.php @@ -21,6 +21,7 @@ class CheckoutsCustomClientGetRequest /** * @param string $clientSecret + * @phpstan-pure */ public function __construct(string $clientSecret) { diff --git a/src/Models/Operations/CheckoutsCustomClientGetResponse.php b/src/Models/Operations/CheckoutsCustomClientGetResponse.php index cbdd2d4..49e7373 100644 --- a/src/Models/Operations/CheckoutsCustomClientGetResponse.php +++ b/src/Models/Operations/CheckoutsCustomClientGetResponse.php @@ -44,6 +44,7 @@ class CheckoutsCustomClientGetResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\CheckoutPublic $checkoutPublic + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\CheckoutPublic $checkoutPublic = null) { diff --git a/src/Models/Operations/CheckoutsCustomClientUpdateRequest.php b/src/Models/Operations/CheckoutsCustomClientUpdateRequest.php index 191f090..661ce54 100644 --- a/src/Models/Operations/CheckoutsCustomClientUpdateRequest.php +++ b/src/Models/Operations/CheckoutsCustomClientUpdateRequest.php @@ -30,6 +30,7 @@ class CheckoutsCustomClientUpdateRequest /** * @param string $clientSecret * @param Components\CheckoutUpdatePublic $checkoutUpdatePublic + * @phpstan-pure */ public function __construct(string $clientSecret, Components\CheckoutUpdatePublic $checkoutUpdatePublic) { diff --git a/src/Models/Operations/CheckoutsCustomClientUpdateResponse.php b/src/Models/Operations/CheckoutsCustomClientUpdateResponse.php index 779f729..0edf79c 100644 --- a/src/Models/Operations/CheckoutsCustomClientUpdateResponse.php +++ b/src/Models/Operations/CheckoutsCustomClientUpdateResponse.php @@ -44,6 +44,7 @@ class CheckoutsCustomClientUpdateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\CheckoutPublic $checkoutPublic + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\CheckoutPublic $checkoutPublic = null) { diff --git a/src/Models/Operations/CheckoutsCustomCreateResponse.php b/src/Models/Operations/CheckoutsCustomCreateResponse.php index c63df1a..2f33476 100644 --- a/src/Models/Operations/CheckoutsCustomCreateResponse.php +++ b/src/Models/Operations/CheckoutsCustomCreateResponse.php @@ -44,6 +44,7 @@ class CheckoutsCustomCreateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Checkout $checkout + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Checkout $checkout = null) { diff --git a/src/Models/Operations/CheckoutsCustomGetRequest.php b/src/Models/Operations/CheckoutsCustomGetRequest.php index 982d45e..72a911c 100644 --- a/src/Models/Operations/CheckoutsCustomGetRequest.php +++ b/src/Models/Operations/CheckoutsCustomGetRequest.php @@ -21,6 +21,7 @@ class CheckoutsCustomGetRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/CheckoutsCustomGetResponse.php b/src/Models/Operations/CheckoutsCustomGetResponse.php index ebe2853..9049a4d 100644 --- a/src/Models/Operations/CheckoutsCustomGetResponse.php +++ b/src/Models/Operations/CheckoutsCustomGetResponse.php @@ -44,6 +44,7 @@ class CheckoutsCustomGetResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Checkout $checkout + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Checkout $checkout = null) { diff --git a/src/Models/Operations/CheckoutsCustomListRequest.php b/src/Models/Operations/CheckoutsCustomListRequest.php index 867359c..0c9c9f6 100644 --- a/src/Models/Operations/CheckoutsCustomListRequest.php +++ b/src/Models/Operations/CheckoutsCustomListRequest.php @@ -58,6 +58,7 @@ class CheckoutsCustomListRequest * @param string|array|null $organizationId * @param string|array|null $productId * @param ?array $sorting + * @phpstan-pure */ public function __construct(string|array|null $organizationId = null, string|array|null $productId = null, ?array $sorting = null, ?int $page = 1, ?int $limit = 10) { diff --git a/src/Models/Operations/CheckoutsCustomListResponse.php b/src/Models/Operations/CheckoutsCustomListResponse.php index 234c128..3dddfda 100644 --- a/src/Models/Operations/CheckoutsCustomListResponse.php +++ b/src/Models/Operations/CheckoutsCustomListResponse.php @@ -48,6 +48,7 @@ class CheckoutsCustomListResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\ListResourceCheckout $listResourceCheckout + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\ListResourceCheckout $listResourceCheckout = null) { diff --git a/src/Models/Operations/CheckoutsCustomUpdateRequest.php b/src/Models/Operations/CheckoutsCustomUpdateRequest.php index fdf994f..1f661f2 100644 --- a/src/Models/Operations/CheckoutsCustomUpdateRequest.php +++ b/src/Models/Operations/CheckoutsCustomUpdateRequest.php @@ -30,6 +30,7 @@ class CheckoutsCustomUpdateRequest /** * @param string $id * @param Components\CheckoutUpdate $checkoutUpdate + * @phpstan-pure */ public function __construct(string $id, Components\CheckoutUpdate $checkoutUpdate) { diff --git a/src/Models/Operations/CheckoutsCustomUpdateResponse.php b/src/Models/Operations/CheckoutsCustomUpdateResponse.php index 1a20383..38e3777 100644 --- a/src/Models/Operations/CheckoutsCustomUpdateResponse.php +++ b/src/Models/Operations/CheckoutsCustomUpdateResponse.php @@ -44,6 +44,7 @@ class CheckoutsCustomUpdateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Checkout $checkout + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Checkout $checkout = null) { diff --git a/src/Models/Operations/CheckoutsGetRequest.php b/src/Models/Operations/CheckoutsGetRequest.php index efb2506..dc1ffda 100644 --- a/src/Models/Operations/CheckoutsGetRequest.php +++ b/src/Models/Operations/CheckoutsGetRequest.php @@ -20,6 +20,7 @@ class CheckoutsGetRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/CheckoutsGetResponse.php b/src/Models/Operations/CheckoutsGetResponse.php index a1bd5d0..ef762cc 100644 --- a/src/Models/Operations/CheckoutsGetResponse.php +++ b/src/Models/Operations/CheckoutsGetResponse.php @@ -44,6 +44,7 @@ class CheckoutsGetResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\CheckoutLegacy $checkoutLegacy + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\CheckoutLegacy $checkoutLegacy = null) { diff --git a/src/Models/Operations/CustomFieldsCreateResponse.php b/src/Models/Operations/CustomFieldsCreateResponse.php index 30f1abc..25efbda 100644 --- a/src/Models/Operations/CustomFieldsCreateResponse.php +++ b/src/Models/Operations/CustomFieldsCreateResponse.php @@ -44,6 +44,7 @@ class CustomFieldsCreateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param Components\CustomFieldText|Components\CustomFieldNumber|Components\CustomFieldDate|Components\CustomFieldCheckbox|Components\CustomFieldSelect|null $customField + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, Components\CustomFieldText|Components\CustomFieldNumber|Components\CustomFieldDate|Components\CustomFieldCheckbox|Components\CustomFieldSelect|null $customField = null) { diff --git a/src/Models/Operations/CustomFieldsDeleteRequest.php b/src/Models/Operations/CustomFieldsDeleteRequest.php index 3d4817b..43753d9 100644 --- a/src/Models/Operations/CustomFieldsDeleteRequest.php +++ b/src/Models/Operations/CustomFieldsDeleteRequest.php @@ -21,6 +21,7 @@ class CustomFieldsDeleteRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/CustomFieldsDeleteResponse.php b/src/Models/Operations/CustomFieldsDeleteResponse.php index 05ca96e..e420d5e 100644 --- a/src/Models/Operations/CustomFieldsDeleteResponse.php +++ b/src/Models/Operations/CustomFieldsDeleteResponse.php @@ -36,6 +36,7 @@ class CustomFieldsDeleteResponse * @param string $contentType * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse) { diff --git a/src/Models/Operations/CustomFieldsGetRequest.php b/src/Models/Operations/CustomFieldsGetRequest.php index 8ac31d7..77ba027 100644 --- a/src/Models/Operations/CustomFieldsGetRequest.php +++ b/src/Models/Operations/CustomFieldsGetRequest.php @@ -21,6 +21,7 @@ class CustomFieldsGetRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/CustomFieldsGetResponse.php b/src/Models/Operations/CustomFieldsGetResponse.php index b448e28..8c32176 100644 --- a/src/Models/Operations/CustomFieldsGetResponse.php +++ b/src/Models/Operations/CustomFieldsGetResponse.php @@ -44,6 +44,7 @@ class CustomFieldsGetResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param Components\CustomFieldText|Components\CustomFieldNumber|Components\CustomFieldDate|Components\CustomFieldCheckbox|Components\CustomFieldSelect|null $customField + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, Components\CustomFieldText|Components\CustomFieldNumber|Components\CustomFieldDate|Components\CustomFieldCheckbox|Components\CustomFieldSelect|null $customField = null) { diff --git a/src/Models/Operations/CustomFieldsListRequest.php b/src/Models/Operations/CustomFieldsListRequest.php index db56c32..7943357 100644 --- a/src/Models/Operations/CustomFieldsListRequest.php +++ b/src/Models/Operations/CustomFieldsListRequest.php @@ -67,6 +67,7 @@ class CustomFieldsListRequest * @param ?string $query * @param Components\CustomFieldType|array|null $typeFilter * @param ?array $sorting + * @phpstan-pure */ public function __construct(string|array|null $organizationId = null, ?string $query = null, Components\CustomFieldType|array|null $typeFilter = null, ?array $sorting = null, ?int $page = 1, ?int $limit = 10) { diff --git a/src/Models/Operations/CustomFieldsListResponse.php b/src/Models/Operations/CustomFieldsListResponse.php index 5ffa097..c4c71b2 100644 --- a/src/Models/Operations/CustomFieldsListResponse.php +++ b/src/Models/Operations/CustomFieldsListResponse.php @@ -48,6 +48,7 @@ class CustomFieldsListResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\ListResourceCustomField $listResourceCustomField + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\ListResourceCustomField $listResourceCustomField = null) { diff --git a/src/Models/Operations/CustomFieldsUpdateRequest.php b/src/Models/Operations/CustomFieldsUpdateRequest.php index f85daa8..b769d91 100644 --- a/src/Models/Operations/CustomFieldsUpdateRequest.php +++ b/src/Models/Operations/CustomFieldsUpdateRequest.php @@ -30,6 +30,7 @@ class CustomFieldsUpdateRequest /** * @param string $id * @param Components\CustomFieldUpdateText|Components\CustomFieldUpdateNumber|Components\CustomFieldUpdateDate|Components\CustomFieldUpdateCheckbox|Components\CustomFieldUpdateSelect $customFieldUpdate + * @phpstan-pure */ public function __construct(string $id, Components\CustomFieldUpdateText|Components\CustomFieldUpdateNumber|Components\CustomFieldUpdateDate|Components\CustomFieldUpdateCheckbox|Components\CustomFieldUpdateSelect $customFieldUpdate) { diff --git a/src/Models/Operations/CustomFieldsUpdateResponse.php b/src/Models/Operations/CustomFieldsUpdateResponse.php index 36b7a4d..0d71d1e 100644 --- a/src/Models/Operations/CustomFieldsUpdateResponse.php +++ b/src/Models/Operations/CustomFieldsUpdateResponse.php @@ -44,6 +44,7 @@ class CustomFieldsUpdateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param Components\CustomFieldText|Components\CustomFieldNumber|Components\CustomFieldDate|Components\CustomFieldCheckbox|Components\CustomFieldSelect|null $customField + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, Components\CustomFieldText|Components\CustomFieldNumber|Components\CustomFieldDate|Components\CustomFieldCheckbox|Components\CustomFieldSelect|null $customField = null) { diff --git a/src/Models/Operations/CustomerPortalBenefitGrantsGetRequest.php b/src/Models/Operations/CustomerPortalBenefitGrantsGetRequest.php index 1359b84..7e8123e 100644 --- a/src/Models/Operations/CustomerPortalBenefitGrantsGetRequest.php +++ b/src/Models/Operations/CustomerPortalBenefitGrantsGetRequest.php @@ -21,6 +21,7 @@ class CustomerPortalBenefitGrantsGetRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/CustomerPortalBenefitGrantsGetResponse.php b/src/Models/Operations/CustomerPortalBenefitGrantsGetResponse.php index d3c98bf..d72d83f 100644 --- a/src/Models/Operations/CustomerPortalBenefitGrantsGetResponse.php +++ b/src/Models/Operations/CustomerPortalBenefitGrantsGetResponse.php @@ -44,6 +44,7 @@ class CustomerPortalBenefitGrantsGetResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param Components\CustomerBenefitGrantDiscord|Components\CustomerBenefitGrantGitHubRepository|Components\CustomerBenefitGrantDownloadables|Components\CustomerBenefitGrantLicenseKeys|Components\CustomerBenefitGrantAds|Components\CustomerBenefitGrantCustom|null $customerBenefitGrant + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, Components\CustomerBenefitGrantDiscord|Components\CustomerBenefitGrantGitHubRepository|Components\CustomerBenefitGrantDownloadables|Components\CustomerBenefitGrantLicenseKeys|Components\CustomerBenefitGrantAds|Components\CustomerBenefitGrantCustom|null $customerBenefitGrant = null) { diff --git a/src/Models/Operations/CustomerPortalBenefitGrantsListRequest.php b/src/Models/Operations/CustomerPortalBenefitGrantsListRequest.php index c732a6e..919cd29 100644 --- a/src/Models/Operations/CustomerPortalBenefitGrantsListRequest.php +++ b/src/Models/Operations/CustomerPortalBenefitGrantsListRequest.php @@ -94,6 +94,7 @@ class CustomerPortalBenefitGrantsListRequest * @param string|array|null $orderId * @param string|array|null $subscriptionId * @param ?array $sorting + * @phpstan-pure */ public function __construct(Components\BenefitType|array|null $typeFilter = null, string|array|null $benefitId = null, string|array|null $organizationId = null, string|array|null $checkoutId = null, string|array|null $orderId = null, string|array|null $subscriptionId = null, ?array $sorting = null, ?int $page = 1, ?int $limit = 10) { diff --git a/src/Models/Operations/CustomerPortalBenefitGrantsListResponse.php b/src/Models/Operations/CustomerPortalBenefitGrantsListResponse.php index 278380d..561db55 100644 --- a/src/Models/Operations/CustomerPortalBenefitGrantsListResponse.php +++ b/src/Models/Operations/CustomerPortalBenefitGrantsListResponse.php @@ -48,6 +48,7 @@ class CustomerPortalBenefitGrantsListResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\ListResourceCustomerBenefitGrant $listResourceCustomerBenefitGrant + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\ListResourceCustomerBenefitGrant $listResourceCustomerBenefitGrant = null) { diff --git a/src/Models/Operations/CustomerPortalBenefitGrantsUpdateRequest.php b/src/Models/Operations/CustomerPortalBenefitGrantsUpdateRequest.php index e0c498d..34fe507 100644 --- a/src/Models/Operations/CustomerPortalBenefitGrantsUpdateRequest.php +++ b/src/Models/Operations/CustomerPortalBenefitGrantsUpdateRequest.php @@ -30,6 +30,7 @@ class CustomerPortalBenefitGrantsUpdateRequest /** * @param string $id * @param Components\CustomerBenefitGrantDiscordUpdate|Components\CustomerBenefitGrantGitHubRepositoryUpdate|Components\CustomerBenefitGrantDownloadablesUpdate|Components\CustomerBenefitGrantLicenseKeysUpdate|Components\CustomerBenefitGrantAdsUpdate|Components\CustomerBenefitGrantCustomUpdate $customerBenefitGrantUpdate + * @phpstan-pure */ public function __construct(string $id, Components\CustomerBenefitGrantDiscordUpdate|Components\CustomerBenefitGrantGitHubRepositoryUpdate|Components\CustomerBenefitGrantDownloadablesUpdate|Components\CustomerBenefitGrantLicenseKeysUpdate|Components\CustomerBenefitGrantAdsUpdate|Components\CustomerBenefitGrantCustomUpdate $customerBenefitGrantUpdate) { diff --git a/src/Models/Operations/CustomerPortalBenefitGrantsUpdateResponse.php b/src/Models/Operations/CustomerPortalBenefitGrantsUpdateResponse.php index 5fb0fb7..d8a8336 100644 --- a/src/Models/Operations/CustomerPortalBenefitGrantsUpdateResponse.php +++ b/src/Models/Operations/CustomerPortalBenefitGrantsUpdateResponse.php @@ -44,6 +44,7 @@ class CustomerPortalBenefitGrantsUpdateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param Components\CustomerBenefitGrantDiscord|Components\CustomerBenefitGrantGitHubRepository|Components\CustomerBenefitGrantDownloadables|Components\CustomerBenefitGrantLicenseKeys|Components\CustomerBenefitGrantAds|Components\CustomerBenefitGrantCustom|null $customerBenefitGrant + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, Components\CustomerBenefitGrantDiscord|Components\CustomerBenefitGrantGitHubRepository|Components\CustomerBenefitGrantDownloadables|Components\CustomerBenefitGrantLicenseKeys|Components\CustomerBenefitGrantAds|Components\CustomerBenefitGrantCustom|null $customerBenefitGrant = null) { diff --git a/src/Models/Operations/CustomerPortalCustomersGetRequest.php b/src/Models/Operations/CustomerPortalCustomersGetRequest.php index ecda1ba..28b6ad4 100644 --- a/src/Models/Operations/CustomerPortalCustomersGetRequest.php +++ b/src/Models/Operations/CustomerPortalCustomersGetRequest.php @@ -21,6 +21,7 @@ class CustomerPortalCustomersGetRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/CustomerPortalCustomersGetResponse.php b/src/Models/Operations/CustomerPortalCustomersGetResponse.php index 49c90dd..c1dfea7 100644 --- a/src/Models/Operations/CustomerPortalCustomersGetResponse.php +++ b/src/Models/Operations/CustomerPortalCustomersGetResponse.php @@ -44,6 +44,7 @@ class CustomerPortalCustomersGetResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\CustomerPortalCustomer $customerPortalCustomer + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\CustomerPortalCustomer $customerPortalCustomer = null) { diff --git a/src/Models/Operations/CustomerPortalDownloadablesCustomerPortalDownloadablesGetRequest.php b/src/Models/Operations/CustomerPortalDownloadablesCustomerPortalDownloadablesGetRequest.php index a168328..036d1c3 100644 --- a/src/Models/Operations/CustomerPortalDownloadablesCustomerPortalDownloadablesGetRequest.php +++ b/src/Models/Operations/CustomerPortalDownloadablesCustomerPortalDownloadablesGetRequest.php @@ -20,6 +20,7 @@ class CustomerPortalDownloadablesCustomerPortalDownloadablesGetRequest /** * @param string $token + * @phpstan-pure */ public function __construct(string $token) { diff --git a/src/Models/Operations/CustomerPortalDownloadablesCustomerPortalDownloadablesGetResponse.php b/src/Models/Operations/CustomerPortalDownloadablesCustomerPortalDownloadablesGetResponse.php index c81d30d..e332670 100644 --- a/src/Models/Operations/CustomerPortalDownloadablesCustomerPortalDownloadablesGetResponse.php +++ b/src/Models/Operations/CustomerPortalDownloadablesCustomerPortalDownloadablesGetResponse.php @@ -44,6 +44,7 @@ class CustomerPortalDownloadablesCustomerPortalDownloadablesGetResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param mixed $any + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, mixed $any = null) { diff --git a/src/Models/Operations/CustomerPortalDownloadablesListRequest.php b/src/Models/Operations/CustomerPortalDownloadablesListRequest.php index 9b47101..e66e4a9 100644 --- a/src/Models/Operations/CustomerPortalDownloadablesListRequest.php +++ b/src/Models/Operations/CustomerPortalDownloadablesListRequest.php @@ -48,6 +48,7 @@ class CustomerPortalDownloadablesListRequest * @param ?int $limit * @param string|array|null $organizationId * @param string|array|null $benefitId + * @phpstan-pure */ public function __construct(string|array|null $organizationId = null, string|array|null $benefitId = null, ?int $page = 1, ?int $limit = 10) { diff --git a/src/Models/Operations/CustomerPortalDownloadablesListResponse.php b/src/Models/Operations/CustomerPortalDownloadablesListResponse.php index 3dedf50..f257d0b 100644 --- a/src/Models/Operations/CustomerPortalDownloadablesListResponse.php +++ b/src/Models/Operations/CustomerPortalDownloadablesListResponse.php @@ -48,6 +48,7 @@ class CustomerPortalDownloadablesListResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\ListResourceDownloadableRead $listResourceDownloadableRead + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\ListResourceDownloadableRead $listResourceDownloadableRead = null) { diff --git a/src/Models/Operations/CustomerPortalLicenseKeysActivateResponse.php b/src/Models/Operations/CustomerPortalLicenseKeysActivateResponse.php index 32e7eb6..c03a918 100644 --- a/src/Models/Operations/CustomerPortalLicenseKeysActivateResponse.php +++ b/src/Models/Operations/CustomerPortalLicenseKeysActivateResponse.php @@ -44,6 +44,7 @@ class CustomerPortalLicenseKeysActivateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\LicenseKeyActivationRead $licenseKeyActivationRead + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\LicenseKeyActivationRead $licenseKeyActivationRead = null) { diff --git a/src/Models/Operations/CustomerPortalLicenseKeysDeactivateResponse.php b/src/Models/Operations/CustomerPortalLicenseKeysDeactivateResponse.php index 2e9645f..903b9cb 100644 --- a/src/Models/Operations/CustomerPortalLicenseKeysDeactivateResponse.php +++ b/src/Models/Operations/CustomerPortalLicenseKeysDeactivateResponse.php @@ -36,6 +36,7 @@ class CustomerPortalLicenseKeysDeactivateResponse * @param string $contentType * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse) { diff --git a/src/Models/Operations/CustomerPortalLicenseKeysGetRequest.php b/src/Models/Operations/CustomerPortalLicenseKeysGetRequest.php index a15718e..f0a75a2 100644 --- a/src/Models/Operations/CustomerPortalLicenseKeysGetRequest.php +++ b/src/Models/Operations/CustomerPortalLicenseKeysGetRequest.php @@ -20,6 +20,7 @@ class CustomerPortalLicenseKeysGetRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/CustomerPortalLicenseKeysGetResponse.php b/src/Models/Operations/CustomerPortalLicenseKeysGetResponse.php index b2d1192..337a037 100644 --- a/src/Models/Operations/CustomerPortalLicenseKeysGetResponse.php +++ b/src/Models/Operations/CustomerPortalLicenseKeysGetResponse.php @@ -44,6 +44,7 @@ class CustomerPortalLicenseKeysGetResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\LicenseKeyWithActivations $licenseKeyWithActivations + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\LicenseKeyWithActivations $licenseKeyWithActivations = null) { diff --git a/src/Models/Operations/CustomerPortalLicenseKeysListRequest.php b/src/Models/Operations/CustomerPortalLicenseKeysListRequest.php index 38a9491..5d76635 100644 --- a/src/Models/Operations/CustomerPortalLicenseKeysListRequest.php +++ b/src/Models/Operations/CustomerPortalLicenseKeysListRequest.php @@ -48,6 +48,7 @@ class CustomerPortalLicenseKeysListRequest * @param ?int $limit * @param string|array|null $organizationId * @param ?string $benefitId + * @phpstan-pure */ public function __construct(string|array|null $organizationId = null, ?string $benefitId = null, ?int $page = 1, ?int $limit = 10) { diff --git a/src/Models/Operations/CustomerPortalLicenseKeysListResponse.php b/src/Models/Operations/CustomerPortalLicenseKeysListResponse.php index 1fbc542..f2d5f5f 100644 --- a/src/Models/Operations/CustomerPortalLicenseKeysListResponse.php +++ b/src/Models/Operations/CustomerPortalLicenseKeysListResponse.php @@ -48,6 +48,7 @@ class CustomerPortalLicenseKeysListResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\ListResourceLicenseKeyRead $listResourceLicenseKeyRead + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\ListResourceLicenseKeyRead $listResourceLicenseKeyRead = null) { diff --git a/src/Models/Operations/CustomerPortalLicenseKeysValidateResponse.php b/src/Models/Operations/CustomerPortalLicenseKeysValidateResponse.php index a05f96a..8b8415f 100644 --- a/src/Models/Operations/CustomerPortalLicenseKeysValidateResponse.php +++ b/src/Models/Operations/CustomerPortalLicenseKeysValidateResponse.php @@ -44,6 +44,7 @@ class CustomerPortalLicenseKeysValidateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\ValidatedLicenseKey $validatedLicenseKey + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\ValidatedLicenseKey $validatedLicenseKey = null) { diff --git a/src/Models/Operations/CustomerPortalOrdersGetRequest.php b/src/Models/Operations/CustomerPortalOrdersGetRequest.php index eb70732..86a2a7a 100644 --- a/src/Models/Operations/CustomerPortalOrdersGetRequest.php +++ b/src/Models/Operations/CustomerPortalOrdersGetRequest.php @@ -21,6 +21,7 @@ class CustomerPortalOrdersGetRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/CustomerPortalOrdersGetResponse.php b/src/Models/Operations/CustomerPortalOrdersGetResponse.php index a1378eb..41640dc 100644 --- a/src/Models/Operations/CustomerPortalOrdersGetResponse.php +++ b/src/Models/Operations/CustomerPortalOrdersGetResponse.php @@ -44,6 +44,7 @@ class CustomerPortalOrdersGetResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\CustomerOrder $customerOrder + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\CustomerOrder $customerOrder = null) { diff --git a/src/Models/Operations/CustomerPortalOrdersInvoiceRequest.php b/src/Models/Operations/CustomerPortalOrdersInvoiceRequest.php index 3e3982f..a47345f 100644 --- a/src/Models/Operations/CustomerPortalOrdersInvoiceRequest.php +++ b/src/Models/Operations/CustomerPortalOrdersInvoiceRequest.php @@ -21,6 +21,7 @@ class CustomerPortalOrdersInvoiceRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/CustomerPortalOrdersInvoiceResponse.php b/src/Models/Operations/CustomerPortalOrdersInvoiceResponse.php index 303d06c..af2199c 100644 --- a/src/Models/Operations/CustomerPortalOrdersInvoiceResponse.php +++ b/src/Models/Operations/CustomerPortalOrdersInvoiceResponse.php @@ -44,6 +44,7 @@ class CustomerPortalOrdersInvoiceResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\CustomerOrderInvoice $customerOrderInvoice + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\CustomerOrderInvoice $customerOrderInvoice = null) { diff --git a/src/Models/Operations/CustomerPortalOrdersListRequest.php b/src/Models/Operations/CustomerPortalOrdersListRequest.php index ea6bf0e..99da2d4 100644 --- a/src/Models/Operations/CustomerPortalOrdersListRequest.php +++ b/src/Models/Operations/CustomerPortalOrdersListRequest.php @@ -85,6 +85,7 @@ class CustomerPortalOrdersListRequest * @param string|array|null $subscriptionId * @param ?string $query * @param ?array $sorting + * @phpstan-pure */ public function __construct(string|array|null $organizationId = null, string|array|null $productId = null, Components\ProductPriceType|array|null $productPriceType = null, string|array|null $subscriptionId = null, ?string $query = null, ?array $sorting = null, ?int $page = 1, ?int $limit = 10) { diff --git a/src/Models/Operations/CustomerPortalOrdersListResponse.php b/src/Models/Operations/CustomerPortalOrdersListResponse.php index 5680b6c..e32f162 100644 --- a/src/Models/Operations/CustomerPortalOrdersListResponse.php +++ b/src/Models/Operations/CustomerPortalOrdersListResponse.php @@ -48,6 +48,7 @@ class CustomerPortalOrdersListResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\ListResourceCustomerOrder $listResourceCustomerOrder + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\ListResourceCustomerOrder $listResourceCustomerOrder = null) { diff --git a/src/Models/Operations/CustomerPortalOrganizationsGetRequest.php b/src/Models/Operations/CustomerPortalOrganizationsGetRequest.php index 241403e..c942972 100644 --- a/src/Models/Operations/CustomerPortalOrganizationsGetRequest.php +++ b/src/Models/Operations/CustomerPortalOrganizationsGetRequest.php @@ -21,6 +21,7 @@ class CustomerPortalOrganizationsGetRequest /** * @param string $slug + * @phpstan-pure */ public function __construct(string $slug) { diff --git a/src/Models/Operations/CustomerPortalOrganizationsGetResponse.php b/src/Models/Operations/CustomerPortalOrganizationsGetResponse.php index 6744c87..dc81728 100644 --- a/src/Models/Operations/CustomerPortalOrganizationsGetResponse.php +++ b/src/Models/Operations/CustomerPortalOrganizationsGetResponse.php @@ -44,6 +44,7 @@ class CustomerPortalOrganizationsGetResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Organization $organization + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Organization $organization = null) { diff --git a/src/Models/Operations/CustomerPortalSubscriptionsCancelRequest.php b/src/Models/Operations/CustomerPortalSubscriptionsCancelRequest.php index c0cc9db..1563416 100644 --- a/src/Models/Operations/CustomerPortalSubscriptionsCancelRequest.php +++ b/src/Models/Operations/CustomerPortalSubscriptionsCancelRequest.php @@ -21,6 +21,7 @@ class CustomerPortalSubscriptionsCancelRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/CustomerPortalSubscriptionsCancelResponse.php b/src/Models/Operations/CustomerPortalSubscriptionsCancelResponse.php index d10ceb0..f73aba6 100644 --- a/src/Models/Operations/CustomerPortalSubscriptionsCancelResponse.php +++ b/src/Models/Operations/CustomerPortalSubscriptionsCancelResponse.php @@ -33,7 +33,7 @@ class CustomerPortalSubscriptionsCancelResponse public \Psr\Http\Message\ResponseInterface $rawResponse; /** - * Subscription canceled. + * Customer subscription is canceled. * * @var ?Components\CustomerSubscription $customerSubscription */ @@ -44,6 +44,7 @@ class CustomerPortalSubscriptionsCancelResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\CustomerSubscription $customerSubscription + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\CustomerSubscription $customerSubscription = null) { diff --git a/src/Models/Operations/CustomerPortalSubscriptionsGetRequest.php b/src/Models/Operations/CustomerPortalSubscriptionsGetRequest.php index f59fe1d..69a4c6b 100644 --- a/src/Models/Operations/CustomerPortalSubscriptionsGetRequest.php +++ b/src/Models/Operations/CustomerPortalSubscriptionsGetRequest.php @@ -21,6 +21,7 @@ class CustomerPortalSubscriptionsGetRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/CustomerPortalSubscriptionsGetResponse.php b/src/Models/Operations/CustomerPortalSubscriptionsGetResponse.php index 2582e9e..0cc08a3 100644 --- a/src/Models/Operations/CustomerPortalSubscriptionsGetResponse.php +++ b/src/Models/Operations/CustomerPortalSubscriptionsGetResponse.php @@ -44,6 +44,7 @@ class CustomerPortalSubscriptionsGetResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\CustomerSubscription $customerSubscription + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\CustomerSubscription $customerSubscription = null) { diff --git a/src/Models/Operations/CustomerPortalSubscriptionsListRequest.php b/src/Models/Operations/CustomerPortalSubscriptionsListRequest.php index fa0297b..87742c2 100644 --- a/src/Models/Operations/CustomerPortalSubscriptionsListRequest.php +++ b/src/Models/Operations/CustomerPortalSubscriptionsListRequest.php @@ -76,6 +76,7 @@ class CustomerPortalSubscriptionsListRequest * @param ?bool $active * @param ?string $query * @param ?array $sorting + * @phpstan-pure */ public function __construct(string|array|null $organizationId = null, string|array|null $productId = null, ?bool $active = null, ?string $query = null, ?array $sorting = null, ?int $page = 1, ?int $limit = 10) { diff --git a/src/Models/Operations/CustomerPortalSubscriptionsListResponse.php b/src/Models/Operations/CustomerPortalSubscriptionsListResponse.php index 3b61b4a..3343fdc 100644 --- a/src/Models/Operations/CustomerPortalSubscriptionsListResponse.php +++ b/src/Models/Operations/CustomerPortalSubscriptionsListResponse.php @@ -48,6 +48,7 @@ class CustomerPortalSubscriptionsListResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\ListResourceCustomerSubscription $listResourceCustomerSubscription + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\ListResourceCustomerSubscription $listResourceCustomerSubscription = null) { diff --git a/src/Models/Operations/CustomerPortalSubscriptionsUpdateRequest.php b/src/Models/Operations/CustomerPortalSubscriptionsUpdateRequest.php index 53fcc09..a9faf33 100644 --- a/src/Models/Operations/CustomerPortalSubscriptionsUpdateRequest.php +++ b/src/Models/Operations/CustomerPortalSubscriptionsUpdateRequest.php @@ -22,16 +22,17 @@ class CustomerPortalSubscriptionsUpdateRequest /** * - * @var Components\CustomerSubscriptionUpdate $customerSubscriptionUpdate + * @var Components\CustomerSubscriptionUpdatePrice|Components\CustomerSubscriptionCancel $customerSubscriptionUpdate */ #[SpeakeasyMetadata('request:mediaType=application/json')] - public Components\CustomerSubscriptionUpdate $customerSubscriptionUpdate; + public Components\CustomerSubscriptionUpdatePrice|Components\CustomerSubscriptionCancel $customerSubscriptionUpdate; /** * @param string $id - * @param Components\CustomerSubscriptionUpdate $customerSubscriptionUpdate + * @param Components\CustomerSubscriptionUpdatePrice|Components\CustomerSubscriptionCancel $customerSubscriptionUpdate + * @phpstan-pure */ - public function __construct(string $id, Components\CustomerSubscriptionUpdate $customerSubscriptionUpdate) + public function __construct(string $id, Components\CustomerSubscriptionUpdatePrice|Components\CustomerSubscriptionCancel $customerSubscriptionUpdate) { $this->id = $id; $this->customerSubscriptionUpdate = $customerSubscriptionUpdate; diff --git a/src/Models/Operations/CustomerPortalSubscriptionsUpdateResponse.php b/src/Models/Operations/CustomerPortalSubscriptionsUpdateResponse.php index abd1f86..52fc171 100644 --- a/src/Models/Operations/CustomerPortalSubscriptionsUpdateResponse.php +++ b/src/Models/Operations/CustomerPortalSubscriptionsUpdateResponse.php @@ -33,7 +33,7 @@ class CustomerPortalSubscriptionsUpdateResponse public \Psr\Http\Message\ResponseInterface $rawResponse; /** - * Subscription updated. + * Customer subscription updated. * * @var ?Components\CustomerSubscription $customerSubscription */ @@ -44,6 +44,7 @@ class CustomerPortalSubscriptionsUpdateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\CustomerSubscription $customerSubscription + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\CustomerSubscription $customerSubscription = null) { diff --git a/src/Models/Operations/CustomerSessionsCreateResponse.php b/src/Models/Operations/CustomerSessionsCreateResponse.php index 5eb9b44..2835409 100644 --- a/src/Models/Operations/CustomerSessionsCreateResponse.php +++ b/src/Models/Operations/CustomerSessionsCreateResponse.php @@ -44,6 +44,7 @@ class CustomerSessionsCreateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\CustomerSession $customerSession + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\CustomerSession $customerSession = null) { diff --git a/src/Models/Operations/CustomersCreateResponse.php b/src/Models/Operations/CustomersCreateResponse.php index 07ea3b4..3eb2987 100644 --- a/src/Models/Operations/CustomersCreateResponse.php +++ b/src/Models/Operations/CustomersCreateResponse.php @@ -44,6 +44,7 @@ class CustomersCreateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Customer $customer + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Customer $customer = null) { diff --git a/src/Models/Operations/CustomersDeleteRequest.php b/src/Models/Operations/CustomersDeleteRequest.php index 2dae546..187d353 100644 --- a/src/Models/Operations/CustomersDeleteRequest.php +++ b/src/Models/Operations/CustomersDeleteRequest.php @@ -21,6 +21,7 @@ class CustomersDeleteRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/CustomersDeleteResponse.php b/src/Models/Operations/CustomersDeleteResponse.php index fe593c1..741c5a5 100644 --- a/src/Models/Operations/CustomersDeleteResponse.php +++ b/src/Models/Operations/CustomersDeleteResponse.php @@ -36,6 +36,7 @@ class CustomersDeleteResponse * @param string $contentType * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse) { diff --git a/src/Models/Operations/CustomersGetRequest.php b/src/Models/Operations/CustomersGetRequest.php index 451e26e..58ed84a 100644 --- a/src/Models/Operations/CustomersGetRequest.php +++ b/src/Models/Operations/CustomersGetRequest.php @@ -21,6 +21,7 @@ class CustomersGetRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/CustomersGetResponse.php b/src/Models/Operations/CustomersGetResponse.php index 9dd29e7..80d5f89 100644 --- a/src/Models/Operations/CustomersGetResponse.php +++ b/src/Models/Operations/CustomersGetResponse.php @@ -44,6 +44,7 @@ class CustomersGetResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Customer $customer + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Customer $customer = null) { diff --git a/src/Models/Operations/CustomersListRequest.php b/src/Models/Operations/CustomersListRequest.php index 49eaec1..17020e6 100644 --- a/src/Models/Operations/CustomersListRequest.php +++ b/src/Models/Operations/CustomersListRequest.php @@ -20,6 +20,14 @@ class CustomersListRequest #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=organization_id')] public string|array|null $organizationId = null; + /** + * Filter by exact email. + * + * @var ?string $email + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=email')] + public ?string $email = null; + /** * Filter by name or email. * @@ -36,6 +44,14 @@ class CustomersListRequest #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=sorting')] public ?array $sorting = null; + /** + * Filter by metadata key-value pairs. It uses the `deepObject` style, e.g. `?metadata[key]=value`. + * + * @var ?array|array|array> $metadata + */ + #[SpeakeasyMetadata('queryParam:style=deepObject,explode=true,name=metadata')] + public ?array $metadata = null; + /** * Page number, defaults to 1. * @@ -56,14 +72,19 @@ class CustomersListRequest * @param ?int $page * @param ?int $limit * @param string|array|null $organizationId + * @param ?string $email * @param ?string $query * @param ?array $sorting + * @param ?array|array|array> $metadata + * @phpstan-pure */ - public function __construct(string|array|null $organizationId = null, ?string $query = null, ?array $sorting = null, ?int $page = 1, ?int $limit = 10) + public function __construct(string|array|null $organizationId = null, ?string $email = null, ?string $query = null, ?array $sorting = null, ?array $metadata = null, ?int $page = 1, ?int $limit = 10) { $this->organizationId = $organizationId; + $this->email = $email; $this->query = $query; $this->sorting = $sorting; + $this->metadata = $metadata; $this->page = $page; $this->limit = $limit; } diff --git a/src/Models/Operations/CustomersListResponse.php b/src/Models/Operations/CustomersListResponse.php index 5181f46..633380b 100644 --- a/src/Models/Operations/CustomersListResponse.php +++ b/src/Models/Operations/CustomersListResponse.php @@ -48,6 +48,7 @@ class CustomersListResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\ListResourceCustomer $listResourceCustomer + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\ListResourceCustomer $listResourceCustomer = null) { diff --git a/src/Models/Operations/CustomersUpdateRequest.php b/src/Models/Operations/CustomersUpdateRequest.php index b5be376..5b302d8 100644 --- a/src/Models/Operations/CustomersUpdateRequest.php +++ b/src/Models/Operations/CustomersUpdateRequest.php @@ -30,6 +30,7 @@ class CustomersUpdateRequest /** * @param string $id * @param Components\CustomerUpdate $customerUpdate + * @phpstan-pure */ public function __construct(string $id, Components\CustomerUpdate $customerUpdate) { diff --git a/src/Models/Operations/CustomersUpdateResponse.php b/src/Models/Operations/CustomersUpdateResponse.php index 27bcb70..5d9ea8a 100644 --- a/src/Models/Operations/CustomersUpdateResponse.php +++ b/src/Models/Operations/CustomersUpdateResponse.php @@ -44,6 +44,7 @@ class CustomersUpdateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Customer $customer + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Customer $customer = null) { diff --git a/src/Models/Operations/DiscountsCreateResponse.php b/src/Models/Operations/DiscountsCreateResponse.php index 204c890..d037459 100644 --- a/src/Models/Operations/DiscountsCreateResponse.php +++ b/src/Models/Operations/DiscountsCreateResponse.php @@ -44,6 +44,7 @@ class DiscountsCreateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param Components\DiscountFixedOnceForeverDuration|Components\DiscountFixedRepeatDuration|Components\DiscountPercentageOnceForeverDuration|Components\DiscountPercentageRepeatDuration|null $discount + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, Components\DiscountFixedOnceForeverDuration|Components\DiscountFixedRepeatDuration|Components\DiscountPercentageOnceForeverDuration|Components\DiscountPercentageRepeatDuration|null $discount = null) { diff --git a/src/Models/Operations/DiscountsDeleteRequest.php b/src/Models/Operations/DiscountsDeleteRequest.php index e7c77a8..5b443c5 100644 --- a/src/Models/Operations/DiscountsDeleteRequest.php +++ b/src/Models/Operations/DiscountsDeleteRequest.php @@ -21,6 +21,7 @@ class DiscountsDeleteRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/DiscountsDeleteResponse.php b/src/Models/Operations/DiscountsDeleteResponse.php index 13d4bd0..2910344 100644 --- a/src/Models/Operations/DiscountsDeleteResponse.php +++ b/src/Models/Operations/DiscountsDeleteResponse.php @@ -36,6 +36,7 @@ class DiscountsDeleteResponse * @param string $contentType * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse) { diff --git a/src/Models/Operations/DiscountsGetRequest.php b/src/Models/Operations/DiscountsGetRequest.php index a31a9bc..73acee0 100644 --- a/src/Models/Operations/DiscountsGetRequest.php +++ b/src/Models/Operations/DiscountsGetRequest.php @@ -21,6 +21,7 @@ class DiscountsGetRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/DiscountsGetResponse.php b/src/Models/Operations/DiscountsGetResponse.php index 80c9dad..7ba8fff 100644 --- a/src/Models/Operations/DiscountsGetResponse.php +++ b/src/Models/Operations/DiscountsGetResponse.php @@ -44,6 +44,7 @@ class DiscountsGetResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param Components\DiscountFixedOnceForeverDuration|Components\DiscountFixedRepeatDuration|Components\DiscountPercentageOnceForeverDuration|Components\DiscountPercentageRepeatDuration|null $discount + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, Components\DiscountFixedOnceForeverDuration|Components\DiscountFixedRepeatDuration|Components\DiscountPercentageOnceForeverDuration|Components\DiscountPercentageRepeatDuration|null $discount = null) { diff --git a/src/Models/Operations/DiscountsListRequest.php b/src/Models/Operations/DiscountsListRequest.php index 493cc3a..ade495c 100644 --- a/src/Models/Operations/DiscountsListRequest.php +++ b/src/Models/Operations/DiscountsListRequest.php @@ -58,6 +58,7 @@ class DiscountsListRequest * @param string|array|null $organizationId * @param ?string $query * @param ?array $sorting + * @phpstan-pure */ public function __construct(string|array|null $organizationId = null, ?string $query = null, ?array $sorting = null, ?int $page = 1, ?int $limit = 10) { diff --git a/src/Models/Operations/DiscountsListResponse.php b/src/Models/Operations/DiscountsListResponse.php index a29d752..082ddc0 100644 --- a/src/Models/Operations/DiscountsListResponse.php +++ b/src/Models/Operations/DiscountsListResponse.php @@ -48,6 +48,7 @@ class DiscountsListResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\ListResourceDiscount $listResourceDiscount + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\ListResourceDiscount $listResourceDiscount = null) { diff --git a/src/Models/Operations/DiscountsUpdateRequest.php b/src/Models/Operations/DiscountsUpdateRequest.php index 69d7091..007034f 100644 --- a/src/Models/Operations/DiscountsUpdateRequest.php +++ b/src/Models/Operations/DiscountsUpdateRequest.php @@ -30,6 +30,7 @@ class DiscountsUpdateRequest /** * @param string $id * @param Components\DiscountUpdate $discountUpdate + * @phpstan-pure */ public function __construct(string $id, Components\DiscountUpdate $discountUpdate) { diff --git a/src/Models/Operations/DiscountsUpdateResponse.php b/src/Models/Operations/DiscountsUpdateResponse.php index ac5a503..2c93e68 100644 --- a/src/Models/Operations/DiscountsUpdateResponse.php +++ b/src/Models/Operations/DiscountsUpdateResponse.php @@ -44,6 +44,7 @@ class DiscountsUpdateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param Components\DiscountFixedOnceForeverDuration|Components\DiscountFixedRepeatDuration|Components\DiscountPercentageOnceForeverDuration|Components\DiscountPercentageRepeatDuration|null $discount + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, Components\DiscountFixedOnceForeverDuration|Components\DiscountFixedRepeatDuration|Components\DiscountPercentageOnceForeverDuration|Components\DiscountPercentageRepeatDuration|null $discount = null) { diff --git a/src/Models/Operations/EventsGetRequest.php b/src/Models/Operations/EventsGetRequest.php new file mode 100644 index 0000000..413d629 --- /dev/null +++ b/src/Models/Operations/EventsGetRequest.php @@ -0,0 +1,30 @@ +id = $id; + } +} \ No newline at end of file diff --git a/src/Models/Operations/EventsGetResponse.php b/src/Models/Operations/EventsGetResponse.php new file mode 100644 index 0000000..a3e5ea4 --- /dev/null +++ b/src/Models/Operations/EventsGetResponse.php @@ -0,0 +1,56 @@ +contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + $this->event = $event; + } +} \ No newline at end of file diff --git a/src/Models/Operations/EventsIngestResponse.php b/src/Models/Operations/EventsIngestResponse.php new file mode 100644 index 0000000..df117ee --- /dev/null +++ b/src/Models/Operations/EventsIngestResponse.php @@ -0,0 +1,56 @@ +contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + $this->eventsIngestResponse = $eventsIngestResponse; + } +} \ No newline at end of file diff --git a/src/Models/Operations/EventsListRequest.php b/src/Models/Operations/EventsListRequest.php new file mode 100644 index 0000000..06b7e9c --- /dev/null +++ b/src/Models/Operations/EventsListRequest.php @@ -0,0 +1,121 @@ +|null $organizationId + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=organization_id')] + public string|array|null $organizationId = null; + + /** + * Filter by customer ID. + * + * @var string|array|null $customerId + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=customer_id')] + public string|array|null $customerId = null; + + /** + * Filter by external customer ID. + * + * @var string|array|null $externalCustomerId + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=external_customer_id')] + public string|array|null $externalCustomerId = null; + + /** + * Filter by event source. + * + * @var Components\EventSource|array|null $source + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=source')] + public Components\EventSource|array|null $source = null; + + /** + * Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. + * + * @var ?array $sorting + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=sorting')] + public ?array $sorting = null; + + /** + * Filter by metadata key-value pairs. It uses the `deepObject` style, e.g. `?metadata[key]=value`. + * + * @var ?array|array|array> $metadata + */ + #[SpeakeasyMetadata('queryParam:style=deepObject,explode=true,name=metadata')] + public ?array $metadata = null; + + /** + * Page number, defaults to 1. + * + * @var ?int $page + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=page')] + public ?int $page = null; + + /** + * Size of a page, defaults to 10. Maximum is 100. + * + * @var ?int $limit + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=limit')] + public ?int $limit = null; + + /** + * @param ?int $page + * @param ?int $limit + * @param ?\DateTime $startTimestamp + * @param ?\DateTime $endTimestamp + * @param string|array|null $organizationId + * @param string|array|null $customerId + * @param string|array|null $externalCustomerId + * @param Components\EventSource|array|null $source + * @param ?array $sorting + * @param ?array|array|array> $metadata + * @phpstan-pure + */ + public function __construct(?\DateTime $startTimestamp = null, ?\DateTime $endTimestamp = null, string|array|null $organizationId = null, string|array|null $customerId = null, string|array|null $externalCustomerId = null, Components\EventSource|array|null $source = null, ?array $sorting = null, ?array $metadata = null, ?int $page = 1, ?int $limit = 10) + { + $this->startTimestamp = $startTimestamp; + $this->endTimestamp = $endTimestamp; + $this->organizationId = $organizationId; + $this->customerId = $customerId; + $this->externalCustomerId = $externalCustomerId; + $this->source = $source; + $this->sorting = $sorting; + $this->metadata = $metadata; + $this->page = $page; + $this->limit = $limit; + } +} \ No newline at end of file diff --git a/src/Models/Operations/EventsListResponse.php b/src/Models/Operations/EventsListResponse.php new file mode 100644 index 0000000..efb89e1 --- /dev/null +++ b/src/Models/Operations/EventsListResponse.php @@ -0,0 +1,73 @@ +contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + $this->listResourceEvent = $listResourceEvent; + } + /** + * @param string $name + * @param array $args + * @return ?EventsListResponse + */ + public function __call($name, $args): ?EventsListResponse + { + if ($name === 'next') { + return call_user_func_array($this->next, $args); + } + + return null; + } +} \ No newline at end of file diff --git a/src/Models/Operations/ExternalOrganizationsListRequest.php b/src/Models/Operations/ExternalOrganizationsListRequest.php index 1f31e70..856cb71 100644 --- a/src/Models/Operations/ExternalOrganizationsListRequest.php +++ b/src/Models/Operations/ExternalOrganizationsListRequest.php @@ -67,6 +67,7 @@ class ExternalOrganizationsListRequest * @param string|array|null $name * @param string|array|null $organizationId * @param ?array $sorting + * @phpstan-pure */ public function __construct(Components\Platforms|array|null $platform = null, string|array|null $name = null, string|array|null $organizationId = null, ?array $sorting = null, ?int $page = 1, ?int $limit = 10) { diff --git a/src/Models/Operations/ExternalOrganizationsListResponse.php b/src/Models/Operations/ExternalOrganizationsListResponse.php index e81a40e..79136b7 100644 --- a/src/Models/Operations/ExternalOrganizationsListResponse.php +++ b/src/Models/Operations/ExternalOrganizationsListResponse.php @@ -48,6 +48,7 @@ class ExternalOrganizationsListResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\ListResourceExternalOrganization $listResourceExternalOrganization + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\ListResourceExternalOrganization $listResourceExternalOrganization = null) { diff --git a/src/Models/Operations/FilesCreateResponse.php b/src/Models/Operations/FilesCreateResponse.php index 2b15859..086b0a9 100644 --- a/src/Models/Operations/FilesCreateResponse.php +++ b/src/Models/Operations/FilesCreateResponse.php @@ -44,6 +44,7 @@ class FilesCreateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\FileUpload $fileUpload + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\FileUpload $fileUpload = null) { diff --git a/src/Models/Operations/FilesDeleteRequest.php b/src/Models/Operations/FilesDeleteRequest.php index 2393c85..1410307 100644 --- a/src/Models/Operations/FilesDeleteRequest.php +++ b/src/Models/Operations/FilesDeleteRequest.php @@ -20,6 +20,7 @@ class FilesDeleteRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/FilesDeleteResponse.php b/src/Models/Operations/FilesDeleteResponse.php index 811e911..70f80b0 100644 --- a/src/Models/Operations/FilesDeleteResponse.php +++ b/src/Models/Operations/FilesDeleteResponse.php @@ -36,6 +36,7 @@ class FilesDeleteResponse * @param string $contentType * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse) { diff --git a/src/Models/Operations/FilesListRequest.php b/src/Models/Operations/FilesListRequest.php index 16a0ed2..e979f01 100644 --- a/src/Models/Operations/FilesListRequest.php +++ b/src/Models/Operations/FilesListRequest.php @@ -47,6 +47,7 @@ class FilesListRequest * @param ?int $limit * @param ?string $organizationId * @param ?array $ids + * @phpstan-pure */ public function __construct(?string $organizationId = null, ?array $ids = null, ?int $page = 1, ?int $limit = 10) { diff --git a/src/Models/Operations/FilesListResponse.php b/src/Models/Operations/FilesListResponse.php index 2644559..661d8ba 100644 --- a/src/Models/Operations/FilesListResponse.php +++ b/src/Models/Operations/FilesListResponse.php @@ -48,6 +48,7 @@ class FilesListResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\ListResourceFileRead $listResourceFileRead + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\ListResourceFileRead $listResourceFileRead = null) { diff --git a/src/Models/Operations/FilesUpdateRequest.php b/src/Models/Operations/FilesUpdateRequest.php index ae11d84..6059e9a 100644 --- a/src/Models/Operations/FilesUpdateRequest.php +++ b/src/Models/Operations/FilesUpdateRequest.php @@ -30,6 +30,7 @@ class FilesUpdateRequest /** * @param string $id * @param Components\FilePatch $filePatch + * @phpstan-pure */ public function __construct(string $id, Components\FilePatch $filePatch) { diff --git a/src/Models/Operations/FilesUpdateResponse.php b/src/Models/Operations/FilesUpdateResponse.php index cb5ff62..98d6f30 100644 --- a/src/Models/Operations/FilesUpdateResponse.php +++ b/src/Models/Operations/FilesUpdateResponse.php @@ -44,6 +44,7 @@ class FilesUpdateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param Components\DownloadableFileRead|Components\ProductMediaFileRead|Components\OrganizationAvatarFileRead|null $responseFilesUpdate + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, Components\DownloadableFileRead|Components\ProductMediaFileRead|Components\OrganizationAvatarFileRead|null $responseFilesUpdate = null) { diff --git a/src/Models/Operations/FilesUploadedRequest.php b/src/Models/Operations/FilesUploadedRequest.php index c1e3460..0acd50f 100644 --- a/src/Models/Operations/FilesUploadedRequest.php +++ b/src/Models/Operations/FilesUploadedRequest.php @@ -30,6 +30,7 @@ class FilesUploadedRequest /** * @param string $id * @param Components\FileUploadCompleted $fileUploadCompleted + * @phpstan-pure */ public function __construct(string $id, Components\FileUploadCompleted $fileUploadCompleted) { diff --git a/src/Models/Operations/FilesUploadedResponse.php b/src/Models/Operations/FilesUploadedResponse.php index 4808c02..bacab2e 100644 --- a/src/Models/Operations/FilesUploadedResponse.php +++ b/src/Models/Operations/FilesUploadedResponse.php @@ -44,6 +44,7 @@ class FilesUploadedResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param Components\DownloadableFileRead|Components\ProductMediaFileRead|Components\OrganizationAvatarFileRead|null $responseFilesUploaded + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, Components\DownloadableFileRead|Components\ProductMediaFileRead|Components\OrganizationAvatarFileRead|null $responseFilesUploaded = null) { diff --git a/src/Models/Operations/LicenseKeysGetActivationRequest.php b/src/Models/Operations/LicenseKeysGetActivationRequest.php index a397ecf..e05eadc 100644 --- a/src/Models/Operations/LicenseKeysGetActivationRequest.php +++ b/src/Models/Operations/LicenseKeysGetActivationRequest.php @@ -28,6 +28,7 @@ class LicenseKeysGetActivationRequest /** * @param string $id * @param string $activationId + * @phpstan-pure */ public function __construct(string $id, string $activationId) { diff --git a/src/Models/Operations/LicenseKeysGetActivationResponse.php b/src/Models/Operations/LicenseKeysGetActivationResponse.php index 0e28ca2..7fa8d60 100644 --- a/src/Models/Operations/LicenseKeysGetActivationResponse.php +++ b/src/Models/Operations/LicenseKeysGetActivationResponse.php @@ -44,6 +44,7 @@ class LicenseKeysGetActivationResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\LicenseKeyActivationRead $licenseKeyActivationRead + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\LicenseKeyActivationRead $licenseKeyActivationRead = null) { diff --git a/src/Models/Operations/LicenseKeysGetRequest.php b/src/Models/Operations/LicenseKeysGetRequest.php index 14cc7c1..4dc44a9 100644 --- a/src/Models/Operations/LicenseKeysGetRequest.php +++ b/src/Models/Operations/LicenseKeysGetRequest.php @@ -20,6 +20,7 @@ class LicenseKeysGetRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/LicenseKeysGetResponse.php b/src/Models/Operations/LicenseKeysGetResponse.php index c99fe86..9c63eca 100644 --- a/src/Models/Operations/LicenseKeysGetResponse.php +++ b/src/Models/Operations/LicenseKeysGetResponse.php @@ -44,6 +44,7 @@ class LicenseKeysGetResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\LicenseKeyWithActivations $licenseKeyWithActivations + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\LicenseKeyWithActivations $licenseKeyWithActivations = null) { diff --git a/src/Models/Operations/LicenseKeysListRequest.php b/src/Models/Operations/LicenseKeysListRequest.php index 931144b..d0cc993 100644 --- a/src/Models/Operations/LicenseKeysListRequest.php +++ b/src/Models/Operations/LicenseKeysListRequest.php @@ -48,6 +48,7 @@ class LicenseKeysListRequest * @param ?int $limit * @param string|array|null $organizationId * @param string|array|null $benefitId + * @phpstan-pure */ public function __construct(string|array|null $organizationId = null, string|array|null $benefitId = null, ?int $page = 1, ?int $limit = 10) { diff --git a/src/Models/Operations/LicenseKeysListResponse.php b/src/Models/Operations/LicenseKeysListResponse.php index 932462a..44222bb 100644 --- a/src/Models/Operations/LicenseKeysListResponse.php +++ b/src/Models/Operations/LicenseKeysListResponse.php @@ -48,6 +48,7 @@ class LicenseKeysListResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\ListResourceLicenseKeyRead $listResourceLicenseKeyRead + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\ListResourceLicenseKeyRead $listResourceLicenseKeyRead = null) { diff --git a/src/Models/Operations/LicenseKeysUpdateRequest.php b/src/Models/Operations/LicenseKeysUpdateRequest.php index e44bb96..6c2c3a7 100644 --- a/src/Models/Operations/LicenseKeysUpdateRequest.php +++ b/src/Models/Operations/LicenseKeysUpdateRequest.php @@ -29,6 +29,7 @@ class LicenseKeysUpdateRequest /** * @param string $id * @param Components\LicenseKeyUpdate $licenseKeyUpdate + * @phpstan-pure */ public function __construct(string $id, Components\LicenseKeyUpdate $licenseKeyUpdate) { diff --git a/src/Models/Operations/LicenseKeysUpdateResponse.php b/src/Models/Operations/LicenseKeysUpdateResponse.php index 56b9d82..eed3e24 100644 --- a/src/Models/Operations/LicenseKeysUpdateResponse.php +++ b/src/Models/Operations/LicenseKeysUpdateResponse.php @@ -44,6 +44,7 @@ class LicenseKeysUpdateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\LicenseKeyRead $licenseKeyRead + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\LicenseKeyRead $licenseKeyRead = null) { diff --git a/src/Models/Operations/MetersCreateResponse.php b/src/Models/Operations/MetersCreateResponse.php new file mode 100644 index 0000000..120d401 --- /dev/null +++ b/src/Models/Operations/MetersCreateResponse.php @@ -0,0 +1,56 @@ +contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + $this->meter = $meter; + } +} \ No newline at end of file diff --git a/src/Models/Operations/MetersEventsRequest.php b/src/Models/Operations/MetersEventsRequest.php new file mode 100644 index 0000000..b7ca9e4 --- /dev/null +++ b/src/Models/Operations/MetersEventsRequest.php @@ -0,0 +1,50 @@ +id = $id; + $this->page = $page; + $this->limit = $limit; + } +} \ No newline at end of file diff --git a/src/Models/Operations/MetersEventsResponse.php b/src/Models/Operations/MetersEventsResponse.php new file mode 100644 index 0000000..9dc053a --- /dev/null +++ b/src/Models/Operations/MetersEventsResponse.php @@ -0,0 +1,73 @@ +contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + $this->listResourceEvent = $listResourceEvent; + } + /** + * @param string $name + * @param array $args + * @return ?MetersEventsResponse + */ + public function __call($name, $args): ?MetersEventsResponse + { + if ($name === 'next') { + return call_user_func_array($this->next, $args); + } + + return null; + } +} \ No newline at end of file diff --git a/src/Models/Operations/MetersGetRequest.php b/src/Models/Operations/MetersGetRequest.php new file mode 100644 index 0000000..5dae2f6 --- /dev/null +++ b/src/Models/Operations/MetersGetRequest.php @@ -0,0 +1,30 @@ +id = $id; + } +} \ No newline at end of file diff --git a/src/Models/Operations/MetersGetResponse.php b/src/Models/Operations/MetersGetResponse.php new file mode 100644 index 0000000..d726742 --- /dev/null +++ b/src/Models/Operations/MetersGetResponse.php @@ -0,0 +1,56 @@ +contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + $this->meter = $meter; + } +} \ No newline at end of file diff --git a/src/Models/Operations/MetersListRequest.php b/src/Models/Operations/MetersListRequest.php new file mode 100644 index 0000000..532a9ad --- /dev/null +++ b/src/Models/Operations/MetersListRequest.php @@ -0,0 +1,81 @@ +|null $organizationId + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=organization_id')] + public string|array|null $organizationId = null; + + /** + * Filter by name. + * + * @var ?string $query + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=query')] + public ?string $query = null; + + /** + * Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. + * + * @var ?array $sorting + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=sorting')] + public ?array $sorting = null; + + /** + * Filter by metadata key-value pairs. It uses the `deepObject` style, e.g. `?metadata[key]=value`. + * + * @var ?array|array|array> $metadata + */ + #[SpeakeasyMetadata('queryParam:style=deepObject,explode=true,name=metadata')] + public ?array $metadata = null; + + /** + * Page number, defaults to 1. + * + * @var ?int $page + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=page')] + public ?int $page = null; + + /** + * Size of a page, defaults to 10. Maximum is 100. + * + * @var ?int $limit + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=limit')] + public ?int $limit = null; + + /** + * @param ?int $page + * @param ?int $limit + * @param string|array|null $organizationId + * @param ?string $query + * @param ?array $sorting + * @param ?array|array|array> $metadata + * @phpstan-pure + */ + public function __construct(string|array|null $organizationId = null, ?string $query = null, ?array $sorting = null, ?array $metadata = null, ?int $page = 1, ?int $limit = 10) + { + $this->organizationId = $organizationId; + $this->query = $query; + $this->sorting = $sorting; + $this->metadata = $metadata; + $this->page = $page; + $this->limit = $limit; + } +} \ No newline at end of file diff --git a/src/Models/Operations/MetersListResponse.php b/src/Models/Operations/MetersListResponse.php new file mode 100644 index 0000000..a8cfa91 --- /dev/null +++ b/src/Models/Operations/MetersListResponse.php @@ -0,0 +1,73 @@ +contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + $this->listResourceMeter = $listResourceMeter; + } + /** + * @param string $name + * @param array $args + * @return ?MetersListResponse + */ + public function __call($name, $args): ?MetersListResponse + { + if ($name === 'next') { + return call_user_func_array($this->next, $args); + } + + return null; + } +} \ No newline at end of file diff --git a/src/Models/Operations/MetersQuantitiesRequest.php b/src/Models/Operations/MetersQuantitiesRequest.php new file mode 100644 index 0000000..effd6d6 --- /dev/null +++ b/src/Models/Operations/MetersQuantitiesRequest.php @@ -0,0 +1,81 @@ +|null $customerId + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=customer_id')] + public string|array|null $customerId = null; + + /** + * Filter by external customer ID. + * + * @var string|array|null $exernalCustomerId + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=exernal_customer_id')] + public string|array|null $exernalCustomerId = null; + + /** + * @param string $id + * @param \DateTime $startTimestamp + * @param \DateTime $endTimestamp + * @param Components\TimeInterval $interval + * @param string|array|null $customerId + * @param string|array|null $exernalCustomerId + * @phpstan-pure + */ + public function __construct(string $id, \DateTime $startTimestamp, \DateTime $endTimestamp, Components\TimeInterval $interval, string|array|null $customerId = null, string|array|null $exernalCustomerId = null) + { + $this->id = $id; + $this->startTimestamp = $startTimestamp; + $this->endTimestamp = $endTimestamp; + $this->interval = $interval; + $this->customerId = $customerId; + $this->exernalCustomerId = $exernalCustomerId; + } +} \ No newline at end of file diff --git a/src/Models/Operations/MetersQuantitiesResponse.php b/src/Models/Operations/MetersQuantitiesResponse.php new file mode 100644 index 0000000..aa991d7 --- /dev/null +++ b/src/Models/Operations/MetersQuantitiesResponse.php @@ -0,0 +1,56 @@ +contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + $this->meterQuantities = $meterQuantities; + } +} \ No newline at end of file diff --git a/src/Models/Operations/MetersUpdateRequest.php b/src/Models/Operations/MetersUpdateRequest.php new file mode 100644 index 0000000..c028a95 --- /dev/null +++ b/src/Models/Operations/MetersUpdateRequest.php @@ -0,0 +1,40 @@ +id = $id; + $this->meterUpdate = $meterUpdate; + } +} \ No newline at end of file diff --git a/src/Models/Operations/MetersUpdateResponse.php b/src/Models/Operations/MetersUpdateResponse.php new file mode 100644 index 0000000..f163a06 --- /dev/null +++ b/src/Models/Operations/MetersUpdateResponse.php @@ -0,0 +1,56 @@ +contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + $this->meter = $meter; + } +} \ No newline at end of file diff --git a/src/Models/Operations/MetricsGetRequest.php b/src/Models/Operations/MetricsGetRequest.php index 3e164ab..52ec7e6 100644 --- a/src/Models/Operations/MetricsGetRequest.php +++ b/src/Models/Operations/MetricsGetRequest.php @@ -32,10 +32,10 @@ class MetricsGetRequest /** * Interval between two timestamps. * - * @var Components\Interval $interval + * @var Components\TimeInterval $interval */ #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=interval')] - public Components\Interval $interval; + public Components\TimeInterval $interval; /** * Filter by organization ID. @@ -61,15 +61,25 @@ class MetricsGetRequest #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=product_price_type')] public Components\ProductPriceType|array|null $productPriceType = null; + /** + * Filter by customer ID. + * + * @var string|array|null $customerId + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=customer_id')] + public string|array|null $customerId = null; + /** * @param LocalDate $startDate * @param LocalDate $endDate - * @param Components\Interval $interval + * @param Components\TimeInterval $interval * @param string|array|null $organizationId * @param string|array|null $productId * @param Components\ProductPriceType|array|null $productPriceType + * @param string|array|null $customerId + * @phpstan-pure */ - public function __construct(LocalDate $startDate, LocalDate $endDate, Components\Interval $interval, string|array|null $organizationId = null, string|array|null $productId = null, Components\ProductPriceType|array|null $productPriceType = null) + public function __construct(LocalDate $startDate, LocalDate $endDate, Components\TimeInterval $interval, string|array|null $organizationId = null, string|array|null $productId = null, Components\ProductPriceType|array|null $productPriceType = null, string|array|null $customerId = null) { $this->startDate = $startDate; $this->endDate = $endDate; @@ -77,5 +87,6 @@ public function __construct(LocalDate $startDate, LocalDate $endDate, Components $this->organizationId = $organizationId; $this->productId = $productId; $this->productPriceType = $productPriceType; + $this->customerId = $customerId; } } \ No newline at end of file diff --git a/src/Models/Operations/MetricsGetResponse.php b/src/Models/Operations/MetricsGetResponse.php index 231842e..c75a91f 100644 --- a/src/Models/Operations/MetricsGetResponse.php +++ b/src/Models/Operations/MetricsGetResponse.php @@ -44,6 +44,7 @@ class MetricsGetResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\MetricsResponse $metricsResponse + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\MetricsResponse $metricsResponse = null) { diff --git a/src/Models/Operations/MetricsLimitsResponse.php b/src/Models/Operations/MetricsLimitsResponse.php index 2dd0337..e45366f 100644 --- a/src/Models/Operations/MetricsLimitsResponse.php +++ b/src/Models/Operations/MetricsLimitsResponse.php @@ -44,6 +44,7 @@ class MetricsLimitsResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\MetricsLimits $metricsLimits + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\MetricsLimits $metricsLimits = null) { diff --git a/src/Models/Operations/Oauth2AuthorizeResponse.php b/src/Models/Operations/Oauth2AuthorizeResponse.php index daac89b..2deff3a 100644 --- a/src/Models/Operations/Oauth2AuthorizeResponse.php +++ b/src/Models/Operations/Oauth2AuthorizeResponse.php @@ -44,6 +44,7 @@ class Oauth2AuthorizeResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param Components\AuthorizeResponseUser|Components\AuthorizeResponseOrganization|null $responseOauth2Authorize + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, Components\AuthorizeResponseUser|Components\AuthorizeResponseOrganization|null $responseOauth2Authorize = null) { diff --git a/src/Models/Operations/Oauth2ClientsListRequest.php b/src/Models/Operations/Oauth2ClientsListRequest.php index 22252e0..41ae654 100644 --- a/src/Models/Operations/Oauth2ClientsListRequest.php +++ b/src/Models/Operations/Oauth2ClientsListRequest.php @@ -30,6 +30,7 @@ class Oauth2ClientsListRequest /** * @param ?int $page * @param ?int $limit + * @phpstan-pure */ public function __construct(?int $page = 1, ?int $limit = 10) { diff --git a/src/Models/Operations/Oauth2ClientsListResponse.php b/src/Models/Operations/Oauth2ClientsListResponse.php index dfba67a..c1a7dc3 100644 --- a/src/Models/Operations/Oauth2ClientsListResponse.php +++ b/src/Models/Operations/Oauth2ClientsListResponse.php @@ -48,6 +48,7 @@ class Oauth2ClientsListResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\ListResourceOAuth2Client $listResourceOAuth2Client + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\ListResourceOAuth2Client $listResourceOAuth2Client = null) { diff --git a/src/Models/Operations/Oauth2ClientsOauth2CreateClientResponse.php b/src/Models/Operations/Oauth2ClientsOauth2CreateClientResponse.php index 25db071..917f4c6 100644 --- a/src/Models/Operations/Oauth2ClientsOauth2CreateClientResponse.php +++ b/src/Models/Operations/Oauth2ClientsOauth2CreateClientResponse.php @@ -44,6 +44,7 @@ class Oauth2ClientsOauth2CreateClientResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param mixed $any + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, mixed $any = null) { diff --git a/src/Models/Operations/Oauth2ClientsOauth2DeleteClientRequest.php b/src/Models/Operations/Oauth2ClientsOauth2DeleteClientRequest.php index 61791d4..20784c6 100644 --- a/src/Models/Operations/Oauth2ClientsOauth2DeleteClientRequest.php +++ b/src/Models/Operations/Oauth2ClientsOauth2DeleteClientRequest.php @@ -20,6 +20,7 @@ class Oauth2ClientsOauth2DeleteClientRequest /** * @param string $clientId + * @phpstan-pure */ public function __construct(string $clientId) { diff --git a/src/Models/Operations/Oauth2ClientsOauth2DeleteClientResponse.php b/src/Models/Operations/Oauth2ClientsOauth2DeleteClientResponse.php index f8fd8d7..a9074e6 100644 --- a/src/Models/Operations/Oauth2ClientsOauth2DeleteClientResponse.php +++ b/src/Models/Operations/Oauth2ClientsOauth2DeleteClientResponse.php @@ -44,6 +44,7 @@ class Oauth2ClientsOauth2DeleteClientResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param mixed $any + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, mixed $any = null) { diff --git a/src/Models/Operations/Oauth2ClientsOauth2GetClientRequest.php b/src/Models/Operations/Oauth2ClientsOauth2GetClientRequest.php index 1b6068f..26680d3 100644 --- a/src/Models/Operations/Oauth2ClientsOauth2GetClientRequest.php +++ b/src/Models/Operations/Oauth2ClientsOauth2GetClientRequest.php @@ -20,6 +20,7 @@ class Oauth2ClientsOauth2GetClientRequest /** * @param string $clientId + * @phpstan-pure */ public function __construct(string $clientId) { diff --git a/src/Models/Operations/Oauth2ClientsOauth2GetClientResponse.php b/src/Models/Operations/Oauth2ClientsOauth2GetClientResponse.php index c4d8317..6858d82 100644 --- a/src/Models/Operations/Oauth2ClientsOauth2GetClientResponse.php +++ b/src/Models/Operations/Oauth2ClientsOauth2GetClientResponse.php @@ -44,6 +44,7 @@ class Oauth2ClientsOauth2GetClientResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param mixed $any + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, mixed $any = null) { diff --git a/src/Models/Operations/Oauth2ClientsOauth2UpdateClientRequest.php b/src/Models/Operations/Oauth2ClientsOauth2UpdateClientRequest.php index 144283d..b5e1b2e 100644 --- a/src/Models/Operations/Oauth2ClientsOauth2UpdateClientRequest.php +++ b/src/Models/Operations/Oauth2ClientsOauth2UpdateClientRequest.php @@ -29,6 +29,7 @@ class Oauth2ClientsOauth2UpdateClientRequest /** * @param string $clientId * @param Components\OAuth2ClientConfigurationUpdate $oAuth2ClientConfigurationUpdate + * @phpstan-pure */ public function __construct(string $clientId, Components\OAuth2ClientConfigurationUpdate $oAuth2ClientConfigurationUpdate) { diff --git a/src/Models/Operations/Oauth2ClientsOauth2UpdateClientResponse.php b/src/Models/Operations/Oauth2ClientsOauth2UpdateClientResponse.php index 7c7aaa5..10ae690 100644 --- a/src/Models/Operations/Oauth2ClientsOauth2UpdateClientResponse.php +++ b/src/Models/Operations/Oauth2ClientsOauth2UpdateClientResponse.php @@ -44,6 +44,7 @@ class Oauth2ClientsOauth2UpdateClientResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param mixed $any + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, mixed $any = null) { diff --git a/src/Models/Operations/Oauth2IntrospectTokenIntrospectTokenRequest.php b/src/Models/Operations/Oauth2IntrospectTokenIntrospectTokenRequest.php index 505ff1d..bd511ed 100644 --- a/src/Models/Operations/Oauth2IntrospectTokenIntrospectTokenRequest.php +++ b/src/Models/Operations/Oauth2IntrospectTokenIntrospectTokenRequest.php @@ -44,6 +44,7 @@ class Oauth2IntrospectTokenIntrospectTokenRequest * @param string $clientId * @param string $clientSecret * @param ?Oauth2IntrospectTokenTokenTypeHint $tokenTypeHint + * @phpstan-pure */ public function __construct(string $token, string $clientId, string $clientSecret, ?Oauth2IntrospectTokenTokenTypeHint $tokenTypeHint = null) { diff --git a/src/Models/Operations/Oauth2IntrospectTokenResponse.php b/src/Models/Operations/Oauth2IntrospectTokenResponse.php index 5823021..82cf731 100644 --- a/src/Models/Operations/Oauth2IntrospectTokenResponse.php +++ b/src/Models/Operations/Oauth2IntrospectTokenResponse.php @@ -44,6 +44,7 @@ class Oauth2IntrospectTokenResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\IntrospectTokenResponse $introspectTokenResponse + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\IntrospectTokenResponse $introspectTokenResponse = null) { diff --git a/src/Models/Operations/Oauth2RequestTokenResponse.php b/src/Models/Operations/Oauth2RequestTokenResponse.php index 91022d0..953e157 100644 --- a/src/Models/Operations/Oauth2RequestTokenResponse.php +++ b/src/Models/Operations/Oauth2RequestTokenResponse.php @@ -44,6 +44,7 @@ class Oauth2RequestTokenResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\TokenResponse $tokenResponse + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\TokenResponse $tokenResponse = null) { diff --git a/src/Models/Operations/Oauth2RevokeTokenResponse.php b/src/Models/Operations/Oauth2RevokeTokenResponse.php index 53053bf..70f9d12 100644 --- a/src/Models/Operations/Oauth2RevokeTokenResponse.php +++ b/src/Models/Operations/Oauth2RevokeTokenResponse.php @@ -44,6 +44,7 @@ class Oauth2RevokeTokenResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\RevokeTokenResponse $revokeTokenResponse + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\RevokeTokenResponse $revokeTokenResponse = null) { diff --git a/src/Models/Operations/Oauth2RevokeTokenRevokeTokenRequest.php b/src/Models/Operations/Oauth2RevokeTokenRevokeTokenRequest.php index f894d01..3bd088a 100644 --- a/src/Models/Operations/Oauth2RevokeTokenRevokeTokenRequest.php +++ b/src/Models/Operations/Oauth2RevokeTokenRevokeTokenRequest.php @@ -44,6 +44,7 @@ class Oauth2RevokeTokenRevokeTokenRequest * @param string $clientId * @param string $clientSecret * @param ?TokenTypeHint $tokenTypeHint + * @phpstan-pure */ public function __construct(string $token, string $clientId, string $clientSecret, ?TokenTypeHint $tokenTypeHint = null) { diff --git a/src/Models/Operations/Oauth2UserinfoResponse.php b/src/Models/Operations/Oauth2UserinfoResponse.php index be37d6a..a34ee92 100644 --- a/src/Models/Operations/Oauth2UserinfoResponse.php +++ b/src/Models/Operations/Oauth2UserinfoResponse.php @@ -44,6 +44,7 @@ class Oauth2UserinfoResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param Components\UserInfoUser|Components\UserInfoOrganization|null $responseOauth2Userinfo + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, Components\UserInfoUser|Components\UserInfoOrganization|null $responseOauth2Userinfo = null) { diff --git a/src/Models/Operations/OrdersGetRequest.php b/src/Models/Operations/OrdersGetRequest.php index 27982b0..e0ff767 100644 --- a/src/Models/Operations/OrdersGetRequest.php +++ b/src/Models/Operations/OrdersGetRequest.php @@ -21,6 +21,7 @@ class OrdersGetRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/OrdersGetResponse.php b/src/Models/Operations/OrdersGetResponse.php index c029012..8c9aa8b 100644 --- a/src/Models/Operations/OrdersGetResponse.php +++ b/src/Models/Operations/OrdersGetResponse.php @@ -44,6 +44,7 @@ class OrdersGetResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Order $order + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Order $order = null) { diff --git a/src/Models/Operations/OrdersInvoiceRequest.php b/src/Models/Operations/OrdersInvoiceRequest.php index 1f3a11a..0e0d210 100644 --- a/src/Models/Operations/OrdersInvoiceRequest.php +++ b/src/Models/Operations/OrdersInvoiceRequest.php @@ -21,6 +21,7 @@ class OrdersInvoiceRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/OrdersInvoiceResponse.php b/src/Models/Operations/OrdersInvoiceResponse.php index b18e3fb..f1c575d 100644 --- a/src/Models/Operations/OrdersInvoiceResponse.php +++ b/src/Models/Operations/OrdersInvoiceResponse.php @@ -44,6 +44,7 @@ class OrdersInvoiceResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\OrderInvoice $orderInvoice + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\OrderInvoice $orderInvoice = null) { diff --git a/src/Models/Operations/OrdersListRequest.php b/src/Models/Operations/OrdersListRequest.php index a99e692..4c34cee 100644 --- a/src/Models/Operations/OrdersListRequest.php +++ b/src/Models/Operations/OrdersListRequest.php @@ -85,6 +85,7 @@ class OrdersListRequest * @param string|array|null $discountId * @param string|array|null $customerId * @param ?array $sorting + * @phpstan-pure */ public function __construct(string|array|null $organizationId = null, string|array|null $productId = null, Components\ProductPriceType|array|null $productPriceType = null, string|array|null $discountId = null, string|array|null $customerId = null, ?array $sorting = null, ?int $page = 1, ?int $limit = 10) { diff --git a/src/Models/Operations/OrdersListResponse.php b/src/Models/Operations/OrdersListResponse.php index 78732f8..dde7a94 100644 --- a/src/Models/Operations/OrdersListResponse.php +++ b/src/Models/Operations/OrdersListResponse.php @@ -48,6 +48,7 @@ class OrdersListResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\ListResourceOrder $listResourceOrder + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\ListResourceOrder $listResourceOrder = null) { diff --git a/src/Models/Operations/OrganizationsCreateResponse.php b/src/Models/Operations/OrganizationsCreateResponse.php index 1e73f0d..44fc779 100644 --- a/src/Models/Operations/OrganizationsCreateResponse.php +++ b/src/Models/Operations/OrganizationsCreateResponse.php @@ -44,6 +44,7 @@ class OrganizationsCreateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Organization $organization + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Organization $organization = null) { diff --git a/src/Models/Operations/OrganizationsGetRequest.php b/src/Models/Operations/OrganizationsGetRequest.php index 60db6f4..5dc6a3e 100644 --- a/src/Models/Operations/OrganizationsGetRequest.php +++ b/src/Models/Operations/OrganizationsGetRequest.php @@ -20,6 +20,7 @@ class OrganizationsGetRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/OrganizationsGetResponse.php b/src/Models/Operations/OrganizationsGetResponse.php index 0b4c268..40b7ecb 100644 --- a/src/Models/Operations/OrganizationsGetResponse.php +++ b/src/Models/Operations/OrganizationsGetResponse.php @@ -44,6 +44,7 @@ class OrganizationsGetResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Organization $organization + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Organization $organization = null) { diff --git a/src/Models/Operations/OrganizationsListRequest.php b/src/Models/Operations/OrganizationsListRequest.php index 7b05c66..819c0c7 100644 --- a/src/Models/Operations/OrganizationsListRequest.php +++ b/src/Models/Operations/OrganizationsListRequest.php @@ -49,6 +49,7 @@ class OrganizationsListRequest * @param ?int $limit * @param ?string $slug * @param ?array $sorting + * @phpstan-pure */ public function __construct(?string $slug = null, ?array $sorting = null, ?int $page = 1, ?int $limit = 10) { diff --git a/src/Models/Operations/OrganizationsListResponse.php b/src/Models/Operations/OrganizationsListResponse.php index e59ea35..699d980 100644 --- a/src/Models/Operations/OrganizationsListResponse.php +++ b/src/Models/Operations/OrganizationsListResponse.php @@ -48,6 +48,7 @@ class OrganizationsListResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\ListResourceOrganization $listResourceOrganization + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\ListResourceOrganization $listResourceOrganization = null) { diff --git a/src/Models/Operations/OrganizationsUpdateRequest.php b/src/Models/Operations/OrganizationsUpdateRequest.php index 13e8fd3..6927151 100644 --- a/src/Models/Operations/OrganizationsUpdateRequest.php +++ b/src/Models/Operations/OrganizationsUpdateRequest.php @@ -29,6 +29,7 @@ class OrganizationsUpdateRequest /** * @param string $id * @param Components\OrganizationUpdate $organizationUpdate + * @phpstan-pure */ public function __construct(string $id, Components\OrganizationUpdate $organizationUpdate) { diff --git a/src/Models/Operations/OrganizationsUpdateResponse.php b/src/Models/Operations/OrganizationsUpdateResponse.php index d0f8777..05bf896 100644 --- a/src/Models/Operations/OrganizationsUpdateResponse.php +++ b/src/Models/Operations/OrganizationsUpdateResponse.php @@ -44,6 +44,7 @@ class OrganizationsUpdateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Organization $organization + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Organization $organization = null) { diff --git a/src/Models/Operations/ProductsCreateResponse.php b/src/Models/Operations/ProductsCreateResponse.php index 9352e5f..d68c83c 100644 --- a/src/Models/Operations/ProductsCreateResponse.php +++ b/src/Models/Operations/ProductsCreateResponse.php @@ -44,6 +44,7 @@ class ProductsCreateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Product $product + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Product $product = null) { diff --git a/src/Models/Operations/ProductsGetRequest.php b/src/Models/Operations/ProductsGetRequest.php index 00e2bb5..f323706 100644 --- a/src/Models/Operations/ProductsGetRequest.php +++ b/src/Models/Operations/ProductsGetRequest.php @@ -20,6 +20,7 @@ class ProductsGetRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/ProductsGetResponse.php b/src/Models/Operations/ProductsGetResponse.php index ea51ec1..0783d53 100644 --- a/src/Models/Operations/ProductsGetResponse.php +++ b/src/Models/Operations/ProductsGetResponse.php @@ -44,6 +44,7 @@ class ProductsGetResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Product $product + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Product $product = null) { diff --git a/src/Models/Operations/ProductsListRequest.php b/src/Models/Operations/ProductsListRequest.php index 3db8de1..3f72043 100644 --- a/src/Models/Operations/ProductsListRequest.php +++ b/src/Models/Operations/ProductsListRequest.php @@ -12,6 +12,14 @@ use Polar\Utils\SpeakeasyMetadata; class ProductsListRequest { + /** + * Filter by product ID. + * + * @var string|array|null $id + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=id')] + public string|array|null $id = null; + /** * Filter by organization ID. * @@ -79,15 +87,18 @@ class ProductsListRequest /** * @param ?int $page * @param ?int $limit + * @param string|array|null $id * @param string|array|null $organizationId * @param ?string $query * @param ?bool $isArchived * @param ?bool $isRecurring * @param string|array|null $benefitId * @param ?array $sorting + * @phpstan-pure */ - public function __construct(string|array|null $organizationId = null, ?string $query = null, ?bool $isArchived = null, ?bool $isRecurring = null, string|array|null $benefitId = null, ?array $sorting = null, ?int $page = 1, ?int $limit = 10) + public function __construct(string|array|null $id = null, string|array|null $organizationId = null, ?string $query = null, ?bool $isArchived = null, ?bool $isRecurring = null, string|array|null $benefitId = null, ?array $sorting = null, ?int $page = 1, ?int $limit = 10) { + $this->id = $id; $this->organizationId = $organizationId; $this->query = $query; $this->isArchived = $isArchived; diff --git a/src/Models/Operations/ProductsListResponse.php b/src/Models/Operations/ProductsListResponse.php index 3d75652..669b3b6 100644 --- a/src/Models/Operations/ProductsListResponse.php +++ b/src/Models/Operations/ProductsListResponse.php @@ -48,6 +48,7 @@ class ProductsListResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\ListResourceProduct $listResourceProduct + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\ListResourceProduct $listResourceProduct = null) { diff --git a/src/Models/Operations/ProductsUpdateBenefitsRequest.php b/src/Models/Operations/ProductsUpdateBenefitsRequest.php index 824b03c..fadc865 100644 --- a/src/Models/Operations/ProductsUpdateBenefitsRequest.php +++ b/src/Models/Operations/ProductsUpdateBenefitsRequest.php @@ -29,6 +29,7 @@ class ProductsUpdateBenefitsRequest /** * @param string $id * @param Components\ProductBenefitsUpdate $productBenefitsUpdate + * @phpstan-pure */ public function __construct(string $id, Components\ProductBenefitsUpdate $productBenefitsUpdate) { diff --git a/src/Models/Operations/ProductsUpdateBenefitsResponse.php b/src/Models/Operations/ProductsUpdateBenefitsResponse.php index f2d68c9..f26733e 100644 --- a/src/Models/Operations/ProductsUpdateBenefitsResponse.php +++ b/src/Models/Operations/ProductsUpdateBenefitsResponse.php @@ -44,6 +44,7 @@ class ProductsUpdateBenefitsResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Product $product + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Product $product = null) { diff --git a/src/Models/Operations/ProductsUpdateRequest.php b/src/Models/Operations/ProductsUpdateRequest.php index 18d5858..d684b11 100644 --- a/src/Models/Operations/ProductsUpdateRequest.php +++ b/src/Models/Operations/ProductsUpdateRequest.php @@ -29,6 +29,7 @@ class ProductsUpdateRequest /** * @param string $id * @param Components\ProductUpdate $productUpdate + * @phpstan-pure */ public function __construct(string $id, Components\ProductUpdate $productUpdate) { diff --git a/src/Models/Operations/ProductsUpdateResponse.php b/src/Models/Operations/ProductsUpdateResponse.php index a5fd0f5..fa4bfa7 100644 --- a/src/Models/Operations/ProductsUpdateResponse.php +++ b/src/Models/Operations/ProductsUpdateResponse.php @@ -44,6 +44,7 @@ class ProductsUpdateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Product $product + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Product $product = null) { diff --git a/src/Models/Operations/RefundsCreateResponse.php b/src/Models/Operations/RefundsCreateResponse.php new file mode 100644 index 0000000..ce123b8 --- /dev/null +++ b/src/Models/Operations/RefundsCreateResponse.php @@ -0,0 +1,56 @@ +contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + $this->refund = $refund; + } +} \ No newline at end of file diff --git a/src/Models/Operations/RefundsListRequest.php b/src/Models/Operations/RefundsListRequest.php new file mode 100644 index 0000000..2fafffe --- /dev/null +++ b/src/Models/Operations/RefundsListRequest.php @@ -0,0 +1,111 @@ +|null $id + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=id')] + public string|array|null $id = null; + + /** + * Filter by organization ID. + * + * @var string|array|null $organizationId + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=organization_id')] + public string|array|null $organizationId = null; + + /** + * Filter by order ID. + * + * @var string|array|null $orderId + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=order_id')] + public string|array|null $orderId = null; + + /** + * Filter by subscription ID. + * + * @var string|array|null $subscriptionId + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=subscription_id')] + public string|array|null $subscriptionId = null; + + /** + * Filter by customer ID. + * + * @var string|array|null $customerId + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=customer_id')] + public string|array|null $customerId = null; + + /** + * Filter by `succeeded`. + * + * @var ?bool $succeeded + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=succeeded')] + public ?bool $succeeded = null; + + /** + * Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order. + * + * @var ?array $sorting + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=sorting')] + public ?array $sorting = null; + + /** + * Page number, defaults to 1. + * + * @var ?int $page + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=page')] + public ?int $page = null; + + /** + * Size of a page, defaults to 10. Maximum is 100. + * + * @var ?int $limit + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=limit')] + public ?int $limit = null; + + /** + * @param ?int $page + * @param ?int $limit + * @param string|array|null $id + * @param string|array|null $organizationId + * @param string|array|null $orderId + * @param string|array|null $subscriptionId + * @param string|array|null $customerId + * @param ?bool $succeeded + * @param ?array $sorting + * @phpstan-pure + */ + public function __construct(string|array|null $id = null, string|array|null $organizationId = null, string|array|null $orderId = null, string|array|null $subscriptionId = null, string|array|null $customerId = null, ?bool $succeeded = null, ?array $sorting = null, ?int $page = 1, ?int $limit = 10) + { + $this->id = $id; + $this->organizationId = $organizationId; + $this->orderId = $orderId; + $this->subscriptionId = $subscriptionId; + $this->customerId = $customerId; + $this->succeeded = $succeeded; + $this->sorting = $sorting; + $this->page = $page; + $this->limit = $limit; + } +} \ No newline at end of file diff --git a/src/Models/Operations/RefundsListResponse.php b/src/Models/Operations/RefundsListResponse.php new file mode 100644 index 0000000..d0d087b --- /dev/null +++ b/src/Models/Operations/RefundsListResponse.php @@ -0,0 +1,73 @@ +contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + $this->listResourceRefund = $listResourceRefund; + } + /** + * @param string $name + * @param array $args + * @return ?RefundsListResponse + */ + public function __call($name, $args): ?RefundsListResponse + { + if ($name === 'next') { + return call_user_func_array($this->next, $args); + } + + return null; + } +} \ No newline at end of file diff --git a/src/Models/Operations/RepositoriesGetRequest.php b/src/Models/Operations/RepositoriesGetRequest.php index 3fb59ca..dfeafb1 100644 --- a/src/Models/Operations/RepositoriesGetRequest.php +++ b/src/Models/Operations/RepositoriesGetRequest.php @@ -20,6 +20,7 @@ class RepositoriesGetRequest /** * @param string $id + * @phpstan-pure */ public function __construct(string $id) { diff --git a/src/Models/Operations/RepositoriesGetResponse.php b/src/Models/Operations/RepositoriesGetResponse.php index 1652c01..aacac1f 100644 --- a/src/Models/Operations/RepositoriesGetResponse.php +++ b/src/Models/Operations/RepositoriesGetResponse.php @@ -44,6 +44,7 @@ class RepositoriesGetResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Repository $repository + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Repository $repository = null) { diff --git a/src/Models/Operations/RepositoriesListRequest.php b/src/Models/Operations/RepositoriesListRequest.php index 7dfb87e..65bcc88 100644 --- a/src/Models/Operations/RepositoriesListRequest.php +++ b/src/Models/Operations/RepositoriesListRequest.php @@ -85,6 +85,7 @@ class RepositoriesListRequest * @param ?bool $isPrivate * @param string|array|null $organizationId * @param ?array $sorting + * @phpstan-pure */ public function __construct(Components\Platforms|array|null $platform = null, string|array|null $name = null, string|array|null $externalOrganizationName = null, ?bool $isPrivate = null, string|array|null $organizationId = null, ?array $sorting = null, ?int $page = 1, ?int $limit = 10) { diff --git a/src/Models/Operations/RepositoriesListResponse.php b/src/Models/Operations/RepositoriesListResponse.php index 70cdab7..4fd5511 100644 --- a/src/Models/Operations/RepositoriesListResponse.php +++ b/src/Models/Operations/RepositoriesListResponse.php @@ -48,6 +48,7 @@ class RepositoriesListResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\ListResourceRepository $listResourceRepository + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\ListResourceRepository $listResourceRepository = null) { diff --git a/src/Models/Operations/RepositoriesUpdateRequest.php b/src/Models/Operations/RepositoriesUpdateRequest.php index 6262042..6bdccb5 100644 --- a/src/Models/Operations/RepositoriesUpdateRequest.php +++ b/src/Models/Operations/RepositoriesUpdateRequest.php @@ -29,6 +29,7 @@ class RepositoriesUpdateRequest /** * @param string $id * @param Components\RepositoryUpdate $repositoryUpdate + * @phpstan-pure */ public function __construct(string $id, Components\RepositoryUpdate $repositoryUpdate) { diff --git a/src/Models/Operations/RepositoriesUpdateResponse.php b/src/Models/Operations/RepositoriesUpdateResponse.php index c12a97f..5d211a0 100644 --- a/src/Models/Operations/RepositoriesUpdateResponse.php +++ b/src/Models/Operations/RepositoriesUpdateResponse.php @@ -44,6 +44,7 @@ class RepositoriesUpdateResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\Repository $repository + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\Repository $repository = null) { diff --git a/src/Models/Operations/SubscriptionsExportRequest.php b/src/Models/Operations/SubscriptionsExportRequest.php index 5e1417b..3270140 100644 --- a/src/Models/Operations/SubscriptionsExportRequest.php +++ b/src/Models/Operations/SubscriptionsExportRequest.php @@ -21,6 +21,7 @@ class SubscriptionsExportRequest /** * @param string|array|null $organizationId + * @phpstan-pure */ public function __construct(string|array|null $organizationId = null) { diff --git a/src/Models/Operations/SubscriptionsExportResponse.php b/src/Models/Operations/SubscriptionsExportResponse.php index fa6afd4..bb082a7 100644 --- a/src/Models/Operations/SubscriptionsExportResponse.php +++ b/src/Models/Operations/SubscriptionsExportResponse.php @@ -44,6 +44,7 @@ class SubscriptionsExportResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param mixed $any + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, mixed $any = null) { diff --git a/src/Models/Operations/SubscriptionsGetRequest.php b/src/Models/Operations/SubscriptionsGetRequest.php new file mode 100644 index 0000000..c044d0d --- /dev/null +++ b/src/Models/Operations/SubscriptionsGetRequest.php @@ -0,0 +1,30 @@ +id = $id; + } +} \ No newline at end of file diff --git a/src/Models/Operations/SubscriptionsGetResponse.php b/src/Models/Operations/SubscriptionsGetResponse.php new file mode 100644 index 0000000..85de61b --- /dev/null +++ b/src/Models/Operations/SubscriptionsGetResponse.php @@ -0,0 +1,56 @@ +contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + $this->subscription = $subscription; + } +} \ No newline at end of file diff --git a/src/Models/Operations/SubscriptionsListRequest.php b/src/Models/Operations/SubscriptionsListRequest.php index 1b8050e..b38150a 100644 --- a/src/Models/Operations/SubscriptionsListRequest.php +++ b/src/Models/Operations/SubscriptionsListRequest.php @@ -85,6 +85,7 @@ class SubscriptionsListRequest * @param string|array|null $discountId * @param ?bool $active * @param ?array $sorting + * @phpstan-pure */ public function __construct(string|array|null $organizationId = null, string|array|null $productId = null, string|array|null $customerId = null, string|array|null $discountId = null, ?bool $active = null, ?array $sorting = null, ?int $page = 1, ?int $limit = 10) { diff --git a/src/Models/Operations/SubscriptionsListResponse.php b/src/Models/Operations/SubscriptionsListResponse.php index afefd00..99d1470 100644 --- a/src/Models/Operations/SubscriptionsListResponse.php +++ b/src/Models/Operations/SubscriptionsListResponse.php @@ -48,6 +48,7 @@ class SubscriptionsListResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param ?Components\ListResourceSubscription $listResourceSubscription + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?Components\ListResourceSubscription $listResourceSubscription = null) { diff --git a/src/Models/Operations/SubscriptionsRevokeRequest.php b/src/Models/Operations/SubscriptionsRevokeRequest.php new file mode 100644 index 0000000..2c10836 --- /dev/null +++ b/src/Models/Operations/SubscriptionsRevokeRequest.php @@ -0,0 +1,30 @@ +id = $id; + } +} \ No newline at end of file diff --git a/src/Models/Operations/SubscriptionsRevokeResponse.php b/src/Models/Operations/SubscriptionsRevokeResponse.php new file mode 100644 index 0000000..d6a0d79 --- /dev/null +++ b/src/Models/Operations/SubscriptionsRevokeResponse.php @@ -0,0 +1,56 @@ +contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + $this->subscription = $subscription; + } +} \ No newline at end of file diff --git a/src/Models/Operations/SubscriptionsUpdateRequest.php b/src/Models/Operations/SubscriptionsUpdateRequest.php new file mode 100644 index 0000000..74296c3 --- /dev/null +++ b/src/Models/Operations/SubscriptionsUpdateRequest.php @@ -0,0 +1,40 @@ +id = $id; + $this->subscriptionUpdate = $subscriptionUpdate; + } +} \ No newline at end of file diff --git a/src/Models/Operations/SubscriptionsUpdateResponse.php b/src/Models/Operations/SubscriptionsUpdateResponse.php new file mode 100644 index 0000000..fc6c367 --- /dev/null +++ b/src/Models/Operations/SubscriptionsUpdateResponse.php @@ -0,0 +1,56 @@ +contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + $this->subscription = $subscription; + } +} \ No newline at end of file diff --git a/src/Models/Webhooks/EndpointbenefitCreatedPostResponse.php b/src/Models/Webhooks/EndpointbenefitCreatedPostResponse.php index 52b766e..3d3b695 100644 --- a/src/Models/Webhooks/EndpointbenefitCreatedPostResponse.php +++ b/src/Models/Webhooks/EndpointbenefitCreatedPostResponse.php @@ -44,6 +44,7 @@ class EndpointbenefitCreatedPostResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param mixed $any + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, mixed $any = null) { diff --git a/src/Models/Webhooks/EndpointbenefitGrantCreatedPostResponse.php b/src/Models/Webhooks/EndpointbenefitGrantCreatedPostResponse.php index c93833b..6bd8768 100644 --- a/src/Models/Webhooks/EndpointbenefitGrantCreatedPostResponse.php +++ b/src/Models/Webhooks/EndpointbenefitGrantCreatedPostResponse.php @@ -44,6 +44,7 @@ class EndpointbenefitGrantCreatedPostResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param mixed $any + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, mixed $any = null) { diff --git a/src/Models/Webhooks/EndpointbenefitGrantRevokedPostResponse.php b/src/Models/Webhooks/EndpointbenefitGrantRevokedPostResponse.php index 7d3fd20..33791b9 100644 --- a/src/Models/Webhooks/EndpointbenefitGrantRevokedPostResponse.php +++ b/src/Models/Webhooks/EndpointbenefitGrantRevokedPostResponse.php @@ -44,6 +44,7 @@ class EndpointbenefitGrantRevokedPostResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param mixed $any + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, mixed $any = null) { diff --git a/src/Models/Webhooks/EndpointbenefitGrantUpdatedPostResponse.php b/src/Models/Webhooks/EndpointbenefitGrantUpdatedPostResponse.php index 7acf1d7..ba71234 100644 --- a/src/Models/Webhooks/EndpointbenefitGrantUpdatedPostResponse.php +++ b/src/Models/Webhooks/EndpointbenefitGrantUpdatedPostResponse.php @@ -44,6 +44,7 @@ class EndpointbenefitGrantUpdatedPostResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param mixed $any + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, mixed $any = null) { diff --git a/src/Models/Webhooks/EndpointbenefitUpdatedPostResponse.php b/src/Models/Webhooks/EndpointbenefitUpdatedPostResponse.php index 3f587b9..fa17db4 100644 --- a/src/Models/Webhooks/EndpointbenefitUpdatedPostResponse.php +++ b/src/Models/Webhooks/EndpointbenefitUpdatedPostResponse.php @@ -44,6 +44,7 @@ class EndpointbenefitUpdatedPostResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param mixed $any + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, mixed $any = null) { diff --git a/src/Models/Webhooks/EndpointcheckoutCreatedPostResponse.php b/src/Models/Webhooks/EndpointcheckoutCreatedPostResponse.php index b2c3530..d6b05ae 100644 --- a/src/Models/Webhooks/EndpointcheckoutCreatedPostResponse.php +++ b/src/Models/Webhooks/EndpointcheckoutCreatedPostResponse.php @@ -44,6 +44,7 @@ class EndpointcheckoutCreatedPostResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param mixed $any + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, mixed $any = null) { diff --git a/src/Models/Webhooks/EndpointcheckoutUpdatedPostResponse.php b/src/Models/Webhooks/EndpointcheckoutUpdatedPostResponse.php index c44e876..95e7143 100644 --- a/src/Models/Webhooks/EndpointcheckoutUpdatedPostResponse.php +++ b/src/Models/Webhooks/EndpointcheckoutUpdatedPostResponse.php @@ -44,6 +44,7 @@ class EndpointcheckoutUpdatedPostResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param mixed $any + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, mixed $any = null) { diff --git a/src/Models/Webhooks/EndpointorderCreatedPostResponse.php b/src/Models/Webhooks/EndpointorderCreatedPostResponse.php index fb20846..c2011df 100644 --- a/src/Models/Webhooks/EndpointorderCreatedPostResponse.php +++ b/src/Models/Webhooks/EndpointorderCreatedPostResponse.php @@ -44,6 +44,7 @@ class EndpointorderCreatedPostResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param mixed $any + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, mixed $any = null) { diff --git a/src/Models/Webhooks/EndpointorderRefundedPostResponse.php b/src/Models/Webhooks/EndpointorderRefundedPostResponse.php new file mode 100644 index 0000000..a439d4f --- /dev/null +++ b/src/Models/Webhooks/EndpointorderRefundedPostResponse.php @@ -0,0 +1,56 @@ +contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + $this->any = $any; + } +} \ No newline at end of file diff --git a/src/Models/Webhooks/EndpointorganizationUpdatedPostResponse.php b/src/Models/Webhooks/EndpointorganizationUpdatedPostResponse.php index 5297b18..b548f8d 100644 --- a/src/Models/Webhooks/EndpointorganizationUpdatedPostResponse.php +++ b/src/Models/Webhooks/EndpointorganizationUpdatedPostResponse.php @@ -44,6 +44,7 @@ class EndpointorganizationUpdatedPostResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param mixed $any + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, mixed $any = null) { diff --git a/src/Models/Webhooks/EndpointpledgeCreatedPostResponse.php b/src/Models/Webhooks/EndpointpledgeCreatedPostResponse.php index 1080a38..2bf0a0b 100644 --- a/src/Models/Webhooks/EndpointpledgeCreatedPostResponse.php +++ b/src/Models/Webhooks/EndpointpledgeCreatedPostResponse.php @@ -44,6 +44,7 @@ class EndpointpledgeCreatedPostResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param mixed $any + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, mixed $any = null) { diff --git a/src/Models/Webhooks/EndpointpledgeUpdatedPostResponse.php b/src/Models/Webhooks/EndpointpledgeUpdatedPostResponse.php index 22e96ef..10d1b16 100644 --- a/src/Models/Webhooks/EndpointpledgeUpdatedPostResponse.php +++ b/src/Models/Webhooks/EndpointpledgeUpdatedPostResponse.php @@ -44,6 +44,7 @@ class EndpointpledgeUpdatedPostResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param mixed $any + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, mixed $any = null) { diff --git a/src/Models/Webhooks/EndpointproductCreatedPostResponse.php b/src/Models/Webhooks/EndpointproductCreatedPostResponse.php index 870827f..47cd3c1 100644 --- a/src/Models/Webhooks/EndpointproductCreatedPostResponse.php +++ b/src/Models/Webhooks/EndpointproductCreatedPostResponse.php @@ -44,6 +44,7 @@ class EndpointproductCreatedPostResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param mixed $any + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, mixed $any = null) { diff --git a/src/Models/Webhooks/EndpointproductUpdatedPostResponse.php b/src/Models/Webhooks/EndpointproductUpdatedPostResponse.php index 3b37258..12dd00b 100644 --- a/src/Models/Webhooks/EndpointproductUpdatedPostResponse.php +++ b/src/Models/Webhooks/EndpointproductUpdatedPostResponse.php @@ -44,6 +44,7 @@ class EndpointproductUpdatedPostResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param mixed $any + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, mixed $any = null) { diff --git a/src/Models/Webhooks/EndpointrefundCreatedPostResponse.php b/src/Models/Webhooks/EndpointrefundCreatedPostResponse.php new file mode 100644 index 0000000..a2f9b18 --- /dev/null +++ b/src/Models/Webhooks/EndpointrefundCreatedPostResponse.php @@ -0,0 +1,56 @@ +contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + $this->any = $any; + } +} \ No newline at end of file diff --git a/src/Models/Webhooks/EndpointrefundUpdatedPostResponse.php b/src/Models/Webhooks/EndpointrefundUpdatedPostResponse.php new file mode 100644 index 0000000..d263f60 --- /dev/null +++ b/src/Models/Webhooks/EndpointrefundUpdatedPostResponse.php @@ -0,0 +1,56 @@ +contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + $this->any = $any; + } +} \ No newline at end of file diff --git a/src/Models/Webhooks/EndpointsubscriptionActivePostResponse.php b/src/Models/Webhooks/EndpointsubscriptionActivePostResponse.php index 32e2910..ba2e507 100644 --- a/src/Models/Webhooks/EndpointsubscriptionActivePostResponse.php +++ b/src/Models/Webhooks/EndpointsubscriptionActivePostResponse.php @@ -44,6 +44,7 @@ class EndpointsubscriptionActivePostResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param mixed $any + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, mixed $any = null) { diff --git a/src/Models/Webhooks/EndpointsubscriptionCanceledPostResponse.php b/src/Models/Webhooks/EndpointsubscriptionCanceledPostResponse.php index 3445c4b..dcb3ddd 100644 --- a/src/Models/Webhooks/EndpointsubscriptionCanceledPostResponse.php +++ b/src/Models/Webhooks/EndpointsubscriptionCanceledPostResponse.php @@ -44,6 +44,7 @@ class EndpointsubscriptionCanceledPostResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param mixed $any + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, mixed $any = null) { diff --git a/src/Models/Webhooks/EndpointsubscriptionCreatedPostResponse.php b/src/Models/Webhooks/EndpointsubscriptionCreatedPostResponse.php index 90e6863..ea4f278 100644 --- a/src/Models/Webhooks/EndpointsubscriptionCreatedPostResponse.php +++ b/src/Models/Webhooks/EndpointsubscriptionCreatedPostResponse.php @@ -44,6 +44,7 @@ class EndpointsubscriptionCreatedPostResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param mixed $any + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, mixed $any = null) { diff --git a/src/Models/Webhooks/EndpointsubscriptionRevokedPostResponse.php b/src/Models/Webhooks/EndpointsubscriptionRevokedPostResponse.php index 0eae1e3..f9db21e 100644 --- a/src/Models/Webhooks/EndpointsubscriptionRevokedPostResponse.php +++ b/src/Models/Webhooks/EndpointsubscriptionRevokedPostResponse.php @@ -44,6 +44,7 @@ class EndpointsubscriptionRevokedPostResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param mixed $any + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, mixed $any = null) { diff --git a/src/Models/Webhooks/EndpointsubscriptionUncanceledPostResponse.php b/src/Models/Webhooks/EndpointsubscriptionUncanceledPostResponse.php new file mode 100644 index 0000000..c1cdac7 --- /dev/null +++ b/src/Models/Webhooks/EndpointsubscriptionUncanceledPostResponse.php @@ -0,0 +1,56 @@ +contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + $this->any = $any; + } +} \ No newline at end of file diff --git a/src/Models/Webhooks/EndpointsubscriptionUpdatedPostResponse.php b/src/Models/Webhooks/EndpointsubscriptionUpdatedPostResponse.php index fc5e1d2..ca98e0c 100644 --- a/src/Models/Webhooks/EndpointsubscriptionUpdatedPostResponse.php +++ b/src/Models/Webhooks/EndpointsubscriptionUpdatedPostResponse.php @@ -44,6 +44,7 @@ class EndpointsubscriptionUpdatedPostResponse * @param int $statusCode * @param \Psr\Http\Message\ResponseInterface $rawResponse * @param mixed $any + * @phpstan-pure */ public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, mixed $any = null) { diff --git a/src/Oauth2.php b/src/Oauth2.php index a848207..6a6dab9 100644 --- a/src/Oauth2.php +++ b/src/Oauth2.php @@ -11,6 +11,7 @@ use Polar\Hooks\HookContext; use Polar\Models\Components; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class Oauth2 @@ -53,37 +54,33 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\Oauth2AuthorizeResponse * @throws \Polar\Models\Errors\APIException */ - public function authorize(): Operations\Oauth2AuthorizeResponse + public function authorize(?Options $options = null): Operations\Oauth2AuthorizeResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/oauth2/authorize'); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('oauth2:authorize', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -100,7 +97,9 @@ public function authorize(): Operations\Oauth2AuthorizeResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -116,42 +115,38 @@ public function authorize(): Operations\Oauth2AuthorizeResponse * @return Operations\Oauth2IntrospectTokenResponse * @throws \Polar\Models\Errors\APIException */ - public function introspect(Operations\Oauth2IntrospectTokenIntrospectTokenRequest $request): Operations\Oauth2IntrospectTokenResponse + public function introspect(Operations\Oauth2IntrospectTokenIntrospectTokenRequest $request, ?Options $options = null): Operations\Oauth2IntrospectTokenResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/oauth2/introspect'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'request', 'form'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); $hookContext = new HookContext('oauth2:introspect_token', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -168,7 +163,9 @@ public function introspect(Operations\Oauth2IntrospectTokenIntrospectTokenReques } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -184,42 +181,38 @@ public function introspect(Operations\Oauth2IntrospectTokenIntrospectTokenReques * @return Operations\Oauth2RequestTokenResponse * @throws \Polar\Models\Errors\APIException */ - public function token(Components\Onev11oauth21tokenPostXComponentsAuthorizationCodeTokenRequest|Components\Onev11oauth21tokenPostXComponentsRefreshTokenRequest $request): Operations\Oauth2RequestTokenResponse + public function token(Components\Onev11oauth21tokenPostXComponentsAuthorizationCodeTokenRequest|Components\Onev11oauth21tokenPostXComponentsRefreshTokenRequest $request, ?Options $options = null): Operations\Oauth2RequestTokenResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/oauth2/token'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'request', 'form'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); $hookContext = new HookContext('oauth2:request_token', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -236,7 +229,9 @@ public function token(Components\Onev11oauth21tokenPostXComponentsAuthorizationC } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -252,42 +247,38 @@ public function token(Components\Onev11oauth21tokenPostXComponentsAuthorizationC * @return Operations\Oauth2RevokeTokenResponse * @throws \Polar\Models\Errors\APIException */ - public function revoke(Operations\Oauth2RevokeTokenRevokeTokenRequest $request): Operations\Oauth2RevokeTokenResponse + public function revoke(Operations\Oauth2RevokeTokenRevokeTokenRequest $request, ?Options $options = null): Operations\Oauth2RevokeTokenResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/oauth2/revoke'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'request', 'form'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); $hookContext = new HookContext('oauth2:revoke_token', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -304,7 +295,9 @@ public function revoke(Operations\Oauth2RevokeTokenRevokeTokenRequest $request): } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -319,37 +312,33 @@ public function revoke(Operations\Oauth2RevokeTokenRevokeTokenRequest $request): * @return Operations\Oauth2UserinfoResponse * @throws \Polar\Models\Errors\APIException */ - public function userinfo(): Operations\Oauth2UserinfoResponse + public function userinfo(?Options $options = null): Operations\Oauth2UserinfoResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/oauth2/userinfo'); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('oauth2:userinfo', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -366,7 +355,9 @@ public function userinfo(): Operations\Oauth2UserinfoResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/Orders.php b/src/Orders.php index 086a063..dbb079b 100644 --- a/src/Orders.php +++ b/src/Orders.php @@ -9,8 +9,8 @@ namespace Polar; use Polar\Hooks\HookContext; -use Polar\Models\Components; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class Orders @@ -53,7 +53,7 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\OrdersGetResponse * @throws \Polar\Models\Errors\APIException */ - public function get(string $id): Operations\OrdersGetResponse + public function get(string $id, ?Options $options = null): Operations\OrdersGetResponse { $request = new Operations\OrdersGetRequest( id: $id, @@ -61,32 +61,28 @@ public function get(string $id): Operations\OrdersGetResponse $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/orders/{id}', Operations\OrdersGetRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('orders:get', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -103,7 +99,7 @@ public function get(string $id): Operations\OrdersGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -114,7 +110,7 @@ public function get(string $id): Operations\OrdersGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -125,7 +121,9 @@ public function get(string $id): Operations\OrdersGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -141,7 +139,7 @@ public function get(string $id): Operations\OrdersGetResponse * @return Operations\OrdersInvoiceResponse * @throws \Polar\Models\Errors\APIException */ - public function invoice(string $id): Operations\OrdersInvoiceResponse + public function invoice(string $id, ?Options $options = null): Operations\OrdersInvoiceResponse { $request = new Operations\OrdersInvoiceRequest( id: $id, @@ -149,32 +147,28 @@ public function invoice(string $id): Operations\OrdersInvoiceResponse $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/orders/{id}/invoice', Operations\OrdersInvoiceRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('orders:invoice', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -191,7 +185,7 @@ public function invoice(string $id): Operations\OrdersInvoiceResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -202,7 +196,7 @@ public function invoice(string $id): Operations\OrdersInvoiceResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -213,7 +207,9 @@ public function invoice(string $id): Operations\OrdersInvoiceResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -229,40 +225,36 @@ public function invoice(string $id): Operations\OrdersInvoiceResponse * @return Operations\OrdersListResponse * @throws \Polar\Models\Errors\APIException */ - private function listIndividual(?Operations\OrdersListRequest $request = null): Operations\OrdersListResponse + private function listIndividual(?Operations\OrdersListRequest $request = null, ?Options $options = null): Operations\OrdersListResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/orders/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $qp = Utils\Utils::getQueryParams(Operations\OrdersListRequest::class, $request, $urlOverride); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('orders:list', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -320,7 +312,7 @@ private function listIndividual(?Operations\OrdersListRequest $request = null): } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -331,7 +323,9 @@ private function listIndividual(?Operations\OrdersListRequest $request = null): } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -346,9 +340,9 @@ private function listIndividual(?Operations\OrdersListRequest $request = null): * @return \Generator * @throws \Polar\Models\Errors\APIException */ - public function list(?Operations\OrdersListRequest $request = null): \Generator + public function list(?Operations\OrdersListRequest $request = null, ?Options $options = null): \Generator { - $res = $this->listIndividual($request); + $res = $this->listIndividual($request, $options); while ($res !== null) { yield $res; $res = $res->next($res); diff --git a/src/Organizations.php b/src/Organizations.php index 0926b34..52d116b 100644 --- a/src/Organizations.php +++ b/src/Organizations.php @@ -11,6 +11,7 @@ use Polar\Hooks\HookContext; use Polar\Models\Components; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class Organizations @@ -53,42 +54,38 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\OrganizationsCreateResponse * @throws \Polar\Models\Errors\APIException */ - public function create(Components\OrganizationCreate $request): Operations\OrganizationsCreateResponse + public function create(Components\OrganizationCreate $request, ?Options $options = null): Operations\OrganizationsCreateResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/organizations/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); $hookContext = new HookContext('organizations:create', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 201) { + if (Utils\Utils::matchStatusCodes($statusCode, ['201'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -105,7 +102,7 @@ public function create(Components\OrganizationCreate $request): Operations\Organ } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -116,7 +113,9 @@ public function create(Components\OrganizationCreate $request): Operations\Organ } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -132,7 +131,7 @@ public function create(Components\OrganizationCreate $request): Operations\Organ * @return Operations\OrganizationsGetResponse * @throws \Polar\Models\Errors\APIException */ - public function get(string $id): Operations\OrganizationsGetResponse + public function get(string $id, ?Options $options = null): Operations\OrganizationsGetResponse { $request = new Operations\OrganizationsGetRequest( id: $id, @@ -140,32 +139,28 @@ public function get(string $id): Operations\OrganizationsGetResponse $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/organizations/{id}', Operations\OrganizationsGetRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('organizations:get', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -182,7 +177,7 @@ public function get(string $id): Operations\OrganizationsGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -193,7 +188,7 @@ public function get(string $id): Operations\OrganizationsGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -204,7 +199,9 @@ public function get(string $id): Operations\OrganizationsGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -223,7 +220,7 @@ public function get(string $id): Operations\OrganizationsGetResponse * @return Operations\OrganizationsListResponse * @throws \Polar\Models\Errors\APIException */ - private function listIndividual(?string $slug = null, ?int $page = null, ?int $limit = null, ?array $sorting = null): Operations\OrganizationsListResponse + private function listIndividual(?string $slug = null, ?int $page = null, ?int $limit = null, ?array $sorting = null, ?Options $options = null): Operations\OrganizationsListResponse { $request = new Operations\OrganizationsListRequest( slug: $slug, @@ -234,35 +231,31 @@ private function listIndividual(?string $slug = null, ?int $page = null, ?int $l $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/organizations/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $qp = Utils\Utils::getQueryParams(Operations\OrganizationsListRequest::class, $request, $urlOverride); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('organizations:list', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -314,7 +307,7 @@ private function listIndividual(?string $slug = null, ?int $page = null, ?int $l } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -325,7 +318,9 @@ private function listIndividual(?string $slug = null, ?int $page = null, ?int $l } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -343,9 +338,9 @@ private function listIndividual(?string $slug = null, ?int $page = null, ?int $l * @return \Generator * @throws \Polar\Models\Errors\APIException */ - public function list(?string $slug = null, ?int $page = null, ?int $limit = null, ?array $sorting = null): \Generator + public function list(?string $slug = null, ?int $page = null, ?int $limit = null, ?array $sorting = null, ?Options $options = null): \Generator { - $res = $this->listIndividual($slug, $page, $limit, $sorting); + $res = $this->listIndividual($slug, $page, $limit, $sorting, $options); while ($res !== null) { yield $res; $res = $res->next($res); @@ -362,7 +357,7 @@ public function list(?string $slug = null, ?int $page = null, ?int $limit = null * @return Operations\OrganizationsUpdateResponse * @throws \Polar\Models\Errors\APIException */ - public function update(Components\OrganizationUpdate $organizationUpdate, string $id): Operations\OrganizationsUpdateResponse + public function update(Components\OrganizationUpdate $organizationUpdate, string $id, ?Options $options = null): Operations\OrganizationsUpdateResponse { $request = new Operations\OrganizationsUpdateRequest( id: $id, @@ -371,37 +366,33 @@ public function update(Components\OrganizationUpdate $organizationUpdate, string $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/organizations/{id}', Operations\OrganizationsUpdateRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'organizationUpdate', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); $hookContext = new HookContext('organizations:update', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 403 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -418,7 +409,7 @@ public function update(Components\OrganizationUpdate $organizationUpdate, string } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 403) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -429,7 +420,7 @@ public function update(Components\OrganizationUpdate $organizationUpdate, string } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -440,7 +431,7 @@ public function update(Components\OrganizationUpdate $organizationUpdate, string } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -451,7 +442,9 @@ public function update(Components\OrganizationUpdate $organizationUpdate, string } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/PackageServiceProvider.php b/src/PackageServiceProvider.php new file mode 100644 index 0000000..34f15f6 --- /dev/null +++ b/src/PackageServiceProvider.php @@ -0,0 +1,36 @@ +mergeConfigFrom( + __DIR__.'/../config/services.php', + 'services', + ); + } + + public function register(): void + { + $security = config('services.openapi.access_token'); + $this->app->singleton( + abstract: Polar::class, + concrete: fn (): Polar => Polar::builder()->setSecurity( + $security + )->build(), + ); + } +} diff --git a/src/Polar.php b/src/Polar.php index 3edcf38..2e0213a 100644 --- a/src/Polar.php +++ b/src/Polar.php @@ -13,7 +13,7 @@ /** * Polar - Polar API: Polar HTTP and Webhooks API * - * Read the docs at https://docs.polar.sh/api + * Read the docs at https://docs.polar.sh/api-reference */ class Polar { @@ -48,6 +48,8 @@ class Polar public Orders $orders; + public Refunds $refunds; + public Checkouts $checkouts; public Files $files; @@ -68,6 +70,10 @@ class Polar public CustomerSessions $customerSessions; + public Events $events; + + public Meters $meters; + /** * Returns a new instance of the SDK builder used to configure and create the SDK instance. * @@ -93,6 +99,7 @@ public function __construct( $this->benefits = new Benefits($this->sdkConfiguration); $this->products = new Products($this->sdkConfiguration); $this->orders = new Orders($this->sdkConfiguration); + $this->refunds = new Refunds($this->sdkConfiguration); $this->checkouts = new Checkouts($this->sdkConfiguration); $this->files = new Files($this->sdkConfiguration); $this->metrics = new Metrics($this->sdkConfiguration); @@ -103,6 +110,8 @@ public function __construct( $this->customers = new Customers($this->sdkConfiguration); $this->customerPortal = new CustomerPortal($this->sdkConfiguration); $this->customerSessions = new CustomerSessions($this->sdkConfiguration); + $this->events = new Events($this->sdkConfiguration); + $this->meters = new Meters($this->sdkConfiguration); $this->sdkConfiguration->client = $this->sdkConfiguration->initHooks($this->sdkConfiguration->client); } diff --git a/src/PolarBuilder.php b/src/PolarBuilder.php index f2b6b7a..9af1bee 100644 --- a/src/PolarBuilder.php +++ b/src/PolarBuilder.php @@ -8,6 +8,8 @@ namespace Polar; +use Polar\Utils\Retry; + /** * PolarBuilder is used to configure and build an instance of the SDK. */ @@ -42,7 +44,7 @@ public function setSecurity(string $accessToken): PolarBuilder $security = new Models\Components\Security( accessToken: $accessToken ); - $this->sdkConfig->security = $security; + $this->sdkConfig->securitySource = fn () => $security; return $this; } @@ -56,7 +58,7 @@ public function setSecurity(string $accessToken): PolarBuilder */ public function setSecuritySource(\Closure $securitySource): PolarBuilder { - $this->sdkConfig->securitySource = $securitySource; + $this->sdkConfig->securitySource = fn () => new Models\Components\Security(accessToken: $securitySource()); return $this; } @@ -88,6 +90,13 @@ public function setServer(string $server): PolarBuilder return $this; } + public function setRetryConfig(Retry\RetryConfig $config): PolarBuilder + { + $this->sdkConfig->retryConfig = $config; + + return $this; + } + /** * build is used to build the SDK with any of the configured options. * diff --git a/src/PolarCustomers.php b/src/PolarCustomers.php index fe4476c..8d470ea 100644 --- a/src/PolarCustomers.php +++ b/src/PolarCustomers.php @@ -10,6 +10,7 @@ use Polar\Hooks\HookContext; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class PolarCustomers @@ -52,7 +53,7 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\CustomerPortalCustomersGetResponse * @throws \Polar\Models\Errors\APIException */ - public function get(string $id): Operations\CustomerPortalCustomersGetResponse + public function get(string $id, ?Options $options = null): Operations\CustomerPortalCustomersGetResponse { $request = new Operations\CustomerPortalCustomersGetRequest( id: $id, @@ -60,32 +61,28 @@ public function get(string $id): Operations\CustomerPortalCustomersGetResponse $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/customer-portal/customers/{id}', Operations\CustomerPortalCustomersGetRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('customer_portal:customers:get', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -102,7 +99,7 @@ public function get(string $id): Operations\CustomerPortalCustomersGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -113,7 +110,7 @@ public function get(string $id): Operations\CustomerPortalCustomersGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -124,7 +121,9 @@ public function get(string $id): Operations\CustomerPortalCustomersGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/PolarLicenseKeys.php b/src/PolarLicenseKeys.php index bd6fa72..a043aa6 100644 --- a/src/PolarLicenseKeys.php +++ b/src/PolarLicenseKeys.php @@ -11,6 +11,7 @@ use Polar\Hooks\HookContext; use Polar\Models\Components; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class PolarLicenseKeys @@ -53,42 +54,38 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\CustomerPortalLicenseKeysActivateResponse * @throws \Polar\Models\Errors\APIException */ - public function activate(Components\LicenseKeyActivate $request): Operations\CustomerPortalLicenseKeysActivateResponse + public function activate(Components\LicenseKeyActivate $request, ?Options $options = null): Operations\CustomerPortalLicenseKeysActivateResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/customer-portal/license-keys/activate'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); $hookContext = new HookContext('customer_portal:license_keys:activate', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 403 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -105,7 +102,7 @@ public function activate(Components\LicenseKeyActivate $request): Operations\Cus } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 403) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -116,7 +113,7 @@ public function activate(Components\LicenseKeyActivate $request): Operations\Cus } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -127,7 +124,7 @@ public function activate(Components\LicenseKeyActivate $request): Operations\Cus } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -138,7 +135,9 @@ public function activate(Components\LicenseKeyActivate $request): Operations\Cus } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -154,42 +153,38 @@ public function activate(Components\LicenseKeyActivate $request): Operations\Cus * @return Operations\CustomerPortalLicenseKeysDeactivateResponse * @throws \Polar\Models\Errors\APIException */ - public function deactivate(Components\LicenseKeyDeactivate $request): Operations\CustomerPortalLicenseKeysDeactivateResponse + public function deactivate(Components\LicenseKeyDeactivate $request, ?Options $options = null): Operations\CustomerPortalLicenseKeysDeactivateResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/customer-portal/license-keys/deactivate'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); $hookContext = new HookContext('customer_portal:license_keys:deactivate', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 204) { + if (Utils\Utils::matchStatusCodes($statusCode, ['204'])) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); return new Operations\CustomerPortalLicenseKeysDeactivateResponse( @@ -197,7 +192,7 @@ public function deactivate(Components\LicenseKeyDeactivate $request): Operations contentType: $contentType, rawResponse: $httpResponse ); - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -208,7 +203,7 @@ public function deactivate(Components\LicenseKeyDeactivate $request): Operations } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -219,7 +214,9 @@ public function deactivate(Components\LicenseKeyDeactivate $request): Operations } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -235,7 +232,7 @@ public function deactivate(Components\LicenseKeyDeactivate $request): Operations * @return Operations\CustomerPortalLicenseKeysGetResponse * @throws \Polar\Models\Errors\APIException */ - public function get(string $id): Operations\CustomerPortalLicenseKeysGetResponse + public function get(string $id, ?Options $options = null): Operations\CustomerPortalLicenseKeysGetResponse { $request = new Operations\CustomerPortalLicenseKeysGetRequest( id: $id, @@ -243,32 +240,28 @@ public function get(string $id): Operations\CustomerPortalLicenseKeysGetResponse $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/customer-portal/license-keys/{id}', Operations\CustomerPortalLicenseKeysGetRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('customer_portal:license_keys:get', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -285,7 +278,7 @@ public function get(string $id): Operations\CustomerPortalLicenseKeysGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -296,7 +289,7 @@ public function get(string $id): Operations\CustomerPortalLicenseKeysGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -307,7 +300,9 @@ public function get(string $id): Operations\CustomerPortalLicenseKeysGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -324,7 +319,7 @@ public function get(string $id): Operations\CustomerPortalLicenseKeysGetResponse * @return Operations\CustomerPortalLicenseKeysListResponse * @throws \Polar\Models\Errors\APIException */ - private function listIndividual(string|array|null $organizationId = null, ?string $benefitId = null, ?int $page = null, ?int $limit = null): Operations\CustomerPortalLicenseKeysListResponse + private function listIndividual(string|array|null $organizationId = null, ?string $benefitId = null, ?int $page = null, ?int $limit = null, ?Options $options = null): Operations\CustomerPortalLicenseKeysListResponse { $request = new Operations\CustomerPortalLicenseKeysListRequest( organizationId: $organizationId, @@ -335,35 +330,31 @@ private function listIndividual(string|array|null $organizationId = null, ?strin $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/customer-portal/license-keys/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $qp = Utils\Utils::getQueryParams(Operations\CustomerPortalLicenseKeysListRequest::class, $request, $urlOverride); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('customer_portal:license_keys:list', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 401 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['401', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -415,7 +406,7 @@ private function listIndividual(string|array|null $organizationId = null, ?strin } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 401) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['401'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -426,7 +417,7 @@ private function listIndividual(string|array|null $organizationId = null, ?strin } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -437,7 +428,7 @@ private function listIndividual(string|array|null $organizationId = null, ?strin } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -448,7 +439,9 @@ private function listIndividual(string|array|null $organizationId = null, ?strin } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -464,9 +457,9 @@ private function listIndividual(string|array|null $organizationId = null, ?strin * @return \Generator * @throws \Polar\Models\Errors\APIException */ - public function list(string|array|null $organizationId = null, ?string $benefitId = null, ?int $page = null, ?int $limit = null): \Generator + public function list(string|array|null $organizationId = null, ?string $benefitId = null, ?int $page = null, ?int $limit = null, ?Options $options = null): \Generator { - $res = $this->listIndividual($organizationId, $benefitId, $page, $limit); + $res = $this->listIndividual($organizationId, $benefitId, $page, $limit, $options); while ($res !== null) { yield $res; $res = $res->next($res); @@ -482,42 +475,38 @@ public function list(string|array|null $organizationId = null, ?string $benefitI * @return Operations\CustomerPortalLicenseKeysValidateResponse * @throws \Polar\Models\Errors\APIException */ - public function validate(Components\LicenseKeyValidate $request): Operations\CustomerPortalLicenseKeysValidateResponse + public function validate(Components\LicenseKeyValidate $request, ?Options $options = null): Operations\CustomerPortalLicenseKeysValidateResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/customer-portal/license-keys/validate'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); $hookContext = new HookContext('customer_portal:license_keys:validate', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -534,7 +523,7 @@ public function validate(Components\LicenseKeyValidate $request): Operations\Cus } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -545,7 +534,7 @@ public function validate(Components\LicenseKeyValidate $request): Operations\Cus } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -556,7 +545,9 @@ public function validate(Components\LicenseKeyValidate $request): Operations\Cus } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/PolarOrders.php b/src/PolarOrders.php index 0dc60bf..e74c59b 100644 --- a/src/PolarOrders.php +++ b/src/PolarOrders.php @@ -9,8 +9,8 @@ namespace Polar; use Polar\Hooks\HookContext; -use Polar\Models\Components; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class PolarOrders @@ -53,7 +53,7 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\CustomerPortalOrdersGetResponse * @throws \Polar\Models\Errors\APIException */ - public function get(string $id): Operations\CustomerPortalOrdersGetResponse + public function get(string $id, ?Options $options = null): Operations\CustomerPortalOrdersGetResponse { $request = new Operations\CustomerPortalOrdersGetRequest( id: $id, @@ -61,32 +61,28 @@ public function get(string $id): Operations\CustomerPortalOrdersGetResponse $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/customer-portal/orders/{id}', Operations\CustomerPortalOrdersGetRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('customer_portal:orders:get', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -103,7 +99,7 @@ public function get(string $id): Operations\CustomerPortalOrdersGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -114,7 +110,7 @@ public function get(string $id): Operations\CustomerPortalOrdersGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -125,7 +121,9 @@ public function get(string $id): Operations\CustomerPortalOrdersGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -141,7 +139,7 @@ public function get(string $id): Operations\CustomerPortalOrdersGetResponse * @return Operations\CustomerPortalOrdersInvoiceResponse * @throws \Polar\Models\Errors\APIException */ - public function invoice(string $id): Operations\CustomerPortalOrdersInvoiceResponse + public function invoice(string $id, ?Options $options = null): Operations\CustomerPortalOrdersInvoiceResponse { $request = new Operations\CustomerPortalOrdersInvoiceRequest( id: $id, @@ -149,32 +147,28 @@ public function invoice(string $id): Operations\CustomerPortalOrdersInvoiceRespo $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/customer-portal/orders/{id}/invoice', Operations\CustomerPortalOrdersInvoiceRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('customer_portal:orders:invoice', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -191,7 +185,7 @@ public function invoice(string $id): Operations\CustomerPortalOrdersInvoiceRespo } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -202,7 +196,7 @@ public function invoice(string $id): Operations\CustomerPortalOrdersInvoiceRespo } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -213,7 +207,9 @@ public function invoice(string $id): Operations\CustomerPortalOrdersInvoiceRespo } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -229,40 +225,36 @@ public function invoice(string $id): Operations\CustomerPortalOrdersInvoiceRespo * @return Operations\CustomerPortalOrdersListResponse * @throws \Polar\Models\Errors\APIException */ - private function listIndividual(?Operations\CustomerPortalOrdersListRequest $request = null): Operations\CustomerPortalOrdersListResponse + private function listIndividual(?Operations\CustomerPortalOrdersListRequest $request = null, ?Options $options = null): Operations\CustomerPortalOrdersListResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/customer-portal/orders/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $qp = Utils\Utils::getQueryParams(Operations\CustomerPortalOrdersListRequest::class, $request, $urlOverride); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('customer_portal:orders:list', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -320,7 +312,7 @@ private function listIndividual(?Operations\CustomerPortalOrdersListRequest $req } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -331,7 +323,9 @@ private function listIndividual(?Operations\CustomerPortalOrdersListRequest $req } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -346,9 +340,9 @@ private function listIndividual(?Operations\CustomerPortalOrdersListRequest $req * @return \Generator * @throws \Polar\Models\Errors\APIException */ - public function list(?Operations\CustomerPortalOrdersListRequest $request = null): \Generator + public function list(?Operations\CustomerPortalOrdersListRequest $request = null, ?Options $options = null): \Generator { - $res = $this->listIndividual($request); + $res = $this->listIndividual($request, $options); while ($res !== null) { yield $res; $res = $res->next($res); diff --git a/src/PolarOrganizations.php b/src/PolarOrganizations.php index 42760d3..d3877eb 100644 --- a/src/PolarOrganizations.php +++ b/src/PolarOrganizations.php @@ -10,6 +10,7 @@ use Polar\Hooks\HookContext; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class PolarOrganizations @@ -52,7 +53,7 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\CustomerPortalOrganizationsGetResponse * @throws \Polar\Models\Errors\APIException */ - public function get(string $slug): Operations\CustomerPortalOrganizationsGetResponse + public function get(string $slug, ?Options $options = null): Operations\CustomerPortalOrganizationsGetResponse { $request = new Operations\CustomerPortalOrganizationsGetRequest( slug: $slug, @@ -60,32 +61,28 @@ public function get(string $slug): Operations\CustomerPortalOrganizationsGetResp $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/customer-portal/organizations/{slug}', Operations\CustomerPortalOrganizationsGetRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('customer_portal:organizations:get', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -102,7 +99,7 @@ public function get(string $slug): Operations\CustomerPortalOrganizationsGetResp } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -113,7 +110,7 @@ public function get(string $slug): Operations\CustomerPortalOrganizationsGetResp } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -124,7 +121,9 @@ public function get(string $slug): Operations\CustomerPortalOrganizationsGetResp } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/PolarSubscriptions.php b/src/PolarSubscriptions.php index 2a514aa..4f9f9bc 100644 --- a/src/PolarSubscriptions.php +++ b/src/PolarSubscriptions.php @@ -11,6 +11,7 @@ use Polar\Hooks\HookContext; use Polar\Models\Components; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class PolarSubscriptions @@ -53,7 +54,7 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\CustomerPortalSubscriptionsCancelResponse * @throws \Polar\Models\Errors\APIException */ - public function cancel(string $id): Operations\CustomerPortalSubscriptionsCancelResponse + public function cancel(string $id, ?Options $options = null): Operations\CustomerPortalSubscriptionsCancelResponse { $request = new Operations\CustomerPortalSubscriptionsCancelRequest( id: $id, @@ -61,32 +62,28 @@ public function cancel(string $id): Operations\CustomerPortalSubscriptionsCancel $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/customer-portal/subscriptions/{id}', Operations\CustomerPortalSubscriptionsCancelRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('DELETE', $url); $hookContext = new HookContext('customer_portal:subscriptions:cancel', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 403 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -103,7 +100,7 @@ public function cancel(string $id): Operations\CustomerPortalSubscriptionsCancel } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 403) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -114,7 +111,7 @@ public function cancel(string $id): Operations\CustomerPortalSubscriptionsCancel } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -125,7 +122,7 @@ public function cancel(string $id): Operations\CustomerPortalSubscriptionsCancel } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -136,7 +133,9 @@ public function cancel(string $id): Operations\CustomerPortalSubscriptionsCancel } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -152,7 +151,7 @@ public function cancel(string $id): Operations\CustomerPortalSubscriptionsCancel * @return Operations\CustomerPortalSubscriptionsGetResponse * @throws \Polar\Models\Errors\APIException */ - public function get(string $id): Operations\CustomerPortalSubscriptionsGetResponse + public function get(string $id, ?Options $options = null): Operations\CustomerPortalSubscriptionsGetResponse { $request = new Operations\CustomerPortalSubscriptionsGetRequest( id: $id, @@ -160,32 +159,28 @@ public function get(string $id): Operations\CustomerPortalSubscriptionsGetRespon $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/customer-portal/subscriptions/{id}', Operations\CustomerPortalSubscriptionsGetRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('customer_portal:subscriptions:get', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -202,7 +197,7 @@ public function get(string $id): Operations\CustomerPortalSubscriptionsGetRespon } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -213,7 +208,7 @@ public function get(string $id): Operations\CustomerPortalSubscriptionsGetRespon } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -224,7 +219,9 @@ public function get(string $id): Operations\CustomerPortalSubscriptionsGetRespon } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -240,40 +237,36 @@ public function get(string $id): Operations\CustomerPortalSubscriptionsGetRespon * @return Operations\CustomerPortalSubscriptionsListResponse * @throws \Polar\Models\Errors\APIException */ - private function listIndividual(?Operations\CustomerPortalSubscriptionsListRequest $request = null): Operations\CustomerPortalSubscriptionsListResponse + private function listIndividual(?Operations\CustomerPortalSubscriptionsListRequest $request = null, ?Options $options = null): Operations\CustomerPortalSubscriptionsListResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/customer-portal/subscriptions/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $qp = Utils\Utils::getQueryParams(Operations\CustomerPortalSubscriptionsListRequest::class, $request, $urlOverride); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('customer_portal:subscriptions:list', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -330,7 +323,7 @@ private function listIndividual(?Operations\CustomerPortalSubscriptionsListReque } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -341,7 +334,9 @@ private function listIndividual(?Operations\CustomerPortalSubscriptionsListReque } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -356,9 +351,9 @@ private function listIndividual(?Operations\CustomerPortalSubscriptionsListReque * @return \Generator * @throws \Polar\Models\Errors\APIException */ - public function list(?Operations\CustomerPortalSubscriptionsListRequest $request = null): \Generator + public function list(?Operations\CustomerPortalSubscriptionsListRequest $request = null, ?Options $options = null): \Generator { - $res = $this->listIndividual($request); + $res = $this->listIndividual($request, $options); while ($res !== null) { yield $res; $res = $res->next($res); @@ -370,12 +365,12 @@ public function list(?Operations\CustomerPortalSubscriptionsListRequest $request * * Update a subscription of the authenticated customer or user. * - * @param Components\CustomerSubscriptionUpdate $customerSubscriptionUpdate + * @param Components\CustomerSubscriptionUpdatePrice|Components\CustomerSubscriptionCancel $customerSubscriptionUpdate * @param string $id * @return Operations\CustomerPortalSubscriptionsUpdateResponse * @throws \Polar\Models\Errors\APIException */ - public function update(Components\CustomerSubscriptionUpdate $customerSubscriptionUpdate, string $id): Operations\CustomerPortalSubscriptionsUpdateResponse + public function update(Components\CustomerSubscriptionUpdatePrice|Components\CustomerSubscriptionCancel $customerSubscriptionUpdate, string $id, ?Options $options = null): Operations\CustomerPortalSubscriptionsUpdateResponse { $request = new Operations\CustomerPortalSubscriptionsUpdateRequest( id: $id, @@ -384,37 +379,33 @@ public function update(Components\CustomerSubscriptionUpdate $customerSubscripti $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/customer-portal/subscriptions/{id}', Operations\CustomerPortalSubscriptionsUpdateRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'customerSubscriptionUpdate', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); $hookContext = new HookContext('customer_portal:subscriptions:update', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -431,7 +422,18 @@ public function update(Components\CustomerSubscriptionUpdate $customerSubscripti } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\AlreadyCanceledSubscription', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -442,7 +444,7 @@ public function update(Components\CustomerSubscriptionUpdate $customerSubscripti } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -453,7 +455,9 @@ public function update(Components\CustomerSubscriptionUpdate $customerSubscripti } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/Products.php b/src/Products.php index 4b58c4a..9e52ca9 100644 --- a/src/Products.php +++ b/src/Products.php @@ -11,6 +11,7 @@ use Polar\Hooks\HookContext; use Polar\Models\Components; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class Products @@ -53,42 +54,38 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\ProductsCreateResponse * @throws \Polar\Models\Errors\APIException */ - public function create(Components\ProductRecurringCreate|Components\ProductOneTimeCreate $request): Operations\ProductsCreateResponse + public function create(Components\ProductRecurringCreate|Components\ProductOneTimeCreate $request, ?Options $options = null): Operations\ProductsCreateResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/products/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); $hookContext = new HookContext('products:create', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 201) { + if (Utils\Utils::matchStatusCodes($statusCode, ['201'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -105,7 +102,7 @@ public function create(Components\ProductRecurringCreate|Components\ProductOneTi } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -116,7 +113,9 @@ public function create(Components\ProductRecurringCreate|Components\ProductOneTi } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -132,7 +131,7 @@ public function create(Components\ProductRecurringCreate|Components\ProductOneTi * @return Operations\ProductsGetResponse * @throws \Polar\Models\Errors\APIException */ - public function get(string $id): Operations\ProductsGetResponse + public function get(string $id, ?Options $options = null): Operations\ProductsGetResponse { $request = new Operations\ProductsGetRequest( id: $id, @@ -140,32 +139,28 @@ public function get(string $id): Operations\ProductsGetResponse $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/products/{id}', Operations\ProductsGetRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('products:get', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -182,7 +177,7 @@ public function get(string $id): Operations\ProductsGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -193,7 +188,7 @@ public function get(string $id): Operations\ProductsGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -204,7 +199,9 @@ public function get(string $id): Operations\ProductsGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -220,40 +217,36 @@ public function get(string $id): Operations\ProductsGetResponse * @return Operations\ProductsListResponse * @throws \Polar\Models\Errors\APIException */ - private function listIndividual(?Operations\ProductsListRequest $request = null): Operations\ProductsListResponse + private function listIndividual(?Operations\ProductsListRequest $request = null, ?Options $options = null): Operations\ProductsListResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/products/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $qp = Utils\Utils::getQueryParams(Operations\ProductsListRequest::class, $request, $urlOverride); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('products:list', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -294,6 +287,7 @@ private function listIndividual(?Operations\ProductsListRequest $request = null) return $sdk->listIndividual( request: new Operations\ProductsListRequest( + id: $request != null ? $request->id : null, organizationId: $request != null ? $request->organizationId : null, query: $request != null ? $request->query : null, isArchived: $request != null ? $request->isArchived : null, @@ -311,7 +305,7 @@ private function listIndividual(?Operations\ProductsListRequest $request = null) } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -322,7 +316,9 @@ private function listIndividual(?Operations\ProductsListRequest $request = null) } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -337,9 +333,9 @@ private function listIndividual(?Operations\ProductsListRequest $request = null) * @return \Generator * @throws \Polar\Models\Errors\APIException */ - public function list(?Operations\ProductsListRequest $request = null): \Generator + public function list(?Operations\ProductsListRequest $request = null, ?Options $options = null): \Generator { - $res = $this->listIndividual($request); + $res = $this->listIndividual($request, $options); while ($res !== null) { yield $res; $res = $res->next($res); @@ -356,7 +352,7 @@ public function list(?Operations\ProductsListRequest $request = null): \Generato * @return Operations\ProductsUpdateResponse * @throws \Polar\Models\Errors\APIException */ - public function update(Components\ProductUpdate $productUpdate, string $id): Operations\ProductsUpdateResponse + public function update(Components\ProductUpdate $productUpdate, string $id, ?Options $options = null): Operations\ProductsUpdateResponse { $request = new Operations\ProductsUpdateRequest( id: $id, @@ -365,37 +361,33 @@ public function update(Components\ProductUpdate $productUpdate, string $id): Ope $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/products/{id}', Operations\ProductsUpdateRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'productUpdate', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); $hookContext = new HookContext('products:update', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 403 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -412,7 +404,7 @@ public function update(Components\ProductUpdate $productUpdate, string $id): Ope } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 403) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -423,7 +415,7 @@ public function update(Components\ProductUpdate $productUpdate, string $id): Ope } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -434,7 +426,7 @@ public function update(Components\ProductUpdate $productUpdate, string $id): Ope } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -445,7 +437,9 @@ public function update(Components\ProductUpdate $productUpdate, string $id): Ope } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -462,7 +456,7 @@ public function update(Components\ProductUpdate $productUpdate, string $id): Ope * @return Operations\ProductsUpdateBenefitsResponse * @throws \Polar\Models\Errors\APIException */ - public function updateBenefits(Components\ProductBenefitsUpdate $productBenefitsUpdate, string $id): Operations\ProductsUpdateBenefitsResponse + public function updateBenefits(Components\ProductBenefitsUpdate $productBenefitsUpdate, string $id, ?Options $options = null): Operations\ProductsUpdateBenefitsResponse { $request = new Operations\ProductsUpdateBenefitsRequest( id: $id, @@ -471,37 +465,33 @@ public function updateBenefits(Components\ProductBenefitsUpdate $productBenefits $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/products/{id}/benefits', Operations\ProductsUpdateBenefitsRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'productBenefitsUpdate', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); $hookContext = new HookContext('products:update_benefits', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 403 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -518,7 +508,7 @@ public function updateBenefits(Components\ProductBenefitsUpdate $productBenefits } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 403) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -529,7 +519,7 @@ public function updateBenefits(Components\ProductBenefitsUpdate $productBenefits } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -540,7 +530,7 @@ public function updateBenefits(Components\ProductBenefitsUpdate $productBenefits } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -551,7 +541,9 @@ public function updateBenefits(Components\ProductBenefitsUpdate $productBenefits } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/Refunds.php b/src/Refunds.php new file mode 100644 index 0000000..8233fed --- /dev/null +++ b/src/Refunds.php @@ -0,0 +1,289 @@ +sdkConfiguration = $sdkConfig; + } + /** + * @param string $baseUrl + * @param array $urlVariables + * + * @return string + */ + public function getUrl(string $baseUrl, array $urlVariables): string + { + $serverDetails = $this->sdkConfiguration->getServerDetails(); + + if ($baseUrl == null) { + $baseUrl = $serverDetails->baseUrl; + } + + if ($urlVariables == null) { + $urlVariables = $serverDetails->options; + } + + return Utils\Utils::templateUrl($baseUrl, $urlVariables); + } + + /** + * Create Refund + * + * Create a refund. + * + * @param Components\RefundCreate $request + * @return Operations\RefundsCreateResponse + * @throws \Polar\Models\Errors\APIException + */ + public function create(Components\RefundCreate $request, ?Options $options = null): Operations\RefundsCreateResponse + { + $baseUrl = $this->sdkConfiguration->getServerUrl(); + $url = Utils\Utils::generateUrl($baseUrl, '/v1/refunds/'); + $urlOverride = null; + $httpOptions = ['http_errors' => false]; + $body = Utils\Utils::serializeRequestBody($request, 'request', 'json'); + if ($body === null) { + throw new \Exception('Request body is required'); + } + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('refunds:create', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + $httpResponse = $res; + } + $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; + + $statusCode = $httpResponse->getStatusCode(); + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '403', '422', '4XX', '5XX'])) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + $httpResponse = $res; + } + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Components\Refund', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\RefundsCreateResponse( + statusCode: $statusCode, + contentType: $contentType, + rawResponse: $httpResponse, + refund: $obj); + + return $response; + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['201'])) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + return new Operations\RefundsCreateResponse( + statusCode: $statusCode, + contentType: $contentType, + rawResponse: $httpResponse + ); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\RefundAmountTooHigh', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\RefundedAlready', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\HTTPValidationError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } + + /** + * List Refunds + * + * List products. + * + * @param ?Operations\RefundsListRequest $request + * @return Operations\RefundsListResponse + * @throws \Polar\Models\Errors\APIException + */ + private function listIndividual(?Operations\RefundsListRequest $request = null, ?Options $options = null): Operations\RefundsListResponse + { + $baseUrl = $this->sdkConfiguration->getServerUrl(); + $url = Utils\Utils::generateUrl($baseUrl, '/v1/refunds/'); + $urlOverride = null; + $httpOptions = ['http_errors' => false]; + + $qp = Utils\Utils::getQueryParams(Operations\RefundsListRequest::class, $request, $urlOverride); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('refunds:list', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + $httpResponse = $res; + } + $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; + + $statusCode = $httpResponse->getStatusCode(); + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + $httpResponse = $res; + } + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Components\ListResourceRefund', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\RefundsListResponse( + statusCode: $statusCode, + contentType: $contentType, + rawResponse: $httpResponse, + listResourceRefund: $obj); + $sdk = $this; + + $response->next = function () use ($sdk, $request, $responseData): ?Operations\RefundsListResponse { + $page = $request != null ? $request->page : 0; + $nextPage = $page + 1; + $jsonObject = new \JsonPath\JsonObject($responseData); + $numPages = $jsonObject->get('$.pagination.max_page'); + if ($numPages == null || $numPages[0] <= $page) { + return null; + } + if (! $responseData) { + return null; + } + $jsonObject = new \JsonPath\JsonObject($responseData); + $results = $jsonObject->get('$.items'); + + if (is_array($results)) { + $results = $results[0]; + } + if (count($results) === 0) { + return null; + } + $limit = $request != null ? $request->limit : 0; + if (count($results) < $limit) { + return null; + } + + return $sdk->listIndividual( + request: new Operations\RefundsListRequest( + id: $request != null ? $request->id : null, + organizationId: $request != null ? $request->organizationId : null, + orderId: $request != null ? $request->orderId : null, + subscriptionId: $request != null ? $request->subscriptionId : null, + customerId: $request != null ? $request->customerId : null, + succeeded: $request != null ? $request->succeeded : null, + page: $nextPage, + limit: $request != null ? $request->limit : null, + sorting: $request != null ? $request->sorting : null, + ), + ); + }; + + + return $response; + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\HTTPValidationError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } + /** + * List Refunds + * + * List products. + * + * @param ?Operations\RefundsListRequest $request + * @return \Generator + * @throws \Polar\Models\Errors\APIException + */ + public function list(?Operations\RefundsListRequest $request = null, ?Options $options = null): \Generator + { + $res = $this->listIndividual($request, $options); + while ($res !== null) { + yield $res; + $res = $res->next($res); + } + } + +} \ No newline at end of file diff --git a/src/Repositories.php b/src/Repositories.php index 71d3393..6a4d1b9 100644 --- a/src/Repositories.php +++ b/src/Repositories.php @@ -11,6 +11,7 @@ use Polar\Hooks\HookContext; use Polar\Models\Components; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class Repositories @@ -53,7 +54,7 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\RepositoriesGetResponse * @throws \Polar\Models\Errors\APIException */ - public function get(string $id): Operations\RepositoriesGetResponse + public function get(string $id, ?Options $options = null): Operations\RepositoriesGetResponse { $request = new Operations\RepositoriesGetRequest( id: $id, @@ -61,32 +62,28 @@ public function get(string $id): Operations\RepositoriesGetResponse $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/repositories/{id}', Operations\RepositoriesGetRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('repositories:get', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -103,7 +100,7 @@ public function get(string $id): Operations\RepositoriesGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -114,7 +111,7 @@ public function get(string $id): Operations\RepositoriesGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -125,7 +122,9 @@ public function get(string $id): Operations\RepositoriesGetResponse } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -141,40 +140,36 @@ public function get(string $id): Operations\RepositoriesGetResponse * @return Operations\RepositoriesListResponse * @throws \Polar\Models\Errors\APIException */ - private function listIndividual(?Operations\RepositoriesListRequest $request = null): Operations\RepositoriesListResponse + private function listIndividual(?Operations\RepositoriesListRequest $request = null, ?Options $options = null): Operations\RepositoriesListResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/repositories/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $qp = Utils\Utils::getQueryParams(Operations\RepositoriesListRequest::class, $request, $urlOverride); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('repositories:list', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -232,7 +227,7 @@ private function listIndividual(?Operations\RepositoriesListRequest $request = n } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -243,7 +238,9 @@ private function listIndividual(?Operations\RepositoriesListRequest $request = n } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -258,9 +255,9 @@ private function listIndividual(?Operations\RepositoriesListRequest $request = n * @return \Generator * @throws \Polar\Models\Errors\APIException */ - public function list(?Operations\RepositoriesListRequest $request = null): \Generator + public function list(?Operations\RepositoriesListRequest $request = null, ?Options $options = null): \Generator { - $res = $this->listIndividual($request); + $res = $this->listIndividual($request, $options); while ($res !== null) { yield $res; $res = $res->next($res); @@ -277,7 +274,7 @@ public function list(?Operations\RepositoriesListRequest $request = null): \Gene * @return Operations\RepositoriesUpdateResponse * @throws \Polar\Models\Errors\APIException */ - public function update(Components\RepositoryUpdate $repositoryUpdate, string $id): Operations\RepositoriesUpdateResponse + public function update(Components\RepositoryUpdate $repositoryUpdate, string $id, ?Options $options = null): Operations\RepositoriesUpdateResponse { $request = new Operations\RepositoriesUpdateRequest( id: $id, @@ -286,37 +283,33 @@ public function update(Components\RepositoryUpdate $repositoryUpdate, string $id $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/repositories/{id}', Operations\RepositoriesUpdateRequest::class, $request); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $body = Utils\Utils::serializeRequestBody($request, 'repositoryUpdate', 'json'); if ($body === null) { throw new \Exception('Request body is required'); } - $options = array_merge_recursive($options, $body); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); $hookContext = new HookContext('repositories:update', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 403 || $statusCode == 404 || $statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '404', '422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -333,7 +326,7 @@ public function update(Components\RepositoryUpdate $repositoryUpdate, string $id } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 403) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -344,7 +337,7 @@ public function update(Components\RepositoryUpdate $repositoryUpdate, string $id } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 404) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -355,7 +348,7 @@ public function update(Components\RepositoryUpdate $repositoryUpdate, string $id } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -366,7 +359,9 @@ public function update(Components\RepositoryUpdate $repositoryUpdate, string $id } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/SDKConfiguration.php b/src/SDKConfiguration.php index 45e3c92..15cb54c 100644 --- a/src/SDKConfiguration.php +++ b/src/SDKConfiguration.php @@ -7,16 +7,14 @@ declare(strict_types=1); namespace Polar; - +use Polar\Utils\Retry\RetryConfig; class SDKConfiguration { public ?\GuzzleHttp\ClientInterface $client = null; public Hooks\SDKHooks $hooks; - public ?Models\Components\Security $security = null; - - /** @var pure-Closure(): string */ + /** @var ?pure-Closure(): Models\Components\Security */ public ?\Closure $securitySource = null; public string $serverUrl = ''; @@ -26,11 +24,13 @@ class SDKConfiguration public string $openapiDocVersion = '0.1.0'; - public string $sdkVersion = '0.0.2'; + public string $sdkVersion = '0.0.3'; + + public string $genVersion = '2.503.2'; - public string $genVersion = '2.481.0'; + public string $userAgent = 'speakeasy-sdk/php 0.0.3 2.503.2 0.1.0 polar-sh/sdk'; - public string $userAgent = 'speakeasy-sdk/php 0.0.2 2.481.0 0.1.0 polar-sh/sdk'; + public ?RetryConfig $retryConfig = null; public function __construct() { @@ -52,20 +52,12 @@ public function getServerUrl(): string } public function hasSecurity(): bool { - return $this->security !== null || $this->securitySource !== null; + return $this->securitySource !== null; } public function getSecurity(): ?Models\Components\Security { - if ($this->securitySource !== null) { - $security = new Models\Components\Security( - accessToken: $this->securitySource->call($this) - ); - - return $security; - } else { - return $this->security; - } + return $this->securitySource->call($this); } /** @@ -73,7 +65,7 @@ public function getSecurity(): ?Models\Components\Security */ public function getServerDetails(): Utils\ServerDetails { - if ($this->serverUrl !== null && $this->serverUrl !== '') { + if ($this->serverUrl !== '') { return new Utils\ServerDetails(rtrim($this->serverUrl, '/'), []); } diff --git a/src/Subscriptions.php b/src/Subscriptions.php index 53979f8..9ebdfe0 100644 --- a/src/Subscriptions.php +++ b/src/Subscriptions.php @@ -11,6 +11,7 @@ use Polar\Hooks\HookContext; use Polar\Models\Components; use Polar\Models\Operations; +use Polar\Utils\Options; use Speakeasy\Serializer\DeserializationContext; class Subscriptions @@ -53,7 +54,7 @@ public function getUrl(string $baseUrl, array $urlVariables): string * @return Operations\SubscriptionsExportResponse * @throws \Polar\Models\Errors\APIException */ - public function export(string|array|null $organizationId = null): Operations\SubscriptionsExportResponse + public function export(string|array|null $organizationId = null, ?Options $options = null): Operations\SubscriptionsExportResponse { $request = new Operations\SubscriptionsExportRequest( organizationId: $organizationId, @@ -61,35 +62,31 @@ public function export(string|array|null $organizationId = null): Operations\Sub $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/subscriptions/export'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $qp = Utils\Utils::getQueryParams(Operations\SubscriptionsExportRequest::class, $request, $urlOverride); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('subscriptions:export', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -106,7 +103,93 @@ public function export(string|array|null $organizationId = null): Operations\Sub } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\HTTPValidationError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } + + /** + * Get Subscription + * + * Get a subscription by ID. + * + * @param string $id + * @return Operations\SubscriptionsGetResponse + * @throws \Polar\Models\Errors\APIException + */ + public function get(string $id, ?Options $options = null): Operations\SubscriptionsGetResponse + { + $request = new Operations\SubscriptionsGetRequest( + id: $id, + ); + $baseUrl = $this->sdkConfiguration->getServerUrl(); + $url = Utils\Utils::generateUrl($baseUrl, '/v1/subscriptions/{id}', Operations\SubscriptionsGetRequest::class, $request); + $urlOverride = null; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext('subscriptions:get', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + $httpResponse = $res; + } + $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; + + $statusCode = $httpResponse->getStatusCode(); + if (Utils\Utils::matchStatusCodes($statusCode, ['404', '422', '4XX', '5XX'])) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + $httpResponse = $res; + } + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Components\Subscription', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\SubscriptionsGetResponse( + statusCode: $statusCode, + contentType: $contentType, + rawResponse: $httpResponse, + subscription: $obj); + + return $response; + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\ResourceNotFound', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -117,7 +200,9 @@ public function export(string|array|null $organizationId = null): Operations\Sub } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -133,40 +218,36 @@ public function export(string|array|null $organizationId = null): Operations\Sub * @return Operations\SubscriptionsListResponse * @throws \Polar\Models\Errors\APIException */ - private function listIndividual(?Operations\SubscriptionsListRequest $request = null): Operations\SubscriptionsListResponse + private function listIndividual(?Operations\SubscriptionsListRequest $request = null, ?Options $options = null): Operations\SubscriptionsListResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/subscriptions/'); $urlOverride = null; - $options = ['http_errors' => false]; + $httpOptions = ['http_errors' => false]; $qp = Utils\Utils::getQueryParams(Operations\SubscriptionsListRequest::class, $request, $urlOverride); - $options['headers']['Accept'] = 'application/json'; - $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext('subscriptions:list', null, $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); - $options['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); - $options = Utils\Utils::convertHeadersToOptions($httpRequest, $options); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { - $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $options); + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); } catch (\GuzzleHttp\Exception\GuzzleException $error) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; $statusCode = $httpResponse->getStatusCode(); - if ($statusCode == 422 || $statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + if (Utils\Utils::matchStatusCodes($statusCode, ['422', '4XX', '5XX'])) { $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); - if ($res !== null) { - $httpResponse = $res; - } + $httpResponse = $res; } - if ($statusCode == 200) { + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -224,7 +305,7 @@ private function listIndividual(?Operations\SubscriptionsListRequest $request = } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode == 422) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -235,7 +316,9 @@ private function listIndividual(?Operations\SubscriptionsListRequest $request = } else { throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -250,13 +333,214 @@ private function listIndividual(?Operations\SubscriptionsListRequest $request = * @return \Generator * @throws \Polar\Models\Errors\APIException */ - public function list(?Operations\SubscriptionsListRequest $request = null): \Generator + public function list(?Operations\SubscriptionsListRequest $request = null, ?Options $options = null): \Generator { - $res = $this->listIndividual($request); + $res = $this->listIndividual($request, $options); while ($res !== null) { yield $res; $res = $res->next($res); } } + /** + * Revoke Subscription + * + * Revoke a subscription, i.e cancel immediately. + * + * @param string $id + * @return Operations\SubscriptionsRevokeResponse + * @throws \Polar\Models\Errors\APIException + */ + public function revoke(string $id, ?Options $options = null): Operations\SubscriptionsRevokeResponse + { + $request = new Operations\SubscriptionsRevokeRequest( + id: $id, + ); + $baseUrl = $this->sdkConfiguration->getServerUrl(); + $url = Utils\Utils::generateUrl($baseUrl, '/v1/subscriptions/{id}', Operations\SubscriptionsRevokeRequest::class, $request); + $urlOverride = null; + $httpOptions = ['http_errors' => false]; + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpRequest = new \GuzzleHttp\Psr7\Request('DELETE', $url); + $hookContext = new HookContext('subscriptions:revoke', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + $httpResponse = $res; + } + $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; + + $statusCode = $httpResponse->getStatusCode(); + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '404', '422', '4XX', '5XX'])) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + $httpResponse = $res; + } + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Components\Subscription', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\SubscriptionsRevokeResponse( + statusCode: $statusCode, + contentType: $contentType, + rawResponse: $httpResponse, + subscription: $obj); + + return $response; + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\AlreadyCanceledSubscription', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\ResourceNotFound', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\HTTPValidationError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } + + /** + * Update Subscription + * + * Update a subscription. + * + * @param Components\SubscriptionUpdatePrice|Components\SubscriptionCancel $subscriptionUpdate + * @param string $id + * @return Operations\SubscriptionsUpdateResponse + * @throws \Polar\Models\Errors\APIException + */ + public function update(Components\SubscriptionUpdatePrice|Components\SubscriptionCancel $subscriptionUpdate, string $id, ?Options $options = null): Operations\SubscriptionsUpdateResponse + { + $request = new Operations\SubscriptionsUpdateRequest( + id: $id, + subscriptionUpdate: $subscriptionUpdate, + ); + $baseUrl = $this->sdkConfiguration->getServerUrl(); + $url = Utils\Utils::generateUrl($baseUrl, '/v1/subscriptions/{id}', Operations\SubscriptionsUpdateRequest::class, $request); + $urlOverride = null; + $httpOptions = ['http_errors' => false]; + $body = Utils\Utils::serializeRequestBody($request, 'subscriptionUpdate', 'json'); + if ($body === null) { + throw new \Exception('Request body is required'); + } + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); + $hookContext = new HookContext('subscriptions:update', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + $httpResponse = $res; + } + $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; + + $statusCode = $httpResponse->getStatusCode(); + if (Utils\Utils::matchStatusCodes($statusCode, ['403', '404', '422', '4XX', '5XX'])) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + $httpResponse = $res; + } + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Components\Subscription', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\SubscriptionsUpdateResponse( + statusCode: $statusCode, + contentType: $contentType, + rawResponse: $httpResponse, + subscription: $obj); + + return $response; + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['403'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\AlreadyCanceledSubscription', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['404'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\ResourceNotFound', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Polar\Models\Errors\HTTPValidationError', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Polar\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { + throw new \Polar\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \Polar\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } + } \ No newline at end of file diff --git a/src/Utils/Options.php b/src/Utils/Options.php new file mode 100644 index 0000000..2f8a7ee --- /dev/null +++ b/src/Utils/Options.php @@ -0,0 +1,67 @@ +|null $retryCodes + */ + public ?array $retryCodes = null; + + public static function builder(): OptionsBuilder + { + return new OptionsBuilder(); + } +} + +class OptionsBuilder +{ + public Options $options; + + public function __construct() + { + $this->options = new Options(); + } + + /** + * Sets the configuration to use for retries. + * + * @param RetryConfig $config + * @return OptionsBuilder + */ + public function setRetryConfig(RetryConfig $config): OptionsBuilder + { + $this->options->retryConfig = $config; + + return $this; + } + + /** + * Specifies which HTTP status codes should be retried. + * + * @param array $codes + * @return OptionsBuilder + */ + public function setRetryCodes(array $codes): OptionsBuilder + { + $this->options->retryCodes = $codes; + + return $this; + } + + public function build(): Options + { + return $this->options; + } +} diff --git a/src/Utils/PathParameters.php b/src/Utils/PathParameters.php index 1dc6f6f..1c63afa 100644 --- a/src/Utils/PathParameters.php +++ b/src/Utils/PathParameters.php @@ -15,10 +15,10 @@ class PathParameters /** * @param string $type * @param mixed $pathParams - * @param array>> $globals + * @param array>>|null $globals * @return array */ - public function parsePathParams(string $type, mixed $pathParams, array $globals): array + public function parsePathParams(string $type, mixed $pathParams, ?array $globals): array { $parsed = []; @@ -71,6 +71,11 @@ private function parseSimplePathParams(ParamsMetadata $metadata, mixed $value): case 'object': $vals = []; + $cls = get_class($value); + if ($cls === 'Brick\\Math\\BigDecimal' || $cls === 'Brick\\Math\\BigInteger') { + $pathParams[$metadata->name] = valToString($value, []); + break; + } foreach ($value as $field => $fieldValue) { /** @phpstan-ignore-line */ if ($fieldValue === null) { continue; diff --git a/src/Utils/QueryParameters.php b/src/Utils/QueryParameters.php index 585a9ba..f6ab9e8 100644 --- a/src/Utils/QueryParameters.php +++ b/src/Utils/QueryParameters.php @@ -167,7 +167,11 @@ private function parseDelimitedParams(ParamsMetadata $metadata, mixed $value, st switch (gettype($value)) { case 'object': $items = []; - + $cls = get_class($value); + if ($cls === 'Brick\\Math\\BigDecimal' || $cls === 'Brick\\Math\\BigInteger') { + $queryParams[$metadata->name] = valToString($value, []); + break; + } foreach ($value as $field => $val) { /** @phpstan-ignore-line */ if ($val === null) { continue; diff --git a/src/Utils/Retry/PermanentError.php b/src/Utils/Retry/PermanentError.php new file mode 100644 index 0000000..2dee79f --- /dev/null +++ b/src/Utils/Retry/PermanentError.php @@ -0,0 +1,17 @@ +initialInterval = $initialIntervalMs; + $this->maxInterval = $maxIntervalMs; + $this->exponent = $exponent; + $this->maxElapsedTime = $maxElapsedTimeMs; + $this->retryConnectionErrors = $retryConnectionErrors; + } +} diff --git a/src/Utils/Retry/RetryConfigNone.php b/src/Utils/Retry/RetryConfigNone.php new file mode 100644 index 0000000..1a82e0c --- /dev/null +++ b/src/Utils/Retry/RetryConfigNone.php @@ -0,0 +1,15 @@ + $statusCodesToRetry + * @return ResponseInterface + */ + public static function retryWrapper(callable $fn, RetryConfig $config, array $statusCodesToRetry): ResponseInterface + { + $retryCount = 0; + $start = LocalDateTime::now(TimeZone::utc()); + while (true) { + try { + $httpResponse = $fn(); + if ($config->strategy !== RetryStrategy::NONE && RetryUtils::isRetryableResponse($httpResponse, $statusCodesToRetry)) { + throw new TemporaryError('Response failed with retryable status code', response: $httpResponse); + } + + return $httpResponse; + } catch (\Exception $e) { + if ($e instanceof PermanentError) { + throw $e->getPrevious(); + } + if ($config instanceof RetryConfigNone) { + throw $e->getPrevious(); + } elseif ($config instanceof RetryConfigBackoff) { + $elapsed = 1000 * (LocalDateTime::now(TimeZone::utc())->getTime()->toSecondOfDay() - $start->getTime()->toSecondOfDay()); + if ($elapsed > $config->maxElapsedTime) { + if ($e instanceof TemporaryError) { + return $e->response; + } + throw $e; + } + $retryInterval = 0; + if ($e instanceof TemporaryError) { + $retryInterval = RetryUtils::retryInterval($e->response); + } + if ($retryInterval <= 0) { + $retryInterval = $config->initialInterval * pow($retryCount, $config->exponent) + (rand(0, 1) * 1000); + } + + $d = min($retryInterval, $config->maxInterval); + + usleep((int) $d * 1000); + + $retryCount++; + } + } + } + } + + public static function retryInterval(?ResponseInterface $response): int + { + if ($response == null) { + return 0; + } + $retryAfter = $response->getHeader('Retry-After'); + if (count($retryAfter) == 0) { + return 0; + } + $retryAfter = $retryAfter[0]; + if ((string) (int) $retryAfter == $retryAfter) { + return (int) $retryAfter * 1000; + } + + try { + $parsedDate = LocalDateTime::parse($retryAfter); + $deltaMS = ($parsedDate->getNano() * 1000) - (LocalDateTime::now(TimeZone::utc())->getNano() * 1000); + + return $deltaMS > 0 ? (int) ceil($deltaMS) : 0; + } catch (DateTimeParseException|DateTimeException $e) { + return 0; + } + } + + /** + * @param ResponseInterface $response + * @param array $statusCodes + * @return bool + */ + public static function isRetryableResponse(ResponseInterface $response, array $statusCodes): bool + { + $actual = (string) $response->getStatusCode(); + + $final = false; + foreach ($statusCodes as $code) { + $matches = []; + if (! preg_match('/^[0-9]xx$/', $code, $matches)) { + return $code === $actual; + } + + $expectFamily = mb_substr($code, 0, 1); + if (! $expectFamily) { + throw new \Exception('Invalid status code range'); + } + + $actualFamily = mb_substr($actual, 0, 1); + if (! $actualFamily) { + throw new \Exception('Invalid response status code: {$actual}'); + } + + if ($actualFamily === $expectFamily) { + $final = true; + } + } + + return $final; + } +} diff --git a/src/Utils/Retry/TemporaryError.php b/src/Utils/Retry/TemporaryError.php new file mode 100644 index 0000000..a3763cc --- /dev/null +++ b/src/Utils/Retry/TemporaryError.php @@ -0,0 +1,21 @@ +response = $response; + } +} diff --git a/src/Utils/UnionHandler.php b/src/Utils/UnionHandler.php index 04ea8a2..ab81c7f 100644 --- a/src/Utils/UnionHandler.php +++ b/src/Utils/UnionHandler.php @@ -72,26 +72,11 @@ public function serializeUnion( if ($this->isPrimitiveType(gettype($data))) { return $this->matchSimpleType($data, $type, $context); } else { - if (is_array($data)) { - if (array_is_list($data) && ! empty($data)) { - $innerType = gettype($data[0]); - if ($innerType === 'object') { - $innerType = get_class($data[0]); - } - $resolvedType = [ - 'name' => 'array', - 'params' => ['name' => $innerType, 'params' => []], - ]; + if (is_array($data) && ! empty($data)) { + if (array_is_list($data)) { + return $this->matchArrayType($data, $type, $context); } else { - $keyType = gettype(array_key_first($data)); - $valueType = gettype($data[array_key_first($data)]); - $resolvedType = [ - 'name' => 'array', - 'params' => [ - ['name' => $keyType, 'params' => []], - ['name' => $valueType, 'params' => []], - ], - ]; + return $this->matchAssociativeArrayType($data, $type, $context); } } else { $resolvedType = null; @@ -112,7 +97,6 @@ public function serializeUnion( return $context->getNavigator()->accept($data, $resolvedType); } } - /** * @param DeserializationVisitorInterface $visitor * @param mixed $data @@ -152,8 +136,7 @@ public function deserializeUnion(DeserializationVisitorInterface $visitor, mixed $typeToTry = $possibleType['name']; if ($typeToTry === 'array') { - $typeNames = array_map(fn ($t) => $t['name'], $possibleType['params']); - $typeToTry = 'array<'.implode(', ', $typeNames).'>'; + $typeToTry = $this->resolveArrayTypes($possibleType); } if ($typeToTry === 'enum') { $typeToTry = $possibleType['params'][0]['name']; @@ -235,6 +218,85 @@ private function matchSimpleType(mixed $data, array $type, Context $context): mi return null; } + /** + * @param mixed $data + * @param array $type + * @param Context $context + */ + private function matchArrayType(mixed $data, array $type, Context $context): mixed + { + $dataType = gettype($data[0]); + if ($dataType === 'object') { + $dataType = get_class($data[0]); + } + + foreach ($type['params'] as $possibleType) { + $isNotArray = $possibleType['name'] != 'array'; + $isNotListArray = $possibleType['name'] == 'array' && count($possibleType['params']) > 1 && $possibleType['params'][0]['name'] != 'integer'; + + if ($isNotArray || $isNotListArray) { + continue; + } else { + if (count($possibleType['params']) == 2) { + $possibleValueType = $possibleType['params'][1]['name']; + } else { + $possibleValueType = $possibleType['params'][0]['name']; + } + + if ($possibleValueType == 'mixed' || $possibleValueType == $dataType) { + return $context->getNavigator()->accept($data, $possibleType); + } + } + } + + $resolvedType = [ + 'name' => 'array', + 'params' => ['name' => $dataType, 'params' => []], + ]; + + return $context->getNavigator()->accept($data, $resolvedType); + } + + /** + * @param mixed $data + * @param array $type + * @param Context $context + */ + private function matchAssociativeArrayType(mixed $data, array $type, Context $context): mixed + { + $keyType = gettype(array_key_first($data)); + $value = $data[array_key_first($data)]; + $valueType = gettype($value); + foreach ($type['params'] as $possibleType) { + $isNotArray = $possibleType['name'] != 'array'; + $isNotAssociativeArray = $possibleType['name'] == 'array' && (count($possibleType['params']) < 2 || $possibleType['params'][0]['name'] != 'string'); + + if ($isNotArray || $isNotAssociativeArray) { + continue; + } else { + $possibleValueType = $possibleType['params'][1]['name']; + + if ($valueType == 'object') { + $valueType = get_class($value); + } + + if ($possibleValueType == 'mixed' || $possibleValueType == $valueType) { + return $context->getNavigator()->accept($data, $possibleType); + } + } + } + + $resolvedType = [ + 'name' => 'array', + 'params' => [ + ['name' => $keyType, 'params' => []], + ['name' => $valueType, 'params' => []], + ], + ]; + + return $context->getNavigator()->accept($data, $resolvedType); + } + /** * @param string $type * @return bool @@ -315,4 +377,26 @@ private function reorderTypes(array $type): array return $type; } + + + /** + * @param array $possibleType + * @return string + */ + private function resolveArrayTypes(array $possibleType): string + { + $typeNames = []; + foreach ($possibleType['params'] as $param) { + + if ($param['name'] === 'union') { + $innerTypes = array_map(fn ($t) => $t['name'], $param['params']); + $typeNames[] = $typeToTry = implode('|', $innerTypes); + } else { + $typeNames[] = $param['name']; + } + } + $typeToTry = 'array<'.implode(', ', $typeNames).'>'; + + return $typeToTry; + } } diff --git a/src/Utils/Utils.php b/src/Utils/Utils.php index f4cc34d..78ea070 100644 --- a/src/Utils/Utils.php +++ b/src/Utils/Utils.php @@ -356,6 +356,33 @@ public static function urljoin(string $base, string $rel): string return $ret; } + /** + * matchStatusCodes + * + * @param int $statusCode + * @param array $statusCodes + * @return bool + */ + public static function matchStatusCodes(int $statusCode, array $statusCodes): bool + { + $statusCode = (string) $statusCode; + if (in_array('default', $statusCodes)) { + return true; + } + + foreach ($statusCodes as $code) { + if ($code == $statusCode) { + return true; + } + + if (substr($code, -2) === 'XX' && substr($code, 0, 1) === substr($statusCode, 0, 1)) { + return true; + } + } + + return false; + } + } function removePrefix(string $text, string $prefix): string